Localization
The library provides two built-in locales:
- English
- Chinese
You can also apply a custom locale.
Default locale
The English locale is applied by default:
const en = {
//calendar
calendar: {
monthFull: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
monthShort: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
dayFull: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
],
dayShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
hours: "Hours",
minutes: "Minutes",
done: "Done",
clear: "Clear",
today: "Today",
am: ["am", "AM"],
pm: ["pm", "PM"],
weekStart: 7,
clockFormat: 24
},
//core
core: {
ok:"OK",
cancel:"Cancel",
select: "Select",
"No data": "No data"
},
//formats
formats: {
dateFormat: "%d.%m.%Y",
timeFormat: "%H:%i"
},
lang: "en-US",
//Gantt
gantt: {
// Header / sidebar
"Task name": "Task name",
"Start date": "Start date",
Duration: "Duration",
Task: "Task",
Milestone: "Milestone",
"Summary task": "Summary task",
// Sidebar
Save: "Save",
Delete: "Delete",
Name: "Name",
Description: "Description",
"Select type": "Select type",
Type: "Type",
"End date": "End date",
Progress: "Progress",
Predecessors: "Predecessors",
Successors: "Successors",
"Add task name": "Add task name",
"Add description": "Add description",
"Select link type": "Select link type",
"End-to-start": "End-to-start",
"Start-to-start": "Start-to-start",
"End-to-end": "End-to-end",
"Start-to-end": "Start-to-end",
// Context menu / toolbar
Add: "Add",
"Child task": "Child task",
"Task above": "Task above",
"Task below": "Task below",
"Convert to": "Convert to",
Edit: "Edit",
Cut: "Cut",
Copy: "Copy",
Paste: "Paste",
Move: "Move",
Up: "Up",
Down: "Down",
Indent: "Indent",
Outdent: "Outdent",
"Split task": "Split task",
// Toolbar
"New task": "New task",
"Move up": "Move up",
"Move down": "Move down",
},
};
cn locale
const cn = {
// calendar
calendar: {
monthFull: [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
monthShort: [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
dayFull: [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
],
dayShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
hours: "小时",
minutes: "分钟",
done: "完成",
clear: "清除",
today: "今天",
am: ["", ""],
pm: ["", ""],
weekStart: 7,
clockFormat: 24,
},
//core
core: {
ok: "确定",
cancel: "取消",
select: "选择",
"No data": "没有数据"
},
// formats
formats: {
timeFormat: "%H:%i",
dateFormat: "%Y-%m-%d",
},
lang: "zh-CN",
// Gantt
gantt: {
// Header / sidebar
"Task name": "任务名称",
"Start date": "开始日期",
Duration: "期间",
Task: "