Showing a particular page for a particular language

0
Can you please tell me how to show a page for a particular audience of a particular language?
asked
4 answers
2

Best way to achieve a multilingual app is by using multiple languages in the app and translate all caption, labels, messages. 

Far more easy than creating language specific pages. 

See: https://docs.mendix.com/refguide/translatable-texts/

 

 Per account you can set the language, which will automatically detected by the runtime when the user logs in. All pages will be shown according to the translated texts (see documentation link above)

 

As I understand you you want to show the results of a API call in a page . If its only about the Page (labels, captions etc) then above will help you. If you need the language of the user to call the API with this information, so that the request send is including a language parameter. In that case you can retrieve the language of the user and use that in you rest request.

 

See below the domain model which is related to the language selection in the app for a user/account and retrieving the language before your rest API call.

answered
0

You have several options.

 

1# You can define users with a defined language and define a different home page for each language. Eventually, you can also have a complete page tree for each language.

 

2# You can just use the translate option. Each user will see the same page but in the language defined for him (but only for logged users. The first solution can also work for non logged users).

 

3# You can define in you app containers to display for a specific language. Use the visibility constraint like e.g., “$currentObject/LanguageCodeUser='en_US'”. It’s a bit disturbing when creating because you could have several time the same widget but pointing on a different attribute of your entity following the language.

 

Hope it helps.

answered
0

As you can see in the image below, I showed you the System.User_Languge variable and I used it in the decision like this: $currentUser/System.User_Language/System.Language/Code = 'System.Language (ID: "18295873486192811")'.  I am checking language code of the user’s language. Is the expression correct? It is always going to the ‘false’ workflow.

 

 

 

answered
0

Hi,

 

You can get the list of supported language code from https://docs.mendix.com/refguide/language-settings/#supported-languages

 

 

One way to do this is Retrieve the current language of the User , then check for example   $CurLanguage/Code = 'nl_NL' .

Thanks

 

Thanks

 

answered