Struts2 Localization and internationalization
by, 07-07-2012 at 06:47 PM (2216 Views)
In order to make products and services compatiable with local cultures and languages, the internationalization process is used. Localization is a process that plans implement products and services and make them adaptable to specific culture and language. The internationalization process is also refered as localization enablement or translation. Internationalization is also abbreviated as i18n.
• It starts with i.
• It ends with n
• It contains 18 characters between i and n.
The internationalization (i18n) support is provided by Struts2 using interceptors, resource bundles and taglibraries. Following places are used:
• Message and Errors
• The UI Tags
• Action classes
The web application users are provided locale options and different language options using resource bundles of Struts2. It is not your headache to write your pages in multiple languages. A resource bundle is created in each language you want to convert your pages. The resource bundle will contain the messages, text and titles. Resource bundle contains the key-value pair values in simple flat file formats in your application.
Following is the simplest format of resource bundle file.