Hi,
Why when try to set this code in config of a page cause loop infinite page freeze.
ready() {
this.app.getService("locale").setLang("en");
}
What is the better way to set language when load my app?
Thanks in advance.
Hi,
Why when try to set this code in config of a page cause loop infinite page freeze.
ready() {
this.app.getService("locale").setLang("en");
}
What is the better way to set language when load my app?
Thanks in advance.
it depends on app logic.
commonly default language is defined in service (config or variable).
also service should check if language is changed, to prevent unnecessary reload.
if you are using jet locale plugin, then pass webix.storage.local as storage in plugin config. but locale plugin does not check current language, so you need to check it explicitly.
var service = this.app.getService("locale");
if(service.getLang() != newLang){
service.setLang(newLang);
}