Interface LocalizationManager
Gateway-scoped access to the system's translation store: the set of localizable keys and the translations defined for them across the gateway's available locales.
Obtain an instance from
GatewayContext.getLocalizationManager().
Read the current state with loadFullPackage(), inspect how terms are matched with
getTranslationSettings(), and persist edits by building a
TranslationPackageDiff and passing it to applyDiff(TranslationPackageDiff).
A typical edit reads the current package, derives a diff from it, stages changes, and applies them:
LocalizationManager manager = context.getLocalizationManager();
TranslationPackage current = manager.loadFullPackage();
TranslationPackageDiff diff = current.createDiff();
diff.addTranslation("greeting", Locale.FRENCH, "Bonjour");
manager.applyDiff(diff);
-
Method Summary
Modifier and TypeMethodDescriptionvoidApplies a set of staged changes — added, modified, or removed keys, locales, translations, and notes — to the translation store and persists them.Returns the settings that govern term matching, such as whether case, whitespace, punctuation, or tags are ignored when looking up a term.Loads the complete set of translation data managed by the gateway: every defined key and its translations across all available locales.
-
Method Details
-
loadFullPackage
TranslationPackage loadFullPackage()Loads the complete set of translation data managed by the gateway: every defined key and its translations across all available locales.- Returns:
- a snapshot of the full translation store. Subsequent edits applied through
applyDiff(TranslationPackageDiff)are not reflected in a previously returned package; load again to observe them.
-
getTranslationSettings
TranslationSettings getTranslationSettings()Returns the settings that govern term matching, such as whether case, whitespace, punctuation, or tags are ignored when looking up a term.- Returns:
- the gateway's current translation settings.
-
applyDiff
Applies a set of staged changes — added, modified, or removed keys, locales, translations, and notes — to the translation store and persists them.
Build the diff from the package you intend to modify, typically via
TranslationPackage.createDiff()on the result ofloadFullPackage(), so that it carries the same matching rules as the store.- Parameters:
diff- the changes to apply.- Throws:
PushException- if the changes cannot be persisted.
-