Reputation: 57
I'm trying to implement localization with Ext JS 6.2.0 by following Sencha's localization docs.
It works well. However, if I want to change the locale, I need to modify the "locale" settings in "app.json" and reload the application.
"locale": "en",
I'd like to have a dropdown menu to allow users switch language. Is there a way to achieve that?
Upvotes: 2
Views: 2199
Reputation: 1724
Sencha's solution for localization with Ext JS is to build a Web page with the application for each locale that is supported. Sencha CMD also supports the plural "locales" in the app.json file. The "locales" configuration is an array of supported locales that will automate the process of creating a build profile for each entry in the "builds" configuration (see the link to the Microloader documentation provided below). After configuring the locales, the application build will output a Web page for each of the supported locales. When a user selects a language they wish to view the application in, the page must be redirected to the index.html file of the associated Web page.
Documentation on Build Profiles
Documentation on Page Redirects
Upvotes: 2