BBTranslations
Description
In BBj 9.00 and higher, the BBTranslation utility is a BBj CustomObject that gets and adds translations for localization support.
Creation
The BBTranslation class can be found in <bbj install>/utils/translations/bbtranslator.bbj.
|
BBTranslations(TranslationBundle bundle, BBTranslations parentTranslations, Locale locale) |
Parameters
|
Parameter |
Description |
|---|---|
|
bundle |
Specifies the bundle in which the translations belong. |
|
parentTranslations |
Specifies the parent translations. |
|
locale |
Specifies the Java locale for the translations. |
Methods of BBTranslation
|
Return Value |
Method |
|---|---|
|
void |
addChild(Locale locale, BBTranslations translations) |
|
void |
addTranslation(string key, string value) |
|
void |
addTranslation(HashMap translations) |
|
Locale |
findTranslationLocale(string key) |
|
HashMap |
|
|
Collection |
getKeys() |
|
Locale |
|
|
BBTranslations |
|
|
Properties |
|
|
int |
getSize() |
|
string |
getTranslation(string key) |
|
string |
getTranslation(string key, string defaultValue) |
|
string |
getTranslation(string key, string defaultValue, boolean addIfNotFound) |
|
boolean |
|
|
void |
removeChild(Locale locale) |
|
void |
removeChildren() |
|
void |
removeTranslation(string key) |
|
void |
removeTranslations() |
Constants
|
Name |
Value |
|
NAME_ERROR |
256 |
|
REMOVE_LOCALE_ERROR |
257 |
|
DIR_ERROR |
258 |
|
SAVE_ERROR |
259 |
Example
|