[Multilingual Component] Locale not working on Reactive Web

Forge Component
(15)
Published on 2019-10-04 by OutSystems R&D
15 votes
Published on 2019-10-04 by OutSystems R&D

I'm trying to set up the locale for a reactive application for Brazilian Portuguese but it´s not working. We do not need translations, just the Locale for the application.

First I tried to set up the SetLocale on the OnApplicationReady System Event. 


I also tried setting the Locale on the Page Initialization

 

None worked. As can be seen on the pagination of a table, it´s still in English.
 

What am I missing?


Hi Paulo,

Is normal that "items" isn't translated because setting the locale is not enough to change that. Reactive works differently than traditional. Did you read this document on how to use this component?

Regards,

Marcelo

Marcelo Ferreira wrote:

Hi Paulo,

Is normal that "items" isn't translated because setting the locale is not enough to change that. Reactive works differently than traditional. Did you read this document on how to use this component?

Regards,

Marcelo

Hi Marcelo, 

Thanks for the response. I actually read it. 

Do I have to set up the translations even though I am not using any?
  


Hi Marcelo,

I'm having a similar issue. After debugging I did notice the locale being sec correctly however my translations still fail to happen even after following every step in the document. I've done the following steps:
1. add data-trans attribute to all text fields to be translated. (value is the key)

2. create entities for each language (key-value pair record)

3. use addTranslations action to add the translations from entity to the correct locale.

IS there anything I'm missing?

Solution

Hi,

Regarding navigation you will need to provide your translations. Here are the keys:


6c08ff2e-126f-45fe-9737-83cf5de0970f
f3606a4b-4ae9-4147-bbb5-1f016314d425
7daeb8e1-4b0e-4831-b7ad-c9895d4f2d60
b207f5ee-aead-4d0c-bbbd-2bc9a6361e2c
04fc28b2-d8a4-409b-847f-ebf28e962f60


Cheers,

Tiago Simões

Solution

Hi Glenn,

Not sure if this is your issue, but in reactive, because there is no splash screen as in mobile, the OnApplicationReady does not work sometimes, as it runs asynchronously, so the first screen might not be translated right away. A possible workaround is to add this:

To the OnInitialize event of your screens (better yet, encapsulate it in a central client action you can call on all onInitializes). It should give a performance warning for every screen, but you can safely hide it, as it will only have impact the first time users open the app (to load the resources).

Cheers,
Tiago Simões

Tiago Simões wrote:

Hi,

Regarding navigation you will need to provide your translations. Here are the keys:


6c08ff2e-126f-45fe-9737-83cf5de0970f
f3606a4b-4ae9-4147-bbb5-1f016314d425
7daeb8e1-4b0e-4831-b7ad-c9895d4f2d60
b207f5ee-aead-4d0c-bbbd-2bc9a6361e2c
04fc28b2-d8a4-409b-847f-ebf28e962f60


Cheers,

Tiago Simões

Hi Tiago, 

Thanks very much for your explanation, I thought the setLocale worked the same way it did on regular Web applications, by translating its components upon the locale configuration change. IMHO this should have been a no brainer, but it´s a lot of work.


Hi Paulo,

I understand, and I agree with you. We'll probably work on some improvements to the multi-lingual approach to mobile and reactive in the next year.

Cheers,
Tiago Simões

Hi,

I´m  trying to do translations, pt-PT on P11, on builtin messages like validations and users module (ex. login messages) for a reactive app.
Can you tell if we have to provide translations for the users module and if so how to get the keys for those translations?

PS: for built-in validations saw 2.1 on MultiLingualComponent-documentation.pdf.

Best regards,
Vasco Batista

Hi Vasco,

I don't think there are keys in there. You may need to do that on the exception handler flow of the login action in your app. Analyzing Users code, the exception given by the User_Login action is usually ""Invalid username or password.".

Cheers,
Tiago Simões

Hi Tiago,

Thanks I'll do that.

Best regards,
Vasco Batista