Class ClientLocalizationManager
- java.lang.Object
-
- com.inductiveautomation.ignition.client.model.ClientLocalizationManager
-
- All Implemented Interfaces:
TranslationPackage
,java.io.Serializable
- Direct Known Subclasses:
ClientLocalizationManagerImpl
,DesignerLocalizationManager
public abstract class ClientLocalizationManager extends java.lang.Object implements TranslationPackage
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static ClientLocalizationManager
_instance
static java.lang.String
EVENT_AVAILABLE_LOCALES
static java.lang.String
EVENT_TRANSLATIONS
-
Constructor Summary
Constructors Modifier Constructor Description protected
ClientLocalizationManager()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
addLocaleListener(LocaleListener listener)
void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
protected void
fireProperty(java.lang.String name)
static <T extends ClientLocalizationManager>
Tget()
abstract java.lang.String
get(java.util.Locale locale, java.lang.String key)
abstract java.util.Collection<java.util.Locale>
getAvailableLocales()
abstract java.util.Locale
getCurrentLocale()
abstract java.util.Locale
getPreviewLocale()
abstract java.lang.String
getStrict(java.lang.String key)
abstract java.lang.String
getStrict(java.util.Locale locale, java.lang.String key)
abstract java.lang.String
getString(java.lang.String key)
abstract java.lang.String
getStringForBundleKey(java.lang.String bundlekey)
abstract TranslationMap
getTranslationsFor(java.lang.String key)
abstract boolean
isTranslationEnabled()
abstract void
removeLocaleListener(LocaleListener listener)
void
removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
abstract void
resetLocale()
Resets the current locale to the base locale.protected static void
set(ClientLocalizationManager mgr)
abstract void
setCurrentLocale(java.util.Locale locale)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.common.i18n.translation.TranslationPackage
createDiff, getAllTranslations, getAvailableKeys, getBaseLocale, getKeyHashRule, isDefined, isDefined
-
-
-
-
Field Detail
-
EVENT_AVAILABLE_LOCALES
public static final java.lang.String EVENT_AVAILABLE_LOCALES
- See Also:
- Constant Field Values
-
EVENT_TRANSLATIONS
public static final java.lang.String EVENT_TRANSLATIONS
- See Also:
- Constant Field Values
-
_instance
protected static ClientLocalizationManager _instance
-
-
Method Detail
-
get
public static <T extends ClientLocalizationManager> T get()
-
set
protected static void set(ClientLocalizationManager mgr)
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
-
fireProperty
protected void fireProperty(java.lang.String name)
-
isTranslationEnabled
public abstract boolean isTranslationEnabled()
-
getAvailableLocales
public abstract java.util.Collection<java.util.Locale> getAvailableLocales()
- Specified by:
getAvailableLocales
in interfaceTranslationPackage
- Returns:
- the locales for which translations are available. This will include the base locale.
-
get
public abstract java.lang.String get(java.util.Locale locale, java.lang.String key)
- Specified by:
get
in interfaceTranslationPackage
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.
-
getString
public abstract java.lang.String getString(java.lang.String key)
-
getStrict
public abstract java.lang.String getStrict(java.lang.String key)
-
getStrict
public abstract java.lang.String getStrict(java.util.Locale locale, java.lang.String key)
- Specified by:
getStrict
in interfaceTranslationPackage
- 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
public abstract java.lang.String getStringForBundleKey(java.lang.String bundlekey)
-
getTranslationsFor
public abstract TranslationMap getTranslationsFor(java.lang.String key)
- Specified by:
getTranslationsFor
in interfaceTranslationPackage
- Returns:
- a map of all of the translations available for a given key.
-
getCurrentLocale
public abstract java.util.Locale getCurrentLocale()
-
setCurrentLocale
public abstract void setCurrentLocale(java.util.Locale locale)
-
getPreviewLocale
public abstract java.util.Locale getPreviewLocale()
-
addLocaleListener
public abstract void addLocaleListener(LocaleListener listener)
-
removeLocaleListener
public abstract void removeLocaleListener(LocaleListener listener)
-
resetLocale
public abstract void resetLocale()
Resets the current locale to the base locale. *
-
-