u
This commit is contained in:
1 parent
f572dce2f6
commit
e99a9fb274
356 files changed
+28877
-1055
No files matched your search
@@ -2,6 +2,7 @@
|
||||
* 语言包出口。
|
||||
*
|
||||
* 组件不得硬编码中文文案,一律从 locale 取,便于整站切换 / 定制。
|
||||
* 新增文案时同步补 enUS,保持两个语言包结构一致。
|
||||
*/
|
||||
export interface Locale {
|
||||
name: string
|
||||
@@ -9,15 +10,170 @@ export interface Locale {
|
||||
empty: {
|
||||
description: string
|
||||
}
|
||||
[key: string]: unknown
|
||||
/** 跨组件通用文案。 */
|
||||
common: {
|
||||
/** 确认(Modal / 日期面板等) */
|
||||
confirm: string
|
||||
cancel: string
|
||||
clear: string
|
||||
close: string
|
||||
loading: string
|
||||
/** 选择类组件的占位文案 */
|
||||
selectPlaceholder: string
|
||||
/** 输入类组件的占位文案 */
|
||||
inputPlaceholder: string
|
||||
/** 搜索框占位文案 */
|
||||
searchPlaceholder: string
|
||||
/** 无匹配结果 */
|
||||
noMatch: string
|
||||
}
|
||||
/** 分页文案,`{total}` / `{page}` 为占位符。 */
|
||||
pagination: {
|
||||
total: string
|
||||
prev: string
|
||||
next: string
|
||||
page: string
|
||||
pageSize: string
|
||||
goto: string
|
||||
}
|
||||
/** 日期类组件文案,`{year}` / `{month}` 为占位符。 */
|
||||
date: {
|
||||
placeholder: string
|
||||
startPlaceholder: string
|
||||
endPlaceholder: string
|
||||
today: string
|
||||
now: string
|
||||
year: string
|
||||
month: string
|
||||
weekdays: string[]
|
||||
months: string[]
|
||||
}
|
||||
/**
|
||||
* 表单校验文案,`{label}` / `{len}` / `{min}` / `{max}` 为占位符;
|
||||
* label 为空时会连同其后空白一起移除。
|
||||
*/
|
||||
form: {
|
||||
required: string
|
||||
type: string
|
||||
pattern: string
|
||||
len: string
|
||||
min: string
|
||||
max: string
|
||||
invalid: string
|
||||
}
|
||||
}
|
||||
|
||||
export const zhCN: Locale = {
|
||||
name: 'zh-CN',
|
||||
empty: { description: '暂无数据' },
|
||||
common: {
|
||||
confirm: '确定',
|
||||
cancel: '取消',
|
||||
clear: '清空',
|
||||
close: '关闭',
|
||||
loading: '加载中',
|
||||
selectPlaceholder: '请选择',
|
||||
inputPlaceholder: '请输入',
|
||||
searchPlaceholder: '搜索',
|
||||
noMatch: '无匹配数据',
|
||||
},
|
||||
pagination: {
|
||||
total: '共 {total} 条',
|
||||
prev: '上一页',
|
||||
next: '下一页',
|
||||
page: '页',
|
||||
pageSize: '条/页',
|
||||
goto: '前往',
|
||||
},
|
||||
date: {
|
||||
placeholder: '请选择日期',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
today: '今天',
|
||||
now: '此刻',
|
||||
year: '{year} 年',
|
||||
month: '{month} 月',
|
||||
// 与日历矩阵一致:周日开头
|
||||
weekdays: ['日', '一', '二', '三', '四', '五', '六'],
|
||||
months: [
|
||||
'1 月',
|
||||
'2 月',
|
||||
'3 月',
|
||||
'4 月',
|
||||
'5 月',
|
||||
'6 月',
|
||||
'7 月',
|
||||
'8 月',
|
||||
'9 月',
|
||||
'10 月',
|
||||
'11 月',
|
||||
'12 月',
|
||||
],
|
||||
},
|
||||
form: {
|
||||
required: '{label}不能为空',
|
||||
type: '{label}格式不正确',
|
||||
pattern: '{label}格式不正确',
|
||||
len: '{label}长度必须为 {len}',
|
||||
min: '{label}长度不能少于 {min}',
|
||||
max: '{label}长度不能超过 {max}',
|
||||
invalid: '{label}校验未通过',
|
||||
},
|
||||
}
|
||||
|
||||
export const enUS: Locale = {
|
||||
name: 'en-US',
|
||||
empty: { description: 'No data' },
|
||||
common: {
|
||||
confirm: 'OK',
|
||||
cancel: 'Cancel',
|
||||
clear: 'Clear',
|
||||
close: 'Close',
|
||||
loading: 'Loading',
|
||||
selectPlaceholder: 'Please select',
|
||||
inputPlaceholder: 'Please input',
|
||||
searchPlaceholder: 'Search',
|
||||
noMatch: 'No matching data',
|
||||
},
|
||||
pagination: {
|
||||
total: 'Total {total}',
|
||||
prev: 'Previous',
|
||||
next: 'Next',
|
||||
page: 'Page',
|
||||
pageSize: '/ page',
|
||||
goto: 'Go to',
|
||||
},
|
||||
date: {
|
||||
placeholder: 'Select date',
|
||||
startPlaceholder: 'Start date',
|
||||
endPlaceholder: 'End date',
|
||||
today: 'Today',
|
||||
now: 'Now',
|
||||
year: '{year}',
|
||||
month: '{month}',
|
||||
weekdays: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
|
||||
months: [
|
||||
'Jan',
|
||||
'Feb',
|
||||
'Mar',
|
||||
'Apr',
|
||||
'May',
|
||||
'Jun',
|
||||
'Jul',
|
||||
'Aug',
|
||||
'Sep',
|
||||
'Oct',
|
||||
'Nov',
|
||||
'Dec',
|
||||
],
|
||||
},
|
||||
form: {
|
||||
required: '{label} is required',
|
||||
type: '{label} format is invalid',
|
||||
pattern: '{label} format is invalid',
|
||||
len: '{label} length must be {len}',
|
||||
min: '{label} length must be at least {min}',
|
||||
max: '{label} length must be at most {max}',
|
||||
invalid: '{label} failed validation',
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user