BBTranslationBundle::getTranslation
Description
In BBj 9.0 and higher, this method returns a translation valued based on specified criteria.
Syntax
Return Value |
Method |
string |
getTranslation(string key) |
string |
getTranslation(string key, sting defaultValue) |
string |
getTranslation(string key, sting defaultValue, boolean addIfNotFound) |
string |
getTranslation(Locale locale, string key) |
string |
getTranslation(Locale locale, string key, sting defaultValue) |
string |
getTranslation(Locale locale, string key, sting defaultValue, boolean addIfNotFound) |
Parameters
Variable |
Description |
andIfNotFound |
TRUE (1) if the key with the defaultValue should be added when not found. |
defaultValue |
Specifies the return value if the key is not found; by default, the key will be returned when not found. |
key |
Specifies the key to get a translation for. |
locale |
Specifies a HashMap where the key is the Java locale and the value is the translation value. |
Return Value
If a translation is found with that passed key then the translation value is returned. If not found and a default value was specified, the default value will be returned. If not found and a default value was not specified, the passed in key will be returned. When not found, they key and default can be optionally added to the translations.
Remarks
None.
Example
|