Set the locale

Set the locales supported by the project

For a locale to be set at runtime, it must be supported by the project. To add locales to the project, in the Locales property of the project node, set the desired locale IDs, separated by “;” (e.g.: it-IT; fr-FR; en-US).

Note

for every locale added to the project, Q Studio automatically adds a corresponding column in a LocalizationDictionary object, in particular in the Localization editor table (see Translation editor).

Set the fallback locales

In the Fallback locales for translation property of the project node, set the desired locale IDs, separated by “;” (e.g.: it-IT; fr-FR; en-US).

Set the locale through User objects

In a User object, in the LocaleID property, select the desired locale.

Configure the selection of the locale at runtime through the Session UI object

In multilingual projects in which the user locale is not configured, at runtime the user can be asked to choose the session locale through graphical objects.

To do this, it is recommended to re-use the LocaleComboBox Drop-down selection object of the User Editor widget. The object contains a NetLogic which makes it possible to read all the project locales (Locales property of the project node), and dynamically set the model of the Drop-down selection object with the read values.

Important

for the setting of the locale through the Session UI object to function correctly at runtime, no locale should be set on the LocaleIDs property of the User object.

  1. To re-use the LocaleComboBox object, temporarily add the User Editor widget to your project, move LocaleComboBox (type) into the UI folder, then remove the widget.

  2. In Project, click UI > image1 > Session UI: a new object of the Session UI type appears.

  3. In the LocaleIDs property of the just-created object, set the desired locale.

  4. In the Presentation engine of interest, in the Session property, select the object created in step 1.

  5. Create an instance of the LocaleComboBox (type) graphical object in the desired container.

  6. Next to the Model property of the LocaleComboBox object, click image2, then inside the Session UI object created select the Languages property, then click Selection.

See also

Related concepts

Locale

References

UI Session

User

SessionType