Ext JS动态更改app.json的区域设置 [英] Ext JS dynamically change locale settings of app.json

查看:472
本文介绍了Ext JS动态更改app.json的区域设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Ext JS 6.2.0实现本地化,方法是按照>>>>>>>>>>>>>。。。。但是,如果要更改语言环境,我需要修改app.json中的locale设置并重新加载应用程序。

 locale:en,

我想下拉菜单允许用户切换语言。有没有办法实现?

Sencha的Ext JS本地化解决方案是构建一个网页,支持的每个区域设置。 Sencha CMD还支持app.json文件中的复数locales。 区域设置配置是支持的区域设置的数组,将自动化构建配置中每个条目创建构建配置文件的过程(请参见下面提供的Microloader文档链接)。配置区域设置后,应用程序构建将为每个受支持的区域设置输出一个Web页面。当用户选择希望在其中查看应用程序的语言时,该页面必须重定向到相关网页的index.html文件。



构建配置文件中的文档



页面重定向文档


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?

解决方案

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

这篇关于Ext JS动态更改app.json的区域设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆