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.
- SelectTemplate Libraries.
- SelectWidgets.
- UnderComponents, dragUser Editorinto theUIfolder inProject view.
- InLibraries, selectClose.
- InProject view, expand theUserEditor#folder and dragLocaleComboBox (type)into theUIfolder.
- Right-click theUserEditor#folder and selectDelete.
- InDelete User Editor#, selectDelete.
- InProject view, select theUIfolder.
- In theProject viewtoolbar, select and then selectUI Session.
- (optional) WithUISession# (type)selected in theUIfolder, inProperties, inLocaleIDs, type the desired starting locale.
- InProject view, select the Presentation Engine.
- InProperties, inSession, select theUISession (type)created in Step 9.
- Right-click the desired target container or page, selectNew, and browse toLocaleComboBox (type)to create an instance.
- InPropertiesfor the new instance, underEvents, inSelection changed, selectAdd new method.
- SelectCommands > Variable commandsand then selectSet variable value.
- InVariableToModify, selectSelect nodeand then selectAliases > Session > VariableToModify > ActualLanguage.
- In theValueproperty, select theLocaleComboBox#instance that you are editing, and then selectSelectedValue.
Provide Feedback