public interface TranslationPackage
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
TranslationPackageDiff |
createDiff()
Returns an empty, modifiable diff that respects the same rules as the translation package.
|
java.lang.String |
get(java.util.Locale locale,
java.lang.String key)
Returns the translation of the key for the requested locale, or the key, if the translation is not available.
|
java.util.Iterator<Translation> |
getAllTranslations()
Returns an iterator that goes through all of the translations.
|
java.util.Collection<java.lang.String> |
getAvailableKeys()
Returns all of the defined keys.
|
java.util.Collection<java.util.Locale> |
getAvailableLocales()
Returns the locales for which translations are available.
|
java.util.Locale |
getBaseLocale()
Returns the "base" locale, the language in which the terms are defined.
|
KeyHashRule |
getKeyHashRule()
The key hash rule dictates how term equivalency is calculated.
|
java.lang.String |
getStrict(java.util.Locale locale,
java.lang.String key)
Returns the translation, or null if the translation doesn't exist.
|
TranslationMap |
getTranslationsFor(java.lang.String key)
Returns a map of all of the translations available for a given 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.
|
java.util.Locale getBaseLocale()
KeyHashRule getKeyHashRule()
java.util.Collection<java.util.Locale> getAvailableLocales()
boolean isDefined(java.lang.String key)
key
- boolean isDefined(java.lang.String key, java.util.Locale l)
key
- l
- java.lang.String get(java.util.Locale locale, java.lang.String key)
locale
- key
- java.lang.String getStrict(java.util.Locale locale, java.lang.String key)
locale
- key
- TranslationMap getTranslationsFor(java.lang.String key)
key
- java.util.Collection<java.lang.String> getAvailableKeys()
TranslationPackageDiff createDiff()
java.util.Iterator<Translation> getAllTranslations()