Billing Interface Localization Mechanism
Billing interface localization files must reside in the /usr/local/bm/conf/locale directory on the Billing application node. A localization file name must conform to the following regular expression:
locale\.(([^_\.]{2})(_[^\.]+)?)(\..*)?
For example, locale.en, locale.en_US, locale.en_US.currency, locale.en.money and the like.
Billing language object supports parent-child relations. The first two symbols of a localization file extension are considered as a parent language identifier (.en for English). The next two symbols, right after the '_' one, are considered as a particular localization identifier (_US and _UK localizations of English). All succeeding symbols, after the second dot, are considered as a name of a dictionary volume.
Let's consider the following examples:
locale.en– dictionary of parentenlanguage.locale.en.money– volume of the dictionary of parentenlanguage, modifies currency format.locale.en_US– dictionary of the US localization (child language) of the parentenone.locale.en_US.dateformat– volume of the childUSdictionary, modifies date format.
A dictionary volume serves to customize entries of a main dictionary, for example currency format. A main dictionary usually contains all interface key words available for localization and requires manual update on each Billing upgrade. To keep specified currency format unchanged, keep in the particular dictionary volume.
Important: Billing default dictionary, locale.en file, is overwritten on Billing upgrade. If you want to customize default dictionary entries, it is strongly recommended keeping your customizations in separate volumes.
Localization Mechanism
Billing containers start process includes registering languages and loading corresponding dictionaries. Namely, each container reads the locale directory and parses file names in the alphabetical order, registers languages and their dictionaries and establishes parent-child relations.
Example
The locale directory contains the following files:
locale.en locale.en_US locale.en_US.dateformat locale.es locale.fr
On the directory reading, the following languages are registered and corresponding file contents is loaded to dictionaries:
- en – parent language and corresponding en dictionary is loaded with content of the
locale.enfile. - en_US – child language and corresponding en_US dictionary is loaded with content of the
locale.en_USfile. On parsing name of thelocale.en_US.dateformatfile, new language is not created and the en_US dictionary content is modified with the file contents. - es – parent language and corresponding es dictionary is loaded with content of the
locale.esfile. - fr – parent language and corresponding fr dictionary is loaded with content of the
locale.frfile. - After the containers start process is completed containers works with loaded dictionaries in the 'read-only' mode.
A user specifies session language when logs in to Billing. Billing receives request to find translation for specific key word in the dictionary of the session language. Billing looks for translation in the dictionary of the specified language if translation is found, it is displayed on a screen. Otherwise, Billing looks for translation in the dictionary of parent language if any registered and displays translation from this dictionary if found. Otherwise, the requested key word is displayed.
Example
User selects French language on logging in to Billing. Billing receives requests to find translations of interface key words in the dictionary of the fr language. The session language is registered as parent in Billing, so if translations are not found in the dictionary, Billing displays requested key words.