public class DelegateTranslationPackage extends java.lang.Object implements MutableTranslationPackage
| Constructor and Description |
|---|
DelegateTranslationPackage() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTerm(java.lang.String key)
Ensures that the specified key is in the translation package.
|
void |
addTranslation(java.lang.String key,
java.util.Locale locale,
java.lang.String value)
Sets a translation for the specified key and locale.
|
void |
addTranslations(java.lang.String key,
TranslationMap translations)
Sets all of the translations for a specific key.
|
TranslationPackageDiff |
createDiff() |
void |
ensureLocaleExists(java.util.Locale locale)
Verifies that the locale is present, adding it if necessary.
|
java.lang.String |
get(java.util.Locale locale,
java.lang.String key) |
java.util.Iterator<Translation> |
getAllTranslations() |
java.util.Collection<java.lang.String> |
getAvailableKeys() |
java.util.Collection<java.util.Locale> |
getAvailableLocales() |
java.util.Locale |
getBaseLocale() |
KeyHashRule |
getKeyHashRule()
The key hash rule dictates how term equivalency is calculated.
|
java.lang.String |
getStrict(java.util.Locale locale,
java.lang.String key) |
TranslationMap |
getTranslationsFor(java.lang.String key) |
boolean |
isDefined(java.lang.String key)
Returns whether the key is defined in the package.
|
boolean |
isDefined(java.lang.String key,
java.util.Locale l)
Returns whether there is a translation defined for the given key in the given locale.
|
boolean |
removeKey(java.lang.String key)
Removes the specific key, and any translations.
|
void |
removeLocale(java.util.Locale locale) |
void |
removeTranslation(java.lang.String key,
java.util.Locale locale)
Removes a translation for a specified key and locale.
|
void |
setDelegatePackage(MutableTranslationPackage value) |
public void setDelegatePackage(MutableTranslationPackage value)
public KeyHashRule getKeyHashRule()
TranslationPackagegetKeyHashRule in interface TranslationPackagepublic void addTerm(java.lang.String key)
MutableTranslationPackageaddTerm in interface MutableTranslationPackagepublic void addTranslation(java.lang.String key,
java.util.Locale locale,
java.lang.String value)
MutableTranslationPackageaddTranslation in interface MutableTranslationPackagepublic void removeTranslation(java.lang.String key,
java.util.Locale locale)
MutableTranslationPackageremoveTranslation in interface MutableTranslationPackagepublic java.util.Locale getBaseLocale()
getBaseLocale in interface TranslationPackagepublic void addTranslations(java.lang.String key,
TranslationMap translations)
MutableTranslationPackageaddTranslations in interface MutableTranslationPackagepublic java.util.Collection<java.util.Locale> getAvailableLocales()
getAvailableLocales in interface TranslationPackagepublic boolean isDefined(java.lang.String key)
TranslationPackageisDefined in interface TranslationPackagepublic boolean removeKey(java.lang.String key)
MutableTranslationPackageremoveKey in interface MutableTranslationPackagepublic boolean isDefined(java.lang.String key,
java.util.Locale l)
TranslationPackageisDefined in interface TranslationPackagepublic void ensureLocaleExists(java.util.Locale locale)
MutableTranslationPackageensureLocaleExists in interface MutableTranslationPackagepublic void removeLocale(java.util.Locale locale)
removeLocale in interface MutableTranslationPackagepublic java.lang.String get(java.util.Locale locale,
java.lang.String key)
get in interface TranslationPackagekey - the key to find a match for, or return value if no value foundpublic java.lang.String getStrict(java.util.Locale locale,
java.lang.String key)
getStrict in interface TranslationPackagelocale - the locale to find a value forkey - the key to find a match forpublic TranslationMap getTranslationsFor(java.lang.String key)
getTranslationsFor in interface TranslationPackagepublic java.util.Collection<java.lang.String> getAvailableKeys()
getAvailableKeys in interface TranslationPackagepublic TranslationPackageDiff createDiff()
createDiff in interface TranslationPackagepublic java.util.Iterator<Translation> getAllTranslations()
getAllTranslations in interface TranslationPackage