SlideShare una empresa de 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

Más contenido relacionado

Destacado

Destacado (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...
 

Similar 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
 

Similar 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...
 

Más de Ilio Catallo

Más 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

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

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