By default, all labels in ToDo are defined in English, but you can provide custom translations.
The ToDo 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.
ToDo titles are stored in the following object:
export default {
"Add task below": "Add task below",
"Add subtask": "Add subtask",
Indent: "Indent",
Unindent: "Unindent",
"Set due date": "Set due date",
"Assign to": "Assign to",
"Move to": "Move to",
Duplicate: "Duplicate",
Copy: "Copy",
Paste: "Paste",
Delete: "Delete",
"Add project": "Add project",
"Rename project": "Rename project",
"Delete project": "Delete project",
"No project": "No project",
"Add task": "Add task",
"New project": "New project",
"Enter a description": "Enter a description",
Search: "Search",
Show: "Show",
all: "all",
active: "active",
completed: "completed",
};
To change the default locale, you need to perform the following steps:
// Russian translations
todo.locales.ru = {
"Add task": "Добавить задачу",
"New project": "Новый проект",
...
};
webix.ui({
view: "todo",
locale: {
lang: "ru"
},
...
});
Related sample: ToDo: Custom Locale
You can change languages dynamically, e.g. by clicking related switch buttons in the toolbar.
todo.locales.ru = { // Russian
"Add task": "Добавить задачу",
"New project": "Новый проект",
...
};
todo.locales.zh = { // Chinese
"Add task": "添加任務",
"New project": "新項目",
...
};
{
rows: [
{
view: "segmented", options: ["en", "ru", "zh"],
click: function() {
const locale = $$("um1").getService("locale");
locale.setLang(this.getValue()); // zh, ru or en
}
},
{ view:"todo", id:"d1" }
]
}
Related sample: ToDo: Switching Locales
The built-in labels of Webix components within the ToDo, as well as date and number localization depend on the current Webix locale in use. To synchronize localizations of ToDo and Webix, define webix parameter in the locale setting of the ToDo constructor:
{
view:"todo",
...
locale: {
lang: "en",
webix: {
// switch Webix the selected locale
en: "en-US",
zh: "zh-CN"
}
}
}
Back to top