public class BBTranslations extends Object
Modifier and Type | Field and Description |
---|---|
BBjNumber |
Dirty
A field variable that specifies the BBTranslations have been modified
|
BBTranslations |
Parent!
A field variable that contains the parent translations
|
SortedProperties |
Properties!
A field variable that contains the properties
|
static BBjNumber |
TRANSLATION_KEY_ERROR
A field variable that defines the TRANSLATION_KEY_ERROR error number
|
Constructor and Description |
---|
BBTranslations(BBTranslationBundle p_bundle!,
BBTranslations p_parent!,
Locale p_locale!)
BBTranslations constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(Locale p_locale!,
BBTranslations p_translations!)
Adds a child translation to the translations
|
void |
addTranslation(BBjString p_key$,
BBjString p_value$)
Adds a translation to the translations given a key and value
|
void |
addTranslation(BBjString p_key$,
BBjString p_value$,
BBjNumber p_skip_existing)
Adds a translation to the translations given a key and value, optionally skipping existing keys
|
void |
addTranslations(HashMap p_translations!)
Adds the translations provided in the passed hash map to the translations
|
void |
addTranslations(HashMap p_translations!,
BBjNumber p_skip_existing)
Adds the translations provided in the passed hash map to the translations, optionally skipping existing entries
|
Locale |
findTranslationLocale(BBjString p_key$)
Returns the locale that contains the passed translation key
|
HashMap |
getChildren()
Returns the children of the translations in a HashMap
|
static Locale |
getClientLocale()
Returns the locale used by the client
|
static BBjString |
getClientLocaleString()
Returns the locale string used by the client
|
Collection |
getKeys()
Returns a collection translation keys
|
Locale |
getLocale()
Returns the locale of the translations
|
BBTranslations |
getParent()
Returns the parent of the translations
|
SortedProperties |
getProperties()
Returns the translations properties
|
BBjString |
getPropertiesFileName(Locale p_locale!)
Returns a properties file name
|
BBjNumber |
getSize()
Returns the number of translations
|
BBjString |
getTranslation(BBjString p_key$)
Returns the translated string given a key, if the translation is not found, then the passed in key is returned
|
BBjString |
getTranslation(BBjString p_key$,
BBjString p_defaultValue!)
Returns the translated string given a key, if the translation is not found, then the passed in default value is returned
|
BBjString |
getTranslation(BBjString p_key$,
BBjString p_defaultValue!,
BBjNumber p_addIfNotFound)
Returns the translated string given a key, if the translation is not found, then the passed in default value is returned.
|
BBjString |
getTranslation(BBjString p_key$,
BBjString p_defaultValue!,
BBjNumber p_addIfNotFound,
BBjNumber p_forceAdd)
Returns the translated string given a key, if the translation is not found, then the passed in default value is returned.
|
BBjString |
getTranslation(BBjString p_key$,
BBjString p_defaultValue!,
BBjNumber p_addIfNotFound,
BBjNumber p_forceAdd,
BBjNumber p_skipParentLocale)
Returns the translated string given a key, if the translation is not found, then the passed in default value is returned.
|
BBjNumber |
isDefault()
Returns true if this is the default translations, otherwise false is returned
|
void |
removeChild(Locale p_locale!)
Removes a child translation from the translations
|
void |
removeChildren()
Removes all children BBTranslationBundles
|
void |
removeTranslation(BBjString p_key$)
Removes a translation given a key
|
void |
removeTranslations()
Removes all translations
|
void |
setTranslation(BBjString p_key$,
BBjString p_value$)
Sets a translation value
|
public BBTranslations Parent!
public SortedProperties Properties!
public BBjNumber Dirty
public static BBjNumber TRANSLATION_KEY_ERROR
public BBTranslations(BBTranslationBundle p_bundle!, BBTranslations p_parent!, Locale p_locale!)
p_bundle!
- Specifies the bundle in which the translations belongp_parent!
- Specifies the parent translationsp_locale!
- Specifies the Java locale for the translationspublic void addChild(Locale p_locale!, BBTranslations p_translations!)
p_locale!
- Specifies the Java Locale of the child translationsp_translations!
- Specifies the BBTranslations object to add as a childpublic void removeChild(Locale p_locale!)
p_locale!
- Specifies the Java locale for the translationspublic void removeChildren()
public BBjString getPropertiesFileName(Locale p_locale!)
p_locale!
- Specifies the Java locale for the translationspublic BBjNumber getSize()
public Collection getKeys()
public BBjString getTranslation(BBjString p_key$)
p_key$
- Specifies the key to get a translationpublic BBjString getTranslation(BBjString p_key$, BBjString p_defaultValue!)
p_key$
- Specifies the key to get a translationp_defaultValue!
- Specifies the return value if the key is not found. By default, the key will be returned when not foundpublic BBjString getTranslation(BBjString p_key$, BBjString p_defaultValue!, BBjNumber p_addIfNotFound)
p_key$
- Specifies the key to get a translationp_defaultValue!
- Specifies the return value if the key is not found. By default, the key will be returned when not foundp_addIfNotFound
- Specifies if the key with the defaultValue should be added when not found. 0 = do not add, 1 = addpublic BBjString getTranslation(BBjString p_key$, BBjString p_defaultValue!, BBjNumber p_addIfNotFound, BBjNumber p_forceAdd)
p_key$
- Specifies the key to get a translationp_defaultValue!
- Specifies the return value if the key is not found. By default, the key will be returned when not foundp_addIfNotFound
- Specifies if the key with the defaultValue should be added when not found. 0 = do not add, 1 = addp_forceAdd
- Specifies if the key should be added when not found. 0 = do not add, 1 = addpublic BBjString getTranslation(BBjString p_key$, BBjString p_defaultValue!, BBjNumber p_addIfNotFound, BBjNumber p_forceAdd, BBjNumber p_skipParentLocale)
p_key$
- Specifies the key to get a translationp_defaultValue!
- Specifies the return value if the key is not found. By default, the key will be returned when not foundp_addIfNotFound
- Specifies if the key with the defaultValue should be added when not found. 0 = do not add, 1 = addp_forceAdd
- Specifies if the key should be added when not found. 0 = do not add, 1 = addp_skipParentLocale
- Specifies if the parent locale translations should be skipped. 0 = skip, 1 = do not skippublic Locale findTranslationLocale(BBjString p_key$)
p_key$
- Specifies the translation for the desired localepublic void addTranslations(HashMap p_translations!)
p_translations!
- Specifies a HashMap where the key is the Java locale and the value is the translation valuepublic void addTranslations(HashMap p_translations!, BBjNumber p_skip_existing)
p_translations!
- Specifies a HashMap where the key is the Java locale and the value is the translation valuep_skip_existing
- Specifies whether to skip existing translations. 0 = do not skip, 1 = skippublic void addTranslation(BBjString p_key$, BBjString p_value$)
p_key$
- Specifies the key of the translation to addp_value$
- Specifies the value of the translation to addpublic void addTranslation(BBjString p_key$, BBjString p_value$, BBjNumber p_skip_existing)
p_key$
- Specifies the key of the translation to addp_value$
- Specifies the value of the translation to addp_skip_existing
- Specifies whether to skip existing keys. 0 = do not skip, 1 = skippublic void setTranslation(BBjString p_key$, BBjString p_value$)
p_key$
- Specifies the key of the translation to setp_value$
- Specifies the value of the translationpublic void removeTranslations()
public void removeTranslation(BBjString p_key$)
p_key$
- Specifies the key of the translation to removepublic Locale getLocale()
public BBTranslations getParent()
public HashMap getChildren()
public SortedProperties getProperties()
public BBjNumber isDefault()
public static Locale getClientLocale()
public static BBjString getClientLocaleString()