Hi, I’ve seen some topics of this on the forum, but most of those are over 5 years old and I can’t find my answers there. So I’ve created a new app, just to test, how the localization/internationalization works. On my homepage I added this label into a data view: This text is written in the language selected by the user, which is: {1}, where the parameter is the Description property of the language of the current user (parameter from the data source microflow). Then I added 2 more languages and translated the label with Batch translate. Then added a drop down with language codes and in an on-change microflow I selected the language and set it as the current users language. Last I’ve set up the security. Selecting a value from the list changed the parameter value in the label, but not the language of it. After that I tried to save the language and set it in the data source microflow of the data view, which gave the same result. I also tried the Locale Switcher widget, added the snippet, but it also doesnt work and it gives me this error: Cannot set property '_blocked' of undefined TypeError: Cannot set property '_blocked' of undefined at callback (http://localhost:8080/widgets/LocaleTester/widget/LocaleTester.js?636900699808569998:124:39) What am I missing here? How should this be done? I don’t care, if the page must be refreshed.
asked
Kalman Csuszner
3 answers
1
Generally changes to a user require a re-log into the app.
That might be what’s causing issues for you. The locale switcher should be handling this, but the easiest way to check is re-log and see if it helps.
The language object shouldn’t need changing, you need only commit the user object.
answered
Dragos Vrabie
3
It is not necessary to autologin/relogin for this – but indeed language is not refreshed automatically.
I have no experience with the widget so I do not know if it is still working as should. The trick is to autologin again after the language has been changed. You can use this forum post https://forum.mendix.com/link/questions/93080
to see how autologin works. It is a bit technical though but Matt;'s blog explains all the necesarry steps. Otherwise Edit your original question on where you get stuck.