Unfortunately, reloading the client alone does not seem to be sufficient to refresh the user language. The user still has to logout and log back in.
We can get a microflow to change the language, logout the user with a java action, and redirect to the front page but.... if only we could log a user back in automatically, the problem would be solved. I guess that's not possible because of passwords though.
I'll submit a feature request for real-time language changing.
so; it's five years later now. Is there a nice and clean solution for this use case? :)
Hmm it would become a bit hacky but maybe a MF trigger which changes the users language, and than open a form with an url redirector widget to index.html might work?
I'm not sure whether you need to login and logout to apply a new language, or just reload the client...
* update * new sessions can be created in java (without knowing the password) using:
IContext c = <some(sudo)context>; IUser user = Core.getUser(c, username); return Core.initializeSession(c, user, <null or existing session>, <locale string or empty string>);
what was the final resolution here? I have also filed a feature request (#8143)
If this works why not add it to a default theme? A combobox with available languages. We will inform you about the results.
A possible workaround for the anonymous part of site is: run 2 Mendix services on separate ports. Redirect www.myportal.com/en/ to port 8080 and www.myportal.com/nl/ 8081 (Sample values). Deploy two identical models, only change the default language. Of course you can deploy more languages. Both use the same database.
Insert a menu or button English/Dutch on every page (probably in the theme) that redirects to the other site. URL Redirector can be used.
Still searching for the part after one is logged in....