[feature-14961]Add system.util.modifyTranslation to GW/Perspective

#1

Dears,
I notice the system.util.modifyTranslation is not available from perspective side (8.0.3 release).
At this time is there a way to dinamically modify a translation term from the client interface?
If not, when it will be added?

Thank you,
Andrea

0 Likes

[FEATURE-13837] Translations
#2

It’s not ideal, but this code should work for now (only from the Gateway/Perspective):

from org.apache.commons.lang3 import LocaleUtils

from com.inductiveautomation.ignition.gateway import IgnitionGateway
from com.inductiveautomation.ignition.common.i18n.translation import TranslationPackageDiff

translationLocale = LocaleUtils.toLocale("en_US")

modifications = TranslationPackageDiff()

modifications.addTranslation("term", translationLocale, "translation")

IgnitionGateway.get().getLocalizationManager().applyDiff(modifications)
0 Likes

#3

Thank you. it works!
What about the temporary workaround for the system.util.translate function?

Best,
Andrea

0 Likes

#4
from com.inductiveautomation.ignition.gateway import IgnitionGateway
translations = IgnitionGateway.get().getLocalizationManager().loadFullPackage()

translation = translations.get(<locale>, "term")

translations will be an instance of a TranslationPackage.

0 Likes

#5

Ok, thanks!

0 Likes