Class TranslationPackageDiff
java.lang.Object
com.inductiveautomation.ignition.common.i18n.translation.BasicTranslationPackage
com.inductiveautomation.ignition.common.i18n.translation.TranslationPackageDiff
- All Implemented Interfaces:
MutableTranslationPackage
,TranslationPackage
,Serializable
,Iterable<Translation>
public class TranslationPackageDiff
extends BasicTranslationPackage
implements MutableTranslationPackage, Iterable<Translation>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.inductiveautomation.ignition.common.i18n.translation.BasicTranslationPackage
BasicTranslationPackage.TranslationIterator
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Ensures that the specified key is in the translation package.void
addTranslation
(String key, Locale locale, String value) Sets a translation for the specified key and locale.void
addTranslations
(String key, TranslationMap translations) Sets all of the translations for a specific key.void
clearChanges
(Locale locale) Removes any modified terms for the given locale.void
ensureLocaleExists
(Locale locale) Verifies that the locale is present, adding it if necessary.Returns an unmodifiable set of the removed keys *boolean
boolean
isModified
(String key) boolean
isModified
(String key, Locale locale) boolean
boolean
iterator()
protected TermKey
registerIndexKey
(String key) boolean
Removes the specific key, and any translations.void
removeLocale
(Locale locale) void
removeTranslation
(String term, Locale locale) Removes a translation for a specified key and locale.Methods inherited from class com.inductiveautomation.ignition.common.i18n.translation.BasicTranslationPackage
applyPackage, createDiff, equals, get, getAllTranslations, getAvailableKeys, getAvailableLocales, getBaseLocale, getBundle, getIndex, getKeyHashRule, getOrCreateBundle, getOrCreateTermKey, getOrNull, getStrict, getTermKey, getTranslationsFor, hashKey, isDefined, isDefined, setBaseLocale, setIndex, setKeyHashRule, updateIndex
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.inductiveautomation.ignition.common.i18n.translation.TranslationPackage
createDiff, get, getAllTranslations, getAvailableKeys, getAvailableLocales, getBaseLocale, getKeyHashRule, getStrict, getTranslationsFor, isDefined, isDefined
-
Field Details
-
removedKeys
-
removedLocales
-
removedTranslations
-
-
Constructor Details
-
TranslationPackageDiff
public TranslationPackageDiff() -
TranslationPackageDiff
-
-
Method Details
-
getRemovedKeys
Returns an unmodifiable set of the removed keys * -
getRemovedLocales
-
addTerm
Description copied from interface:MutableTranslationPackage
Ensures that the specified key is in the translation package.- Specified by:
addTerm
in interfaceMutableTranslationPackage
- Overrides:
addTerm
in classBasicTranslationPackage
-
isModified
-
isModified
-
isRemoved
-
isRemoved
-
clearChanges
Removes any modified terms for the given locale. Does not mark the locale as deleted. * -
registerIndexKey
-
addTranslation
Description copied from interface:MutableTranslationPackage
Sets a translation for the specified key and locale.- Specified by:
addTranslation
in interfaceMutableTranslationPackage
- Overrides:
addTranslation
in classBasicTranslationPackage
-
addTranslations
Description copied from interface:MutableTranslationPackage
Sets 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:
addTranslations
in interfaceMutableTranslationPackage
- Overrides:
addTranslations
in classBasicTranslationPackage
-
removeTranslation
Description copied from interface:MutableTranslationPackage
Removes a translation for a specified key and locale. Used when someone had a translation and blanks it out.- Specified by:
removeTranslation
in interfaceMutableTranslationPackage
- Overrides:
removeTranslation
in classBasicTranslationPackage
-
removeKey
Description copied from interface:MutableTranslationPackage
Removes the specific key, and any translations.- Specified by:
removeKey
in interfaceMutableTranslationPackage
- Overrides:
removeKey
in classBasicTranslationPackage
- Returns:
- true if key was present
-
ensureLocaleExists
Description copied from interface:MutableTranslationPackage
Verifies that the locale is present, adding it if necessary.- Specified by:
ensureLocaleExists
in interfaceMutableTranslationPackage
- Overrides:
ensureLocaleExists
in classBasicTranslationPackage
-
removeLocale
- Specified by:
removeLocale
in interfaceMutableTranslationPackage
- Overrides:
removeLocale
in classBasicTranslationPackage
-
hasChanges
public boolean hasChanges() -
iterator
- Specified by:
iterator
in interfaceIterable<Translation>
-
getRemovedTranslations
-