dojo.locale in Mendix 8, custom widgets

1
Hello! I am currently doing the upgrade from Mendix 7 to Mendix 8 and I run into a problem in our custom widgets. In the widgets the dojo feature dojo/i18n is used; based on the locale of the user some text is displayed. This is where the problem occurs. In Mendix 7 dojo.locale gives the locale/language of the application and in Mendix 8 dojo.locale gives the locale/language settings of the device. Default our app is Dutch, so we want all text in Dutch. However, if someone has English as device language the text from the widgets will be in English, which is of course weird. The locale settings from the application can be found in the sessiondata in mx.session. However, the mx.session.getUserAttributes is deprecated in Mendix 8. Has anyone ideas how to get the locale settings from the application?   Thanks!
asked
1 answers
0

Hi Dominique,

I'm not sure if this also works for hybrid mobile and probably doesn't work for native mobile. But for responsive web there is an option to use the lang attribute that Mendix renders on the HTML tag in your dom tree. This is set based upon the locale that the user currently accessing the system has selected. For anonymous users I believe it is set by default to the projects default language.

I hope that helps.

Mitchel

answered