Creating and editing translation files for Domains can be a complicated process that often happens incrementally. The best strategy for you depends on your deployment. The following sections describe a common workflow that is useful for most situations.
You can create and edit the properties file in any text editor. Some editors provide features for editing properties files. There are also Java translation editors that manage all of the properties files together, allowing you to translate in parallel and find missing keys and missing translations.
Creating Properties Files
| 1. | If you know you will be translating, create your labels and descriptions in a properties file instead of in the Domain Designer. This makes it easier to create and edit additional properties files in the future. You can do this even if you are not translating at this time. See Values for more information on evaluation order of values. |
| If you have no current need for translation, you can create your labels and descriptions within the Domain Designer. If you later need to translate, you can create key names and properties file as you need them. |
| 2. | Decide whether you want to explicitly assign keys for each element, or if you want to use generated keys. |
| 3. | If you are using generated keys, give the data islands and sets in your presentation meaningful IDs. It is easier to work with keys such as ACCOUNTS_MASTER.ACCOUNTS.LABEL rather than JOINTREE_1.SET1.ACCOUNTS.LABEL. |
| 5. | Using the downloaded file as a starting point, create a file with blank values as a template for your properties files. If you did not explicitly defined any labels or definitions the downloaded file is automatically blank. If you have explicitly defined values, you need to remove them to create a file with blank values. |
| 6. | Create a master file with the strings for your base locale. Set this as the default properties file. |
| Make sure to create a default properties file. If every file has a locale code in the filename, the values will not appear for users in unsupported locales. If you prefer, you can define labels and descriptions in the Domain Designer, which display in unsupported locales. However, this makes it harder to create and maintain a blank version of the properties file. |
| 7. | For each additional locale you want to support, copy the blank file and change the _<locale> designator to create a basis for the translated file. For information about file naming, see Properties File Format. |
| 8. | Use specialized software or a translation service to create the Java localization properties files for each locale you want to support. |
| 9. | Use the Options tab in the Domain Designer to attach the properties files to the Domain. See The Options Tab for more information. |
Maintaining Properties Files
Once you have the files you will need to update them as keys are added or changed, or as you add locales. Make sure to save a blank properties file or the default locale bundle as a template for future translations.
To add or change keys:
| 1. | Make sure to save a blank properties file or the default locale bundle as a template for future translations. |
| 2. | If you change the Domain design, export the locale bundle again and compare it to the template to find all new keys. |
| 3. | If you have defined descriptions and keys in the Domain design, delete the exported values to create a new blank template. |
| 4. | Translate the new keys and add them to your properties files for your supported locales. |
| 5. | Use the Options tab in the Domain Designer to attach the properties files to the Domain. See The Options Tab for more information. |
To add or change a locale:
| 1. | Make sure to save a blank properties file or the default properties file as a template for future translations. |
| 2. | Copy the blank properties file and change or add the _<locale> designator to create a properties file for the new locale. For information about file naming, see Properties File Format. |
| 3. | If you have defined descriptions and keys in the Domain design, delete the exported values to create a new blank template. |
| 4. | Translate the new keys and add them to your properties files for your supported locales. |
| 5. | Use specialized software or a translation service to create the Java localization properties files for each locale you want to support. |
| 6. | Use the Options tab in the Domain Designer to attach the properties files to the Domain. See The Options Tab for more information. |
For additional information about locales and properties files (also called locale bundles) in JasperReports Server, see the Localization chapter in the JasperReports Server Administrator Guide.
Recommended Comments
There are no comments to display.