BBTranslator
Description
In BBj 9.0 and higher, the BBTranslator utility is a BBj CustomObject that utilizes a translation bundle for localization support.
Creation
The BBTranslator class can be found in <bbj install>/utils/translations/bbtranslator.bbj.
BBTranslator.getInstance(string translationBundleName, string localeString, string localeOfOriginString, string translationBundleDir) |
BBTranslator.getInstance(BBTranslationBundle translationBundle) |
BBTranslator.getInstance(BBTranslationBundle translationBundle, Locale locale) |
Parameters
Parameter |
Description |
translationBundleName |
Specifies the name of the translation bundle. |
localeString |
Specifies the locale string for the current translations in the format: |
localeOfOriginString |
Specifies the locale string for the default translations in the format: |
translationBundleDir |
Specifies the directory in which the translation bundle is located. |
translationBundle |
Specifies the translation bundle for the translator to use. |
locale |
Specifies the Java locale for the current translations. |
Methods of BBTranslator
Return Value |
Method |
static Locale |
createLocale(string localeString) |
string |
getTranslation(string key) |
string |
getTranslation(string key, string defaultValue) |
string |
getTranslation(string key, string defaultValue, boolean addIfNotFound) |
BBTranslationBundle |
Remarks
None.
Constants
None.
Example
|