43
Views
9
Comments
Solved
Multilingual in Reactive - Workaround to translate all page elements?
Application Type
Reactive
Service Studio Version
11.10.5 (Build 37062)

I'm using the built-in Multilingual for Mobile and Reactive in Outsystems (which is on Technical Preview as of now).
The general usage is straight forward, and easy to implement.

I noticed, that when applying the "SetCurrentLocale" in the control where I want to be able to change the language, not all the Labels and texts change.  Some texts inside tables or other controls remain same.  

Not sure if this is related to how Reactive works, or am I missing something?

As of now, I'm calling the "SetCurrentLocale" from my top Menu (so the user can select the desired language from the Common Menu area), and after this, I implemented a Javascript that calls "window.location.reload(true)".  This will refresh the page, and the current local gets applied, and all the texts are properly set.

Somethig like this below:

I'm not quite comfortable with this implementation.  

Is this a good practice?  Is there any other better way to make sure all elements on the page get Translated correctly without refreshing the page?


Thanks in advance!

Staff
Rank: #226
Solution

Hi @Hector Piza

We were able to confirm that your scenario is part of the known issue that will be fixed with the next release of the Platform Server in early March (Platform Server 11.11.1).

Regarding the workaround, we have concluded that, for now, the approach you had of forcing a page to reload after setting the new locale is necessary to affect the table headers.

Thanks for sharing the issue and help us improve this capability.

Regards,

Vítor Teixeira

Rank: #43524

Hi Vitor,

Thanks a lot for your update!

Regards!

Rank: #311

Instead of the javascript, maybe you can set the destination of this screen action to "Current Screen" instead of an end-node. It would in essence, do the exact same as your javascript. 

You could also store the user's preference for a current locale, and add it to the OnApplicationReady event.

Rank: #2882

Hi Hector!

I don't think refreshing the entire page would be necessary. You could fire an Event from the Menu webblock instead, and simply refresh the data in the Event Handler action. You could also handle any further element refreshes from there.

Rank: #43524

Thank you for answer.  I already implemented this, and it's working mostly everywhere.

My only concern is, how to trigger the update to Table headers text?  The whole table is linked to a DataSource which is fetched at the beginning. I already tried refreshing the Data Source, but not working.

Thanks in advance!

Staff
Rank: #20

Hi Hector,

Just to let you know that is a known issue that will be fixed soon. 

The workaround Monique mentioned (triggering an event in the menu and changing the locale on the event handler, instead of doing it in the menu) should do the trick. What you might be missing is that you need to change the locale on the event on the page, instead of doing it on the menu. For this the event needs to send the locale as a parameter.

Cheers,
Tiago Simões

Rank: #43524

Hi Tiago,

Thanks for your answer.  However, I'm already implementing it the way you stated.  Just the text inside the table header is not getting updated, the rest seems to be fine.

The only solution I have found for these cases is to do a whole page refresh.

Do you have any other idea?

Staff
Rank: #226

Hi Hector, would it be possible to share an OML with the scenario you currently have, so we can try to understand what might be happening. Otherwise, some screenshots can also work.

Thanks,

Vítor

Rank: #43524

Hi Vitor,

Please find attached my test OML (DummyApp).

You will see the Language (English and Español, depending on the current selected) at the top menu.  When you click on a language, everything changes, except the headers of the table. I'm using the trigger event mechanism.

Let me know if I'm missing something.

Thanks!

DummyApp.oml

Staff
Rank: #226
Solution

Hi @Hector Piza

We were able to confirm that your scenario is part of the known issue that will be fixed with the next release of the Platform Server in early March (Platform Server 11.11.1).

Regarding the workaround, we have concluded that, for now, the approach you had of forcing a page to reload after setting the new locale is necessary to affect the table headers.

Thanks for sharing the issue and help us improve this capability.

Regards,

Vítor Teixeira

Rank: #43524

Hi Vitor,

Thanks a lot for your update!

Regards!