6.14 Multiple Languages

XMA is designed to support internationalized applications. All pages are prepared to be easily translated to different languages.

The strings you enter for widget labels and tooltips are generated into a property file. This property file is located in the same package as the client classes of the component. Its name is the name of the component with ".properties" appended.

If you choose a language code in the property "Language" of the component in the guidesigner, the language code is appended to the filename of the property file. If you choose FALLBACK, no language code is appended.

For dialog pages the dialog title is written in the properties file. Its key is the class name of the page. <page.namClass> e.g. Spardetail = Detailansicht zu einem Sparbuch

For widget labels, the key of the properties is composed by the class name of the page, a dot and the instance name of the widget. <page.namClass>+"."+<namInstance> e.g. Spardetail.numKontoL = Konto:

For widget tooltips, the key of the properties is composed by the class name of the page, a dot, the instance name of the widget and the string "Tip" <page.namClass>+"."+<namInstance>+"Tip" e.g. Spardetail.numKontoWTip = Die Kontonummer des zu erzeugenden Kontos

Instance names of Widgets end with "W" (except for Labels, which ends with "L") Per default Labels have the same base name as the widget they belong to. e.g. Label to Text "numKontoW" is named "numKontoL".

To translate the page, you translate this property file to different languages.

For an internationalized application, help pages should be available in the different languages, too. The proposed pattern is to use the same structure for the help pages in all languages and to append the language code to the filename. E.g. a help page in the default language may have the URL http://imcref.server.lan.at/xma_samplespar/help/at/spardat/xma/samplespar/sparlist/Sparlist.html. The Croatian translation would have the URL http://imcref.server.lan.at/xma_samplespar/help/at/spardat/xma/samplespar/sparlist/Sparlist_hr.html.

The runtime contains two methods to support this pattern. The method toLocalizedHelpUri(String uri,Locale locale) in each page has to be overloaded (e.g. in a project specific base class) to return the uri of the help page translation to the language defined in the given locale. This method gives the developer the possibility to define which translations are available and how to map the languages for which no translations are available yet. To use the naming pattern as described above, the utility method insertLangInFilename(String uri,Locale locale) should be used in toLocalizedHelpUri(String uri,Locale locale).