By default, all labels in Desktop are defined in English, but you can provide custom translations.
The Desktop widget package includes only en-US locale. Check our Locales repository for the language you need or create your own locale. Feel free to contribute your successful translation.
Desktop titles are stored in the following object:
export default {
App: "App",
"Close all": "Close all",
}
To change the default locale, you need to perform the following steps:
// Russian translations
desktop.locales.ru = {
App: "Приложение",
"Close all": "Закрыть все",
};
webix.ui({
view: "desktop",
locale: {
lang: "ru"
},
...
});
You can change languages dynamically, e.g. by clicking related switch buttons in the toolbar.
desktop.locales.ru = { // Russian
App: "Приложение",
"Close all": "Закрыть все"
};
desktop.locales.zh = { // Chinese
App: "附錄",
"Close all": "關閉所有"
};
{
rows: [
{
view: "segmented", options: ["en", "ru", "zh"],
click: function() {
const locale = $$("um1").getService("locale");
locale.setLang(this.getValue()); // zh, ru or en
}
},
{ view:"desktop", id:"d1" }
]
}
The built-in labels of Webix components within the Desktop, as well as date and number localization depend on the current Webix locale in use. To synchronize localizations of Desktop and Webix, define webix parameter in the locale setting of the Desktop constructor:
{
view:"desktop",
...
locale: {
lang: "en",
webix: {
// switch Webix the selected locale
en: "en-US",
zh: "zh-CN"
}
}
}
Back to top