简体   繁体   English

有没有办法在dojo中关闭本地化?

[英]Is there a way to turn off localization in dojo?

I have Dojo, it has its own localization. 我有Dojo,它有自己的本地化。 I use Dojo to communicate with a REST API, which has it's own set of localization. 我使用Dojo与REST API进行通信,REST API具有自己的本地化集。 I want to use my localization instead of Dojo's, which we've gotten to work. 我想使用我的本地化而不是Dojo,我们已经开始工作了。 However, Dojo is still fetching it's localization bundle. 但是,Dojo仍在提取它的本地化软件包。

How do I prevent it from fetching its localization bundle? 如何阻止它获取其本地化包?

There is no way not to load at least one bundle. 没有办法加载至少一个包。

If you set djConfig="locale:'en'" in your script loading, then Dojo will assume it is running in the "en" locale. 如果在脚本加载中设置djConfig =“locale:'en'”,则Dojo将假定它在“en”语言环境中运行。 This is the absolutely minimum, as the "en" locale is always loaded -- it is the fall-back. 这是绝对最小的,因为“en”语言环境总是被加载 - 它是后退。

You have to make a custom build and merge the "en" bundle into the build file if you don't want it to load. 如果您不想加载,则必须进行自定义构建并将“en”包合并到构建文件中。

You may avoid loading the bundle if you do not use any dijit's or locale-dependent dojo functions (eg dojo.date.locale.format, dojo.number.format etc.) -- these will automatically initialize the i18n system and load at least the default locale "en". 如果您不使用任何dijit或依赖于语言环境的dojo函数(例如dojo.date.locale.format,dojo.number.format等),您可以避免加载bundle。这些将自动初始化i18n系统并至少加载默认语言环境“en”。

If you use a feature in Dojo which uses dojo.i18n (mostly Dijit, also dojo.date, number and currency) then it will make requests for the necessary localization bundles over the network using the predetermined scheme. 如果您在Dojo中使用dojo.i18n(主要是Dijit,也是dojo.date,数字和货币)的功能,那么它将使用预定方案通过网络请求必要的本地化包。 There's no way to disable it or redirect it, since the logic is built right in. 没有办法禁用它或重定向它,因为逻辑是内置的。

If you just want to use other parts of Dojo or build your own widgets, then you can build your own localization scheme. 如果您只想使用Dojo的其他部分或构建自己的小部件,那么您可以构建自己的本地化方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何关闭Google reCAPTCHA本地化或锁定为英语 - How to turn off Google reCAPTCHA localization or lock to English 在Dojo构建期间的Minification期间关闭文件编译 - Turn off compilation of files during Minification during Dojo build 关闭分页的更简单方法 - Easier way to turn off paging 有没有办法有条件地关闭控制器中的reloadOnSearch? - Is there a way to conditionally turn off reloadOnSearch in a controller? 关闭Firebase监听器的正确方法? - Proper way to turn off firebase listeners? 使用 Webpack 和 Babel 时,关闭压缩的最佳方法是什么? - When using Webpack and Babel, what is the best way to turn off compression? 是否有一种跨浏览器方式可以使用Java脚本关闭Cookie? - Is there a cross browser way to turn off cookies using Javascript? 有没有办法关闭测试库中的语法突出显示 - Is there a way to turn off syntax highlighting in testing-library 有没有办法在babelify中关闭“超级之前不允许这样的规则”? - Is there a way to turn off the “this is not allowed before super” rule in babelify? 有什么方法可以以编程方式在 Chrome 上打开/关闭实时字幕吗? - Any way to turn on/off live captions on Chrome programmatically?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM