Application Localization

You can use message properties files to enable you to localize your applications.

Applications are made up of components. Components are reusable program building blocks that can be combined with other components to form an application. Depending on how you have developed your application, your application could have:
  • no message properties files.
  • a default message properties file for the whole application.
  • a message properties file for each component that makes up your application.

It is best practice, when creating an application that may require localization, to create at least one default message property file for the application. When you want to localize the application, you can use the default message property file as a template, and then create a new message property file for each language you want the application to use. If you also want the application to be available in different locales within that language, create a message property file for each locale.

Depending on the size of your application, you may want to create a message properties file for each component in your application. Therefore, for an individual component in an application, you may have:
  • componentMessages.properties - default language.
  • componentMessages_fr.properties - French language but no specific locale.
  • componentMessages_fr_CA.properties - French language/Canadian locale.
For example, you may want a component called AboutMessages to be available in the French language. A French language pack could contain 6 locales. In this case, the AboutMessages component could contain:
  • AboutMessages_fr.properties
  • AboutMessages_fr_BE.properties
  • AboutMessages_fr_CA.properties
  • AboutMessages_fr_FR.properties
  • AboutMessages_fr_LU.properties
  • AboutMessages_fr_MC.properties
  • AboutMessages_fr_CH.properties