Class ClientLocalizationManagerImpl
- java.lang.Object
- 
- com.inductiveautomation.ignition.client.model.ClientLocalizationManager
- 
- com.inductiveautomation.factorypmi.application.i18n.ClientLocalizationManagerImpl
 
 
- 
- All Implemented Interfaces:
- TranslationPackage,- java.io.Serializable
 
 public class ClientLocalizationManagerImpl extends ClientLocalizationManager - See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from class com.inductiveautomation.ignition.client.model.ClientLocalizationManager_instance, EVENT_AVAILABLE_LOCALES, EVENT_TRANSLATIONS
 
- 
 - 
Constructor SummaryConstructors Constructor Description ClientLocalizationManagerImpl(ClientContextImpl context)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLocaleListener(LocaleListener listener)TranslationPackageDiffcreateDiff()protected voidfireLocaleChanged()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()java.util.LocalegetCurrentLocale()KeyHashRulegetKeyHashRule()The key hash rule dictates how term equivalency is calculated.java.util.LocalegetPreviewLocale()java.lang.StringgetStrict(java.lang.String key)java.lang.StringgetStrict(java.util.Locale locale, java.lang.String key)java.lang.StringgetString(java.lang.String key)java.lang.StringgetStringForBundleKey(java.lang.String bundlekey)TranslationMapgetTranslationsFor(java.lang.String key)voidinitNotificationListener()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.booleanisTranslationEnabled()voidloadTranslationDatabase(java.io.File location)This functions loads the term db from a file, which should be a serialized TranslationPackage.voidremoveLocaleListener(LocaleListener listener)voidresetLocale()Resets the current locale to the base locale.voidsetCurrentLocale(java.util.Locale locale)- 
Methods inherited from class com.inductiveautomation.ignition.client.model.ClientLocalizationManageraddPropertyChangeListener, fireProperty, get, removePropertyChangeListener, set
 
- 
 
- 
- 
- 
Constructor Detail- 
ClientLocalizationManagerImplpublic ClientLocalizationManagerImpl(ClientContextImpl context) 
 
- 
 - 
Method Detail- 
initNotificationListenerpublic void initNotificationListener() 
 - 
loadTranslationDatabasepublic void loadTranslationDatabase(java.io.File location) This functions loads the term db from a file, which should be a serialized TranslationPackage.
 - 
isTranslationEnabledpublic boolean isTranslationEnabled() - Specified by:
- isTranslationEnabledin class- ClientLocalizationManager
 
 - 
getBaseLocalepublic java.util.Locale getBaseLocale() - Returns:
- the "base" locale, the language in which the terms are defined.
 
 - 
getKeyHashRulepublic KeyHashRule getKeyHashRule() Description copied from interface:TranslationPackageThe 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.
 - 
getAvailableLocalespublic java.util.Collection<java.util.Locale> getAvailableLocales() - Specified by:
- getAvailableLocalesin interface- TranslationPackage
- Specified by:
- getAvailableLocalesin class- ClientLocalizationManager
- Returns:
- the locales for which translations are available. This will include the base locale.
 
 - 
isDefinedpublic boolean isDefined(java.lang.String key) Description copied from interface:TranslationPackageReturns whether the key is defined in the package. A key can be defined without any particular translations.
 - 
isDefinedpublic boolean isDefined(java.lang.String key, java.util.Locale l)Description copied from interface:TranslationPackageReturns whether there is a translation defined for the given key in the given locale.
 - 
getCurrentLocalepublic java.util.Locale getCurrentLocale() - Specified by:
- getCurrentLocalein class- ClientLocalizationManager
 
 - 
setCurrentLocalepublic void setCurrentLocale(java.util.Locale locale) - Specified by:
- setCurrentLocalein class- ClientLocalizationManager
 
 - 
getPreviewLocalepublic java.util.Locale getPreviewLocale() - Specified by:
- getPreviewLocalein class- ClientLocalizationManager
 
 - 
resetLocalepublic void resetLocale() Description copied from class:ClientLocalizationManagerResets the current locale to the base locale. *- Specified by:
- resetLocalein class- ClientLocalizationManager
 
 - 
getStringpublic java.lang.String getString(java.lang.String key) - Specified by:
- getStringin class- ClientLocalizationManager
 
 - 
getpublic java.lang.String get(java.util.Locale locale, java.lang.String key)- Specified by:
- getin interface- TranslationPackage
- Specified by:
- getin class- ClientLocalizationManager
- 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.
 
 - 
getStrictpublic java.lang.String getStrict(java.lang.String key) - Specified by:
- getStrictin class- ClientLocalizationManager
 
 - 
getStrictpublic java.lang.String getStrict(java.util.Locale locale, java.lang.String key)- Specified by:
- getStrictin interface- TranslationPackage
- Specified by:
- getStrictin class- ClientLocalizationManager
- 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.
 
 - 
getStringForBundleKeypublic java.lang.String getStringForBundleKey(java.lang.String bundlekey) - Specified by:
- getStringForBundleKeyin class- ClientLocalizationManager
 
 - 
getTranslationsForpublic TranslationMap getTranslationsFor(java.lang.String key) - Specified by:
- getTranslationsForin interface- TranslationPackage
- Specified by:
- getTranslationsForin class- ClientLocalizationManager
- Returns:
- a map of all of the translations available for a given key.
 
 - 
getAvailableKeyspublic java.util.Collection<java.lang.String> getAvailableKeys() - Returns:
- all of the defined keys.
 
 - 
createDiffpublic TranslationPackageDiff createDiff() - Returns:
- an empty, modifiable diff that respects the same rules as the translation package.
 
 - 
getAllTranslationspublic java.util.Iterator<Translation> getAllTranslations() - Returns:
- an iterator that goes through all of the translations. Does not include defined keys that have no translations.
 
 - 
addLocaleListenerpublic void addLocaleListener(LocaleListener listener) - Specified by:
- addLocaleListenerin class- ClientLocalizationManager
 
 - 
removeLocaleListenerpublic void removeLocaleListener(LocaleListener listener) - Specified by:
- removeLocaleListenerin class- ClientLocalizationManager
 
 - 
fireLocaleChangedprotected void fireLocaleChanged() 
 
- 
 
-