Class DesignerLocalizationManager
java.lang.Object
com.inductiveautomation.ignition.client.model.ClientLocalizationManager
com.inductiveautomation.ignition.designer.i18n.DesignerLocalizationManager
- All Implemented Interfaces:
- MutableTranslationPackage,- TranslationPackage,- Serializable
public class DesignerLocalizationManager
extends ClientLocalizationManager
implements MutableTranslationPackage
- See Also:
- 
Field SummaryFieldsFields inherited from class com.inductiveautomation.ignition.client.model.ClientLocalizationManager_instance, EVENT_AVAILABLE_LOCALES, EVENT_TRANSLATIONS
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddLocaleListener(LocaleListener listener) voidEnsures that the specified key is in the translation package.voidaddTranslation(String key, Locale locale, String value) Sets a translation for the specified key and locale.voidaddTranslations(String key, TranslationMap translations) Sets all of the translations for a specific key.protected booleanbooleanareSettingsDefined(Locale locale) voidensureLocaleExists(Locale locale) Verifies that the locale is present, adding it if necessary.protected voidstatic DesignerLocalizationManagerget()protected TranslationPackageDiffgetEdit()The key hash rule dictates how term equivalency is calculated.protected RegionalSettingsDiffgetSettingsFor(Locale locale) Returns the settings for the locale.protected RegionalSettingsgetSettingsFor(Locale locale, boolean strict) getStringForBundleKey(String bundlekey) getTranslationsFor(String key) protected booleanbooleanReturns whether the key is defined in the package.booleanReturns whether there is a translation defined for the given key in the given locale.booleanvoidmodifyRegionalSettings(RegionalSettings settings) protected voidprotected voidbooleanRemoves the specific key, and any translations.voidremoveLocale(Locale locale) voidremoveLocaleListener(LocaleListener listener) voidremoveTranslation(String key, Locale locale) Removes a translation for a specified key and locale.voidResets the current locale to the base locale.protected voidvoidsaveTranslationSettings(TranslationSettings settings) voidsetCurrentLocale(Locale locale) voidsetEnabled(boolean value) Sets whether the localization manager should be used.protected voidsetModel(TranslationPackage value) voidsetPreviewLocale(String localeName) protected voidsetSettings(Collection<RegionalSettings> settings) voidsetup(DesignerContext context) Methods inherited from class com.inductiveautomation.ignition.client.model.ClientLocalizationManageraddPropertyChangeListener, fireProperty, removePropertyChangeListener, set
- 
Field Details- 
PREVIEW_LOCALE- See Also:
 
 
- 
- 
Method Details- 
get
- 
isTranslationEnabledpublic boolean isTranslationEnabled()- Specified by:
- isTranslationEnabledin class- ClientLocalizationManager
 
- 
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.
 
- 
get- 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.
 
- 
getString- Specified by:
- getStringin class- ClientLocalizationManager
 
- 
getStrict- Specified by:
- getStrictin class- ClientLocalizationManager
 
- 
getStrict- 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.
 
- 
getStringForBundleKey- Specified by:
- getStringForBundleKeyin class- ClientLocalizationManager
 
- 
getTranslationsFor- Specified by:
- getTranslationsForin interface- TranslationPackage
- Specified by:
- getTranslationsForin class- ClientLocalizationManager
- Returns:
- a map of all of the translations available for a given key.
 
- 
getCurrentLocale- Specified by:
- getCurrentLocalein class- ClientLocalizationManager
 
- 
setCurrentLocale- Specified by:
- setCurrentLocalein class- ClientLocalizationManager
 
- 
addLocaleListener- Specified by:
- addLocaleListenerin class- ClientLocalizationManager
 
- 
removeLocaleListener- Specified by:
- removeLocaleListenerin class- ClientLocalizationManager
 
- 
resetLocalepublic void resetLocale()Description copied from class:ClientLocalizationManagerResets the current locale to the base locale. *- Specified by:
- resetLocalein class- ClientLocalizationManager
 
- 
setEnabledpublic void setEnabled(boolean value) Sets whether the localization manager should be used. If false, returns translations as if the current locale was the default locale. However, doesn't fire events like setting the locale. Used especially to save projects.
- 
setup
- 
refreshModelprotected void refreshModel()
- 
setModel
- 
setSettings
- 
getEdit
- 
getSettingsEdit
- 
hasChangesprotected boolean hasChanges()
- 
addTermDescription copied from interface:MutableTranslationPackageEnsures that the specified key is in the translation package.- Specified by:
- addTermin interface- MutableTranslationPackage
 
- 
addTranslationDescription copied from interface:MutableTranslationPackageSets a translation for the specified key and locale.- Specified by:
- addTranslationin interface- MutableTranslationPackage
 
- 
removeTranslationDescription copied from interface:MutableTranslationPackageRemoves a translation for a specified key and locale. Used when someone had a translation and blanks it out.- Specified by:
- removeTranslationin interface- MutableTranslationPackage
 
- 
addTranslationsDescription copied from interface:MutableTranslationPackageSets all of the translations for a specific key. Translation map can be null, in which case the key will simply be registered in the index.- Specified by:
- addTranslationsin interface- MutableTranslationPackage
 
- 
removeKeyDescription copied from interface:MutableTranslationPackageRemoves the specific key, and any translations.- Specified by:
- removeKeyin interface- MutableTranslationPackage
- Returns:
- true if key was present
 
- 
ensureLocaleExistsDescription copied from interface:MutableTranslationPackageVerifies that the locale is present, adding it if necessary.- Specified by:
- ensureLocaleExistsin interface- MutableTranslationPackage
 
- 
removeLocale- Specified by:
- removeLocalein interface- MutableTranslationPackage
 
- 
getBaseLocale- Specified by:
- getBaseLocalein interface- TranslationPackage
- Returns:
- the "base" locale, the language in which the terms are defined.
 
- 
getKeyHashRuleDescription 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.- Specified by:
- getKeyHashRulein interface- TranslationPackage
 
- 
isDefinedDescription copied from interface:TranslationPackageReturns whether the key is defined in the package. A key can be defined without any particular translations.- Specified by:
- isDefinedin interface- TranslationPackage
 
- 
isDefinedDescription copied from interface:TranslationPackageReturns whether there is a translation defined for the given key in the given locale.- Specified by:
- isDefinedin interface- TranslationPackage
 
- 
getAvailableKeys- Specified by:
- getAvailableKeysin interface- TranslationPackage
- Returns:
- all of the defined keys.
 
- 
createDiff- Specified by:
- createDiffin interface- TranslationPackage
- Returns:
- an empty, modifiable diff that respects the same rules as the translation package.
 
- 
getAllTranslations- Specified by:
- getAllTranslationsin interface- TranslationPackage
- Returns:
- an iterator that goes through all of the translations. Does not include defined keys that have no translations.
 
- 
getSettingsForReturns the settings for the locale. If necessary, will create default settings to return. Therefore, do not use this to see if settings are defined.
- 
getSettingsFor
- 
areSettingsDefined
- 
getRegionalSettings
- 
modifyRegionalSettings
- 
getTranslationSettings
- 
saveTranslationSettings
- 
getPreviewLocale- Specified by:
- getPreviewLocalein class- ClientLocalizationManager
 
- 
setPreviewLocale
- 
fireLocaleChangedprotected void fireLocaleChanged()
- 
onEditStateChangedprotected void onEditStateChanged()
- 
areLocaleSetsDifferent
- 
saveChangesprotected void saveChanges()
 
-