Class ClientLocalizationManagerImpl
java.lang.Object
com.inductiveautomation.ignition.client.model.ClientLocalizationManager
com.inductiveautomation.factorypmi.application.i18n.ClientLocalizationManagerImpl
- All Implemented Interfaces:
TranslationPackage,Serializable
- See Also:
-
Field Summary
Fields inherited from class com.inductiveautomation.ignition.client.model.ClientLocalizationManager
_instance, EVENT_AVAILABLE_LOCALES, EVENT_TRANSLATIONS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLocaleListener(LocaleListener listener) protected voidThe key hash rule dictates how term equivalency is calculated.getStringForBundleKey(String bundlekey) getTranslationsFor(String key) voidbooleanReturns whether the key is defined in the package.booleanReturns whether there is a translation defined for the given key in the given locale.booleanvoidloadTranslationDatabase(File location) This functions loads the term db from a file, which should be a serialized TranslationPackage.voidremoveLocaleListener(LocaleListener listener) voidResets the current locale to the base locale.voidsetCurrentLocale(Locale locale) Methods inherited from class com.inductiveautomation.ignition.client.model.ClientLocalizationManager
addPropertyChangeListener, fireProperty, get, removePropertyChangeListener, set
-
Constructor Details
-
ClientLocalizationManagerImpl
-
-
Method Details
-
initNotificationListener
public void initNotificationListener() -
loadTranslationDatabase
This functions loads the term db from a file, which should be a serialized TranslationPackage. -
isTranslationEnabled
public boolean isTranslationEnabled()- Specified by:
isTranslationEnabledin classClientLocalizationManager
-
getBaseLocale
- Returns:
- the "base" locale, the language in which the terms are defined.
-
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. -
getAvailableLocales
- Specified by:
getAvailableLocalesin interfaceTranslationPackage- Specified by:
getAvailableLocalesin classClientLocalizationManager- Returns:
- the locales for which translations are available. This will include the base locale.
-
isDefined
Description copied from interface:TranslationPackageReturns whether the key is defined in the package. A key can be defined without any particular translations. -
isDefined
Description copied from interface:TranslationPackageReturns whether there is a translation defined for the given key in the given locale. -
getCurrentLocale
- Specified by:
getCurrentLocalein classClientLocalizationManager
-
setCurrentLocale
- Specified by:
setCurrentLocalein classClientLocalizationManager
-
getPreviewLocale
- Specified by:
getPreviewLocalein classClientLocalizationManager
-
resetLocale
public void resetLocale()Description copied from class:ClientLocalizationManagerResets the current locale to the base locale. *- Specified by:
resetLocalein classClientLocalizationManager
-
getString
- Specified by:
getStringin classClientLocalizationManager
-
get
- Specified by:
getin interfaceTranslationPackage- Specified by:
getin classClientLocalizationManagerkey- 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.
-
getStrict
- Specified by:
getStrictin classClientLocalizationManager
-
getStrict
- Specified by:
getStrictin interfaceTranslationPackage- Specified by:
getStrictin classClientLocalizationManager- Parameters:
locale- the locale to find a value forkey- the key to find a match for- Returns:
- the translation, or null if the translation doesn't exist.
-
getStringForBundleKey
- Specified by:
getStringForBundleKeyin classClientLocalizationManager
-
getTranslationsFor
- Specified by:
getTranslationsForin interfaceTranslationPackage- Specified by:
getTranslationsForin classClientLocalizationManager- Returns:
- a map of all of the translations available for a given key.
-
getAvailableKeys
- Returns:
- all of the defined keys.
-
createDiff
- Returns:
- an empty, modifiable diff that respects the same rules as the translation package.
-
getAllTranslations
- Returns:
- an iterator that goes through all of the translations. Does not include defined keys that have no translations.
-
addLocaleListener
- Specified by:
addLocaleListenerin classClientLocalizationManager
-
removeLocaleListener
- Specified by:
removeLocaleListenerin classClientLocalizationManager
-
fireLocaleChanged
protected void fireLocaleChanged()
-