The requested page is not available for the requested platform. You are viewing the content for Default platform.
A newer version of this page is available. Switch to the current version.

How to: Change a Mobile UI Language at Runtime

  • 2 min to read

The Localization Mobile Module allows you to switch between the predefined languages at runtime on a client side. This topic describes how to change a Mobile UI language when you click an Action.

MobileLocalization_ChangeLanguage

Follow the steps below to implement this feature in your Mobile application:

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
// ...
public class ChangeLocalizationController : ViewController {
    SingleChoiceAction action;
    public ChangeLocalizationController() {
        action = new SingleChoiceAction(this, "Change language", DevExpress.Persistent.Base.PredefinedCategory.Unspecified);
        action.ItemType = SingleChoiceActionItemType.ItemIsOperation;
        action.Items.Add(new ChoiceActionItem("DE", "de"));
        action.Items.Add(new ChoiceActionItem("EN", ""));
        action.RegisterClientScriptOnExecute("CurrentLanguage", @"
            localStorage.setItem('CurrentLanguage', actionParameter.data);
            $functions.logout();
        ");
    }
}