[Bug-9453]Perspective and Language / Translation Manager

I feel like I might be missing something…

I have a Perspective app that I am putting together, that will be used within our corporate network at various sites. These sites could speak different languages. The current Ignition app uses Vision and this is super easy to do with the language selector component.

I cannot seem to re-create the same type of feature in Perspective.

First, I see there is a locale in the session props and found a release note about 8.0.2 and needing to set that session prop to switch the language. I have Thai and English setup in the translation manager and a few words translated in each for testing. If I set that system.props.locale property to ‘th’. Nothing happens.

Second, the system.util.translate and the translate() expression function seem to not be processed on the server side. I suppose this makes sense as Vision uses the translation manager in the client scope.

So the problem is that i am stuck and am not sure how to proceed to get the translations to work in perspective. The release notes and some forum posts seem to indicate that it is possible, but I cannot for the life of me figure it out.

It sounds like you’re incorrectly setting the locale; try th-TH.

As for the Translation Expression, we have an open bug ticket to address that issue.

[EDIT]
Actually, just th worked for me. Here’s what I have set up, and it’s working exactly as I would expect:
I have supplied “Thai” as a translation-ready language and supplied a term that should be translated, as well as the translation (and obviously save this translation):

I have a Perspective Label component which has text which matches the term to translate (and you can see my English (Alternate) translation already in place:

If I switch my session locale to th-TH (or even just th), then I see the following:

Could you supply me with a term you’ve translated from English to Thai?

ah man, I feel like a moron.

I didn’t have my tag binding as bi-directional. Thanks for the help.

One last question. I don’t see any way to mark the fields a requiring translation. Does perspective simply translate any term seen on the screen?

I don’t think it’s ANY text, as modifying values in an input component could have serious consequences.

I think it’s also more akin to “phrases” as in my example “Computer” is translated to PC for my English (Alternate) translation, yet “I own a Computer” remains “I own a Computer”.

Also, if you see a property with a key of “source” or “label”, I believe those are skipped as well, as it’s understood that the value could be used for something and so should retain its current value.

Testing out these general observations seem to re-enforce my theories:

  • Properties with keys of “text” for components which are not inputs where that text is their driving property seem to always translate (so even though the Text Field component has a “text” property it does not get translated, whereas the Checkbox component “text” property DOES get translated).
  • Properties with keys of “label”, “source”, and “value” seem to not translate.
  • Setting up a Translatio of “Computer” -> “PC” and “I own a Computer” -> “I do not own a Mac” results in text properties of “Computer” becoming “PC”, whereas “I own a Computer” becomes “I do not own a Mac”.

Thanks for the reply

Is there a reason why the horizontal menu text is not translating?

37%20AM