[FEATURE-13837] Translations

Dear all,
I am currently using the b2019040718 release.
what about the translation feature in Perspective? Are there news about this topic?
The translation feature is a key point to widely deploy our applications.

Thank you in advance for your reply.
Andrea

Right now there is fundamental support for translations in Perspective, but they aren’t quite useful yet (currently only supported by Buttons and Labels). I’ve added a ticket to prioritize the rollout across all components. I can’t provide a timeline at the moment, but will update when I can.

Good morning,
thank you for your reply. Could you clarify me how to set up the translations for Buttons and Labels?

Thanks.
Andrea

Hi Andrea,

There is really very little to setup. Basically if you have terms defined for a locale, and the session is set to that locale (session.props.locale), then a term matching property value will get swapped with the localized term.

For instance:
I display the term “food” in en_us.
I add a localization for es that maps “food” to “comida”, using the translation manager.

Now, on any label being presented, if the default locale (en_us) text value is “food” and the session.props.locale is set to es, then the value displayed will be “comida”.

The underlying property value does not change, we simply present the localized version to the user instead of the default en_us version.

Thank you for your reply.
Just a few more questions:

  1. Are the “system.util.*” functions related to translations (like “system.util.modifyTranslation” ) limited to the vision scope or available also in perspective?
  2. Does the “session.props.locale” value correspond to the Java locale codes?

Thank you.
Andrea

As many of the system.util functions as can be are in the process of being ported over to work in all scopes - possibly 8.0.2, maybe 8.0.3 for those that can be.
session.props.locale is the IETF language tag equivalent of the Java locale: https://en.wikipedia.org/wiki/IETF_language_tag - see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Locale.html#toLanguageTag() for how we map them from Java to JS to send them to the frontend.

This feature was added in the 8.0.2 nightly build that was uploaded today (5/21).

2 posts were split to a new topic: [feature-14961]Add system.util.modifyTranslation to GW/Perspective

system.util.modifyTranslation has been added to all scopes in Ignition 8.0.13 and will appear in the nightlies tonight.

1 Like