Now that you have your strings nicely separated out from business components and user interface, it is time to translate them. You have a resource bundle (.properties
file, XLIFF file, or Java class) with your default text—but you have not really told the ADF framework what that language is. To add this information, you add a suffix to the file, using a two-character ISO 639 language code. If, for example, your default language is English, you add _en
to the file name, making a file such as ModelBundle_en.properties
.
If you wish to specify a specific country version of the language, you can add an additional suffix using a two-character ISO 3166 country code. For example, French as spoken in France would be ModelBundle_fr_FR
while French as spoken in Canada would be ModelBundle_fr_CA
.
To start your translation process, you create copies of your default file or class with different suffixes for all your target languages. You can then send out your property or XLIFF file to be translated.
Tip
Do not send a Java
ListResourceBundle
class to be translated unless your translator happens to be a Java programmer in his spare time.
When you get your translation back, you need to place all of your translated resource files in the file system next to the original default resource files in your project:
Additionally, you will have to define the languages your application will offer in the faces-config.xml file. You can find this file in your View project under Web Content/ WEB-INF. On the Application sub-tab, scroll down to the Locale Config section, set Default Locale and add all the languages your application supports: