BBTranslationBundle::getTranslation
Description
In BBj 9.00 and higher, this method returns a translation valued based on specified criteria.
Syntax
|
Return Value |
Method |
|---|---|
|
string |
getTranslation(string key) getTranslation(string key, string defaultValue) getTranslation(string key, string defaultValue, boolean addIfNotFound) getTranslation(Locale locale, string key) getTranslation(Locale locale, string key, string defaultValue) getTranslation(Locale locale, string key, string 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.
Example
|