[IGN-4876]System.util.translate takes too long

Yeah, unfortunately there’s a weakness in our implementation of system.util.translate here - the function can’t simply ask the gateway for a specific term, it has to load an entire ‘translation package’ (containing all your defined translations, across all locales) and then retrieve your single element. Every single call to system.util.translate is doing that.
You can use a script like the one I posted here to ‘bulk’ translate calls into a single roundtrip (and a single fetch of the translation package), or you can look into precalculating/caching translations in session properties, or you could use a modified version of the script I linked to cache the TranslationPackage in a top-level script constant.

2 Likes