Get Translate Manager Terms for perspective?

Hello,
im trying to get an overview of the translations for the client view in perspective (version :8.1.4 (b2021040109)).
I found this function in the docs “system.util.getAvailableTerms()”
but seems its only for vision.
Is there an other way to get a list of translations?

The system.util.modifyTranslation() is working tho.

Not currently through an easy scripting function, but you can adapt the code I posted here:

The result of loadFullPackage is going to be a TranslationPackage object, which has a variety of useful methods:
https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.1/com/inductiveautomation/ignition/common/i18n/translation/TranslationPackage.html

1 Like

Thanks i can use this!

Oke i can see all the translation, but how can i update this package as a whole?
Ive found its possible to make a TranslationPackageDiff, this would be ideal to store temporary updates in i guess, but i dont see how to actual update the Translations.

And its possible to apply the package with a function " BasicTranslationPackage"

But its not updating in the gateway yet.

Or will i need to use system.util.modifyTranslation()?
If so how do i delete a translation or be able to edit the Term-key?

Update:
i used inspect on IgnitionGateway.get().getLocalizationManager() and found the funtion com.inductiveautomation.ignition.gateway.i18n.LocalizationManagerImpl.applyDiff

Which works great, i didnt seem to find any information about it on the site tho.
Is it possible the site isnt uptodate or did i just look at the wrong place? Or is this a function that is not supported?

For reasons I’m not entirely clear on, the gateway side implementation of translation/localization is considered an implementation detail. It’s unlikely to change between Ignition versions for pragmatic reasons (we don’t change our codebase much if something works) but you should be aware of the possibility - we might refactor things in our codebase which would make your calls stop working.

You’re in a bit of a grey area re: ‘supported’. You absolutely can’t call/email into support and expect help with scripting like this, and, in general, manually calling internal Java methods on the gateway can be ‘dangerous’ - you could cause any number of unintended side effects if you call certain methods.
For this use case, I think it’s fine, and it’s reasonable to want to fill this gap in first-party functionality - that’s why I shared the script in the first thread, and why I felt it reasonable to share in this thread.

1 Like