SlideShare uma empresa Scribd logo
1 de 10
Internationalization in Struts
Ilio Catallo – info@iliocatallo.it
Outline
¤ How to internationalize a web app
¤ Distinguish between different localities
¤ Display appropriate message for different localities
¤ Automatically format elements sensitive to locality
¤ References
2
How to internationalize
a web app
Internationalization and
Localization
¤ Internationalization (i18n) is the process of designing an
application so that it can be adapted to various
languages and regions without engineering changes
¤ Localization (l10n) is the process of adapting software for
a specific region or language by adding locale-specific
components and translating text
4
Internationalization requirements
¤ To be internationalized, an application should be able to:
¤ Distinguish between different localities
¤ Display appropriate messages and labels for different
localities (using the same executable)
¤ Provide support for new localities without compiling a new
executable
¤ Automatically format elements sensitive to locality (e.g.,
dates)
5
Distinguish between different
localities
¤ The Struts framework maintains a standard Locale object
for each user (java.util.Locale)
¤ A Locale object represents a specific geographical,
political, or cultural region
¤ Example: the locale for French-speaking Canadians
is Locale l = new Locale("fr", "CA")
¤ Components that can alter their behavior by locality are
called locale-sensitive
¤ A number of Struts components are locale-sensitive and
make use of the Locale object that the framework
manages for each user
6
Display appropriate messages and
labels for different localities (1/2)
¤ Every message that may be displayed in the application
is stored in a separate file, called the resource bundle
¤ Messages can be updated independently from the source
code (and vice versa)
¤ The web app can be localized by a adding resource
bundle for each supported locale, according to a
specific naming convention:
¤ Example: application_it_IT.properties
7
Display appropriate messages and
labels for different localities (2/2)
application.properties (snippet)
registerform.email.msg=Invalid e-mail address
application_it_IT.properties (snippet)
registerform.email.msg=Indirizzo e-mail non valido
¤ The same key is used for the element regardless of
locale, but the message it returns may be different
¤ To support another locale, just add a new resource
bundle
8
Automatically format elements
sensitive to locality
¤ Elements sensitive to locality, such as dates and
currencies, may be subject to different formatting
¤ Any local-specific pattern is specified in the resource
bundle according to java.text.MessageFormat
conventions
Localizing a date in application.properties
register.welcome.message=Welcome {0}, today is
{1, date, long}
The second argument
is expected to be a
date
9
References
¤ Struts 1 In Action, T. N. Husted, C. Dumoulin, G. Franciscus,
D. Winterfeldt, Manning Publications Co.
¤ MessageFormat Javadoc,
http://docs.oracle.com/javase/1.5.0/docs/api/java/text/
MessageFormat.html
10

Mais conteúdo relacionado

Destaque

Destaque (11)

C++ programming Unit 5 flow of control
C++ programming Unit 5 flow of controlC++ programming Unit 5 flow of control
C++ programming Unit 5 flow of control
 
Química nos veículos automotores 3°4
Química nos veículos automotores 3°4Química nos veículos automotores 3°4
Química nos veículos automotores 3°4
 
Adfactors
Adfactors Adfactors
Adfactors
 
Konsep dasar asuhan kehamilan poltekkes sby
Konsep dasar asuhan kehamilan poltekkes sbyKonsep dasar asuhan kehamilan poltekkes sby
Konsep dasar asuhan kehamilan poltekkes sby
 
FMD 492 E Final Evaluation
FMD 492 E Final EvaluationFMD 492 E Final Evaluation
FMD 492 E Final Evaluation
 
[대학생 연합 해커톤 UNITHON 3RD] Mingginyu_ppt
[대학생 연합 해커톤 UNITHON 3RD] Mingginyu_ppt[대학생 연합 해커톤 UNITHON 3RD] Mingginyu_ppt
[대학생 연합 해커톤 UNITHON 3RD] Mingginyu_ppt
 
Standar asuhan keperawatan
Standar asuhan keperawatanStandar asuhan keperawatan
Standar asuhan keperawatan
 
askeb Bayi sehat dengan imunisasi campak
askeb Bayi sehat dengan imunisasi campakaskeb Bayi sehat dengan imunisasi campak
askeb Bayi sehat dengan imunisasi campak
 
Arrays
ArraysArrays
Arrays
 
Legno - 6
Legno - 6Legno - 6
Legno - 6
 
UDI. CURSO Intef. Competencias Clave. el desarrollo y el impacto de la tecnol...
UDI. CURSO Intef. Competencias Clave. el desarrollo y el impacto de la tecnol...UDI. CURSO Intef. Competencias Clave. el desarrollo y el impacto de la tecnol...
UDI. CURSO Intef. Competencias Clave. el desarrollo y el impacto de la tecnol...
 

Semelhante a Internationalization in Jakarta Struts 1.3

8 Tips & Tricks for Better BizTalk Programming
8 Tips & Tricks for Better BizTalk Programming8 Tips & Tricks for Better BizTalk Programming
8 Tips & Tricks for Better BizTalk Programming
Daniel Toomey
 
Orion context broker webminar 2013 05-30
Orion context broker webminar 2013 05-30Orion context broker webminar 2013 05-30
Orion context broker webminar 2013 05-30
Fermin Galan
 
Orion context broker webminar 2013 06-19
Orion context broker webminar 2013 06-19Orion context broker webminar 2013 06-19
Orion context broker webminar 2013 06-19
Fermin Galan
 
Internationlization
InternationlizationInternationlization
Internationlization
Tuan Ngo
 
Localization and globalization in c#
Localization and globalization in c#Localization and globalization in c#
Localization and globalization in c#
PaYal Umraliya
 

Semelhante a Internationalization in Jakarta Struts 1.3 (20)

I18n design approach for global enterprise platforms
I18n design approach for global enterprise platformsI18n design approach for global enterprise platforms
I18n design approach for global enterprise platforms
 
8 Tips & Tricks for Better BizTalk Programming
8 Tips & Tricks for Better BizTalk Programming8 Tips & Tricks for Better BizTalk Programming
8 Tips & Tricks for Better BizTalk Programming
 
Software Internationalization Crash Course
Software Internationalization Crash CourseSoftware Internationalization Crash Course
Software Internationalization Crash Course
 
Internationalizing Your AngularJS App
Internationalizing Your AngularJS AppInternationalizing Your AngularJS App
Internationalizing Your AngularJS App
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Internationalization
InternationalizationInternationalization
Internationalization
 
Internationalize your JavaScript Application: Prepare for "the next billion" ...
Internationalize your JavaScript Application: Prepare for "the next billion" ...Internationalize your JavaScript Application: Prepare for "the next billion" ...
Internationalize your JavaScript Application: Prepare for "the next billion" ...
 
C Course Material0209
C Course Material0209C Course Material0209
C Course Material0209
 
Beyond internationalization i18n
Beyond internationalization i18nBeyond internationalization i18n
Beyond internationalization i18n
 
Orion context broker webminar 2013 05-30
Orion context broker webminar 2013 05-30Orion context broker webminar 2013 05-30
Orion context broker webminar 2013 05-30
 
Inside.Net
Inside.NetInside.Net
Inside.Net
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
I18n
I18nI18n
I18n
 
147 341-1-pb baik
147 341-1-pb baik147 341-1-pb baik
147 341-1-pb baik
 
Localizing web sites in ruby on rails
Localizing web sites in ruby on railsLocalizing web sites in ruby on rails
Localizing web sites in ruby on rails
 
Orion context broker webminar 2013 06-19
Orion context broker webminar 2013 06-19Orion context broker webminar 2013 06-19
Orion context broker webminar 2013 06-19
 
Internationlization
InternationlizationInternationlization
Internationlization
 
GNU Internationalization Presentation
GNU Internationalization PresentationGNU Internationalization Presentation
GNU Internationalization Presentation
 
Localization and globalization in c#
Localization and globalization in c#Localization and globalization in c#
Localization and globalization in c#
 
AD301: Introducing the Composite Application Container Framework - Lotusphere...
AD301: Introducing the Composite Application Container Framework - Lotusphere...AD301: Introducing the Composite Application Container Framework - Lotusphere...
AD301: Introducing the Composite Application Container Framework - Lotusphere...
 

Mais de Ilio Catallo

Mais de Ilio Catallo (20)

C++ Standard Template Library
C++ Standard Template LibraryC++ Standard Template Library
C++ Standard Template Library
 
Regular types in C++
Regular types in C++Regular types in C++
Regular types in C++
 
Resource wrappers in C++
Resource wrappers in C++Resource wrappers in C++
Resource wrappers in C++
 
Memory management in C++
Memory management in C++Memory management in C++
Memory management in C++
 
Operator overloading in C++
Operator overloading in C++Operator overloading in C++
Operator overloading in C++
 
Multidimensional arrays in C++
Multidimensional arrays in C++Multidimensional arrays in C++
Multidimensional arrays in C++
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
Pointers & References in C++
Pointers & References in C++Pointers & References in C++
Pointers & References in C++
 
Spring MVC - Wiring the different layers
Spring MVC -  Wiring the different layersSpring MVC -  Wiring the different layers
Spring MVC - Wiring the different layers
 
Java and Java platforms
Java and Java platformsJava and Java platforms
Java and Java platforms
 
Spring MVC - Web Forms
Spring MVC  - Web FormsSpring MVC  - Web Forms
Spring MVC - Web Forms
 
Spring MVC - The Basics
Spring MVC -  The BasicsSpring MVC -  The Basics
Spring MVC - The Basics
 
Web application architecture
Web application architectureWeb application architecture
Web application architecture
 
Introduction To Spring
Introduction To SpringIntroduction To Spring
Introduction To Spring
 
Gestione della memoria in C++
Gestione della memoria in C++Gestione della memoria in C++
Gestione della memoria in C++
 
Array in C++
Array in C++Array in C++
Array in C++
 
Puntatori e Riferimenti
Puntatori e RiferimentiPuntatori e Riferimenti
Puntatori e Riferimenti
 
Java Persistence API
Java Persistence APIJava Persistence API
Java Persistence API
 
JSP Standard Tag Library
JSP Standard Tag LibraryJSP Standard Tag Library
JSP Standard Tag Library
 
Validation in Jakarta Struts 1.3
Validation in Jakarta Struts 1.3Validation in Jakarta Struts 1.3
Validation in Jakarta Struts 1.3
 

Último

Último (20)

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Internationalization in Jakarta Struts 1.3

  • 1. Internationalization in Struts Ilio Catallo – info@iliocatallo.it
  • 2. Outline ¤ How to internationalize a web app ¤ Distinguish between different localities ¤ Display appropriate message for different localities ¤ Automatically format elements sensitive to locality ¤ References 2
  • 4. Internationalization and Localization ¤ Internationalization (i18n) is the process of designing an application so that it can be adapted to various languages and regions without engineering changes ¤ Localization (l10n) is the process of adapting software for a specific region or language by adding locale-specific components and translating text 4
  • 5. Internationalization requirements ¤ To be internationalized, an application should be able to: ¤ Distinguish between different localities ¤ Display appropriate messages and labels for different localities (using the same executable) ¤ Provide support for new localities without compiling a new executable ¤ Automatically format elements sensitive to locality (e.g., dates) 5
  • 6. Distinguish between different localities ¤ The Struts framework maintains a standard Locale object for each user (java.util.Locale) ¤ A Locale object represents a specific geographical, political, or cultural region ¤ Example: the locale for French-speaking Canadians is Locale l = new Locale("fr", "CA") ¤ Components that can alter their behavior by locality are called locale-sensitive ¤ A number of Struts components are locale-sensitive and make use of the Locale object that the framework manages for each user 6
  • 7. Display appropriate messages and labels for different localities (1/2) ¤ Every message that may be displayed in the application is stored in a separate file, called the resource bundle ¤ Messages can be updated independently from the source code (and vice versa) ¤ The web app can be localized by a adding resource bundle for each supported locale, according to a specific naming convention: ¤ Example: application_it_IT.properties 7
  • 8. Display appropriate messages and labels for different localities (2/2) application.properties (snippet) registerform.email.msg=Invalid e-mail address application_it_IT.properties (snippet) registerform.email.msg=Indirizzo e-mail non valido ¤ The same key is used for the element regardless of locale, but the message it returns may be different ¤ To support another locale, just add a new resource bundle 8
  • 9. Automatically format elements sensitive to locality ¤ Elements sensitive to locality, such as dates and currencies, may be subject to different formatting ¤ Any local-specific pattern is specified in the resource bundle according to java.text.MessageFormat conventions Localizing a date in application.properties register.welcome.message=Welcome {0}, today is {1, date, long} The second argument is expected to be a date 9
  • 10. References ¤ Struts 1 In Action, T. N. Husted, C. Dumoulin, G. Franciscus, D. Winterfeldt, Manning Publications Co. ¤ MessageFormat Javadoc, http://docs.oracle.com/javase/1.5.0/docs/api/java/text/ MessageFormat.html 10