Configure the locale at runtime
In multilingual projects where the user locale is not configured, you can prompt the user to select the session locale through graphic objects at runtime.
Use a custom object containing a NetLogic to display a list of locales. The locale selected in the Session object changes the locale for the project.
-
Select
Template Libraries.
- Select Widgets.
- Under Components, drag User Editor into the UI folder in Project view.
- In Libraries, select Close.
- In Project view, expand the UserEditor# folder and drag LocaleComboBox (type) into the UI folder.
- Right-click the UserEditor# folder and select Delete.
- In Delete User Editor#, select Delete.
- In Project view, select the UI folder.
-
In the Project view toolbar, select
and then select UI Session.
- (optional) With UISession# (type) selected in the UI folder, in Properties, in Locale, type the desired starting locale.
- In Project view, select the Presentation Engine.
- In Properties, in Session, select the UISession (type) created in Step 9.
- Right-click the desired target container or page, select New, and browse to LocaleComboBox (type) to create an instance.
-
In Properties for the new instance, under Events, in Selection changed, select
Add new method.
- Select Set variable value. and then select
-
In VariableToModify, choose
Select node and then select .
- In the Value property, select the LocaleComboBox# instance that you are editing, and then choose SelectedValue.