Language-specific and Country-specific Properties Files

The language specific properties file is a copy of the base properties file. This file is renamed using the naming conventions for languages and regions.

Each localized language is represented by a two-letter code, in the format ll, where ll is a lowercase, two-letter ISO 639 language code. For a list of language codes, visit the following web site:

http://www.loc.gov/standards/iso639-2/langhome.html

Each country is represented by a two-letter code, in the format CC, where CC is an uppercase, two-letter ISO 3166 country code. For a list of country codes, visit the following web site:

http://www.iso.org/iso/english_country_names_and_code_elements

The form name, language code, and optional country code are separated by underscores. The table Renaming Locale-specific Properties Files shows examples of locale-specific properties files for a form named DemoForm.)

Renaming Locale-specific Properties Files
Filename Locale description
DemoForm.properties
Original filename. This is the base properties file.
DemoForm_fr.properties
Contains localized strings for the French version of the form. Use this format (without specifying a region) when there is only a single version of the form for this language.
DemoForm_fr_FR.properties
Contains localized strings for the French version of the form used in France.
DemoForm_fr_CA.properties
Contains localized strings for the French version of the form used in Canada.
DemoForm_ja.properties
Contains localized strings for the Japanese version of the form.

As shown in the table Renaming Locale-specific Properties Files, if your form is called DemoForm, the automatically generated base properties file will be called DemoForm.properties. This is the file that will contain the strings typed on the form’s property sheets.

To create a French version of this form, copy the DemoForm.properties file and rename the copy DemoForm_fr.properties. This is a language specific variant of the properties file which contains the translation for the French language.

You can also create country specific versions of DemoForm_fr.properties file for France and French-speaking Canada. The country specific variant of the properties file contains only those keys for which the translation varies locally in each country.

While creating country specific properties file such as DemoForm_fr_FR.properties and DemoForm_fr_CA.properties, it is better to create the DemoForm_fr_FR.properties and do all the translations. Then copy the latter to DemoForm_fr_CA.properties and make the additional changes.

Finally, in both DemoForm_fr_FR.properties and DemoForm_fr_CA.properties delete all the entries whose keys and values are identical to those in DemoForm_fr.properties.

Note: The hierarchy in which the keys are resolved is as follows:
  • The keys are first resolved in country specific versions of the properties file such as DemoForm_fr_FR.properties and DemoForm_fr_CA.properties.
  • The keys not provided in the country specific versions are resolved in the language specific version of the properties file such as DemoForm_fr.properties.
  • The keys not provided in the language specific version are resolved in the base properties file such as DemoForm.properties.

If you want to make changes to the labels or messages in the base properties file of your form, and you want corresponding changes to appear in the language specific versions of the properties file, you must make the latter changes manually by editing the strings in the language-specific version of the properties files. An alternative way of doing these changes is as follows:

  1. You can select both the base properties and your language specific properties file in Project Explorer and use Context Menu > Compare With > Each Other to open them side-by-side in the Property Compare editor.
  2. Use the Copy All Non-Conflicting Changes or Copy Current Change (From ... To ...) actions to add new keys and delete old keys from your localized version. For new keys and those with updated values you can provide a new translation.
    Note: If the property keys are very similar, the Property Compare editor sometimes misidentifies change types. It is up to you to inspect each change and decide whether the default merge action proposed by the editor is appropriate. If not, you can manually add, delete or amend the localized keys and values instead of using the Copy Current Change (From ... To ...) action.