system.i18n.modifyTranslations
This function is used in Python Scripting.
Description​
Adds, updates, or removes translations for a single locale in the Translation Manager. Each entry in the values dictionary maps a translation key to its translation. A value of None removes that key's translation for the locale. If any entry is invalid, no changes are applied.
Client Permission Restrictions​
This scripting function has no Client Permission restrictions.
Syntax​
tip
This function accepts keyword arguments.
system.i18n.modifyTranslations(values, locale)
Parameters​
| Type | Parameter | Description |
|---|---|---|
| Dictionary | values | A dictionary mapping each translation key to its translation for the given locale. A value of None removes the key's translation. |
| Locale or String | locale | The locale the values dictionary applies to, such as "it" or "en-IE". Accepts a Java Locale object, a BCP-47 language tag, or a Java locale identifier. |
Returns​
None
Scope​
Gateway, Vision Client, Perspective Session
Code Examples​
Code Snippet
# Add or update Italian translations for two keys, and remove the Italian translation for a third.
translations = {
"Hello": "Ciao",
"Goodbye": "Arrivederci",
"Tank": None
}
system.i18n.modifyTranslations(translations, "it")