Setting Language change for anonymous users

11
After Mendix 6.5.1, it seems it is impossible to set the language for an anonymous session manually, either by login microflow or a deeplink since the session is created beforehand. I'm not sure why. Is it because the session is stored client-side now or is there another suggested way of setting the language?
asked
4 answers
3

As Rom mentioned, this question was already raised by me in the forum: https://forum.mendix.com/link/questions/23192

Since (apparently) Mx 6.5.1, Mendix stores the userlanguage in the session. With the lack of a setLanguage method for the Mx Session, there is no simple way of dynamically switching language (without logging out). Therefore I have implemented a custom request handler for switching languages. The request handler kills the session and creates a new one with the chosen language.

Bear in mind that you have to create different request handlers when you have anonymous and non-anonymous language switching functionalities. This is due the difference in security between both user groups.

If you need more information on how the implementation should work in detail, please let me know.

answered
3

Okay, so I managed to get what I wanted with a widget. It's only until Mendix fixes the issue.

Its very short, and doesn't use a lot of code and has the advantage of switching language at runtime on demand

Here's a Youtube™ video if you want to see it in action.

Tested with Mendix 6.9.1: Github

answered
0

Hi Herman,

I have tried to use your widget on the anonymous homepage of my app.  Downloaded it from Github. I  put the widget on my homepage. When I open the homepage I only get the "progress bar" running, no button to press.

In your video I see a "toggle button" that seems to be connected to your widget. How is that implemented and connected to the widget?

I am running version 6.9.1

answered
0

Hi all,

I managed to get the widget of Herman to work with slight adjustments in 6.9.1. Though still the enumeration values and (validation) messages are shown in the default application language. Does anyone have ideas about how to solve this?

 

answered