If you would like to upgrade to a newer long-term support version of Studio Pro, see Moving from Mendix Studio Pro 8 to 9.
Language Menu
Introduction
Mendix is designed so that it is easy to present the same information to users who have different language requirements. To support this, all texts that are presented to the end-user can be translated to different languages.
These translatable texts include the following:
Working in the Currently Selected Language
You can see the language you are currently working in at the bottom right of the screen.
When you have multiple languages set up in your app, you can choose a language to work in by doing one of the following:
- selecting it from the Language > Current Language menu
- using the drop-down in the lower-right corner of Studio Pro’s main window
- using the Ctrl + L or Ctrl + Shift + L keyboard shortcut combinations, which cycle through the configured languages
When working in a language which is not the default, you can identify texts that have not been translated yet. These show the text in the default language between angle brackets. For example, <Name>
. You can replace the text with the appropriate translation, and it will be replaced for the currently selected language.
If you edit your app to add new widgets while not in the default language, any new translatable texts for those widgets will be added to the current language. The text in the default language will either be left blank or will have the placeholder text for the widget.
All untranslated texts will be displayed in the default language when you run the application.
[no translation]
. If you want the text to be blank, set the default language text to be a space rather than empty.
The Language Menu
The Language menu allows you to manage additional languages and translations for your app. This includes features to help you to translate a text in all places where it appears with a single change instead of having to change each occurrence individually:
Menu Items Overview
The Language menu items are described in the table below:
Menu Item | Description | Shortcut Key |
---|---|---|
Current Language | Choose the current language from one of the languages set up in Language Settings…. | None |
Select Previous Language | Choose the previous language in the list of languages chosen in Language Settings…. | Ctrl + Shift + L |
Select Next Language | Choose the next language in the list of languages chosen in Language Settings…. | Ctrl + L |
Language Settings… | Choose which languages are supported by the app and configure date and time settings. | None |
Batch Replace… | Change all occurrences of chosen translatable texts in the current language where they are identical. | None |
Batch Translate… | Add and edit translations from a selected source language to a selected target language | None |
Language Operations… | Manipulate (for example, copy) translations between languages. | None |
Setting the End-User’s Language
The language which is displayed to the end-user is determined by the Language object which is associated with the User object for the current end-user via the association User_Language.
If the associated language is not one of those set in the app, then the end-user will see pages in the default language.
If the end-user is not associated with a language, for example they are an anonymous user, the language used depends on the user’s browser or operating system settings. If the language requested is not present up in the app, then the app’s default language will be used. The requested language will be as follows:
- for web apps – the first language which matches a language set in the app based on the browser’s preferred order of languages
- for mobile apps – the operating system language
If you allow end-users to change their display language within the app, the changes will not be applied immediately. This is because the translatable texts for the app are already set to the end-users original language.
There are two options to ensure that the language is changed:
-
Ask the end-user to do something manually
- sign out and sign in again
- use their browser’s refresh command
-
Force Mendix to reload the page – for example by doing the following:
- Add the platform supported widget HTML / JavaScript Snippet to your app.
- Create a pop-up page.
- Place the HTMLSnippet widget on the pop-up page.
- Add the JavaScript content
mx.reloadWithState();
to the widget. - Open your new pop-up page from a microflow when you want to switch the user’s language.
Read More
- How to Translate Your App Content – a worked example of adding a translation
- How To Use Translatable Validation Messages
- Change language by clicking a link – explanations and ideas in the Mendix Community for refreshing the page when the language is changed
- Anonymous User Journey – a discussion in the Mendix Community about switching languages for anonymous end-users