Interface TranslationPackage
- 
- All Superinterfaces:
- java.io.Serializable
 - All Known Subinterfaces:
- MutableTranslationPackage
 - All Known Implementing Classes:
- BasicTranslationPackage,- ClientLocalizationManager,- ClientLocalizationManagerImpl,- DelegateTranslationPackage,- DesignerLocalizationManager,- TranslationPackageDiff,- TranslationWorkspacePanel.FilteredTranslationPackage
 
 public interface TranslationPackage extends java.io.SerializableA translation package holds the keys and one or more translations for the keys.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description TranslationPackageDiffcreateDiff()java.lang.Stringget(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.LocalegetBaseLocale()KeyHashRulegetKeyHashRule()The key hash rule dictates how term equivalency is calculated.java.lang.StringgetStrict(java.util.Locale locale, java.lang.String key)TranslationMapgetTranslationsFor(java.lang.String key)booleanisDefined(java.lang.String key)Returns whether the key is defined in the package.booleanisDefined(java.lang.String key, java.util.Locale l)Returns whether there is a translation defined for the given key in the given locale.
 
- 
- 
- 
Method Detail- 
getBaseLocalejava.util.Locale getBaseLocale() - Returns:
- the "base" locale, the language in which the terms are defined.
 
 - 
getKeyHashRuleKeyHashRule getKeyHashRule() The key hash rule dictates how term equivalency is calculated. Though this field should not be used to look up terms, it's important that derived translation packages use the same rule.
 - 
getAvailableLocalesjava.util.Collection<java.util.Locale> getAvailableLocales() - Returns:
- the locales for which translations are available. This will include the base locale.
 
 - 
isDefinedboolean isDefined(java.lang.String key) Returns whether the key is defined in the package. A key can be defined without any particular translations.
 - 
isDefinedboolean isDefined(java.lang.String key, java.util.Locale l)Returns whether there is a translation defined for the given key in the given locale.
 - 
getjava.lang.String get(java.util.Locale locale, java.lang.String key)- Parameters:
- key- the key to find a match for, or return value if no value found
- Returns:
- the translation of the key for the requested locale, or the key, if the translation is not available.
 
 - 
getStrictjava.lang.String getStrict(java.util.Locale locale, java.lang.String key)- Parameters:
- locale- the locale to find a value for
- key- the key to find a match for
- Returns:
- the translation, or null if the translation doesn't exist.
 
 - 
getTranslationsForTranslationMap getTranslationsFor(java.lang.String key) - Returns:
- a map of all of the translations available for a given key.
 
 - 
getAvailableKeysjava.util.Collection<java.lang.String> getAvailableKeys() - Returns:
- all of the defined keys.
 
 - 
createDiffTranslationPackageDiff createDiff() - Returns:
- an empty, modifiable diff that respects the same rules as the translation package.
 
 - 
getAllTranslationsjava.util.Iterator<Translation> getAllTranslations() - Returns:
- an iterator that goes through all of the translations. Does not include defined keys that have no translations.
 
 
- 
 
-