Class ClientLocalizationManager
java.lang.Object
com.inductiveautomation.ignition.client.model.ClientLocalizationManager
- All Implemented Interfaces:
TranslationPackage
- Direct Known Subclasses:
ClientLocalizationManagerImpl, DesignerLocalizationManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static ClientLocalizationManagerstatic final Stringstatic final StringFields inherited from interface TranslationPackage
BASE_LOCALE, NOTES_IDENTIFIER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddLocaleListener(LocaleListener listener) voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) abstract voidapplyLocalDiff(@NonNull TranslationPackageDiff diff) Applies a diff to the local in-memory cache immediately, firing the same change events (EVENT_TRANSLATIONS,EVENT_AVAILABLE_LOCALES) that an incomingLocalizationMessages.TRANSLATION_UPDATEpush would.protected voidfireProperty(String name) static <T extends ClientLocalizationManager>
Tget()abstract @NonNull StringTranslates the given key into the requested locale.abstract @NonNull Collection<Locale> abstract Localeabstract Localeabstract Stringabstract StringTranslates the given key into the requested locale, returning null if no translation exists.abstract Stringabstract StringgetStringForBundleKey(String bundlekey) abstract @Nullable TranslationMapgetTranslationsFor(@NonNull String key) abstract booleanabstract voidremoveLocaleListener(LocaleListener listener) voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) abstract voidResets the current locale to the base locale.protected static voidabstract voidsetCurrentLocale(Locale locale) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TranslationPackage
createDiff, getAllTranslations, getAvailableKeys, getKeyHashRule, getNote, getNotes, getResolvedTranslations, isDefined, isDefined
-
Field Details
-
EVENT_AVAILABLE_LOCALES
- See Also:
-
EVENT_TRANSLATIONS
- See Also:
-
_instance
-
-
Constructor Details
-
ClientLocalizationManager
protected ClientLocalizationManager()
-
-
Method Details
-
get
-
set
-
addPropertyChangeListener
-
removePropertyChangeListener
-
fireProperty
-
isTranslationEnabled
public abstract boolean isTranslationEnabled() -
getAvailableLocales
- Specified by:
getAvailableLocalesin interfaceTranslationPackage- Returns:
- the locales for which translations are available. This always includes
TranslationPackage.BASE_LOCALE, the language in which keys are defined.
-
get
Description copied from interface:TranslationPackageTranslates the given key into the requested locale.- Specified by:
getin interfaceTranslationPackage- Parameters:
locale- the locale to find a match forkey- the key to find a match for- Returns:
- the translation of the key for the requested locale, or the key itself if no translation is available.
-
getString
-
getStrict
-
getStrict
Description copied from interface:TranslationPackageTranslates the given key into the requested locale, returning null if no translation exists.- Specified by:
getStrictin 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
-
getTranslationsFor
- Specified by:
getTranslationsForin interfaceTranslationPackage- Returns:
- a map of all the translations available for a given key.
-
getCurrentLocale
-
setCurrentLocale
-
getPreviewLocale
-
addLocaleListener
-
removeLocaleListener
-
resetLocale
public abstract void resetLocale()Resets the current locale to the base locale. * -
applyLocalDiff
Applies a diff to the local in-memory cache immediately, firing the same change events (EVENT_TRANSLATIONS,EVENT_AVAILABLE_LOCALES) that an incomingLocalizationMessages.TRANSLATION_UPDATEpush would. Lets a local writer make its edit visible to subsequent reads without waiting for the gateway round-trip and the asynchronous push that follows. Re-applying the same diff when that push later arrives is idempotent.
-