Files
layui/examples/i18n/en.js
morning-star d96ad79960
Some checks failed
Issue Close Require / issue-close-require (push) Has been cancelled
feat(i18n): 国际化支持 (#2698)
* wip(i18n): laydate 国际化

* wip(i18n): colorpicker 国际化

* wip(i18n): laypage 国际化

* fix

* update code

* wip(i18n): 修改国际化消息对象结构

* wip(i18n): update

* wip(i18n): code 国际化

* wip(i18n): dropdown 国际化

* wip(i18n): flow 国际化

* wip(i18n): form 国际化

* wip(i18n): layer 国际化

* wip(i18n): table 国际化

* wip(i18n): transfer 国际化

* wip(i18n): tree 国际化

* wip(i18n): treeTable 控制台提示统一为英文

* wip(i18n): upload 国际化

* wip(i18n): util 国际化

* wip(i18n): update code

* wip(i18n): update code

* wip(i18n): fix

* wip(i18n): 优化 $t 代码细节

* wip(i18n): 修复 laydate lang

* wip(i18n): 改进 upload i18n key

* wip(i18n): 修复打包后 laydate 和 layer 异常

* wip(i18n): 移除国际化消息中的 `lay` 命名空间

* refactor(i18n): 改进国际化支持

* wip(i18n): 修复 table text.none 切换 locale 无效问题

* style(laydate): 优化逗号格式

* chore(laydate): 优化部分提示

* chore(i18n): 优化演示中部分国际化消息

* refactor: 剔除 laydate 单独版的判断逻辑

为接下来全面支持国际化做铺垫

* wip(i18n): 为 laydate 重新添加完整国际化的支持

* i18n(laydate): 优化 lang() 方法中的逻辑

* chore(util): 删除未使用的代码

* chore(i18n): 优化注释

* docs(i18n): 新增国际化文档(beta)

note: 由于时间关系,本次提交仅为初版,该文档尚未完成

* wip(docs): 完善 i18n 文档

* fix(i18n): 修复 laypage 变量定义前使用

* wip(i18n): 转义翻译结果

* fix(i18n): 修复 table 排序 key 无效

* wip(i18n): 优化获取对象中指定路径值的性能

* wip(i18n): 删除 $t 可变长参数重载

* chore(i18n): 删除不必要的注释

* refactor(i18n): laydate 国际化方案迁移至 i18n.$t (#2745)

* wip(i18n): 改进 laydate i18nMsg key

* update code

* wip(i18n): 改进 laydate 面板中的日期格式处理

* wip(i18n): 改进 util.toDateString meridiem

遵循 CLDR day periods 标准

* update code

* wip(docs): 优化 i18n 文档示例

* docs(i18n): 优化正式文档

* docs(i18n): 优化部分文案

* docs(i18n): 优化示例

---------

Co-authored-by: 贤心 <3277200+sentsim@users.noreply.github.com>
2025-09-08 10:31:02 +08:00

167 lines
4.1 KiB
JavaScript

/**
* English (en)
*/
// Common English internationalization message object
export default {
code: {
copy: 'Copy Code',
copied: 'Copied',
copyError: 'Copy Failed',
maximize: 'Maximize',
restore: 'Restore',
preview: 'Preview in New Window'
},
colorpicker: {
clear: 'Clear',
confirm: 'OK'
},
dropdown: {
noData: 'No Data'
},
flow: {
loadMore: 'Load More',
noMore: 'No More Data'
},
form: {
select: {
noData: 'No Data',
noMatch: 'No Matching Data',
placeholder: 'Please Select'
},
validateMessages: {
required: 'This field is required',
phone: 'Invalid phone number format',
email: 'Invalid email format',
url: 'Invalid URL format',
number: 'Numbers only',
date: 'Invalid date format',
identity: 'Invalid ID number format'
},
verifyErrorPromptTitle: 'Notice'
},
laydate: {
months: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
weeks: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
time: ['Hour', 'Minute', 'Second'],
literal: {
year: ''
},
selectDate: 'Select Date',
selectTime: 'Select Time',
startTime: 'Start Time',
endTime: 'End Time',
tools: {
confirm: 'Confirm',
clear: 'Clear',
now: 'Now',
reset: 'Reset'
},
rangeOrderPrompt: 'End time cannot be less than start Time\nPlease re-select',
invalidDatePrompt: 'Invalid date\n',
formatErrorPrompt: 'Date format is invalid\nMust follow the format:\n{format}\n',
autoResetPrompt: 'It has been reset',
preview: 'The selected result'
},
layer: {
confirm: 'OK',
cancel: 'Cancel',
defaultTitle: 'Info',
prompt: {
InputLengthPrompt: 'Maximum {length} characters'
},
photos: {
noData: 'No Image',
tools: {
rotate: 'Rotate',
scaleX: 'Flip Horizontally',
zoomIn: 'Zoom In',
zoomOut: 'Zoom Out',
reset: 'Reset',
close: 'Close'
},
viewPicture: 'View Original',
urlError: {
prompt: 'Image URL is invalid, \nContinue to next one?',
confirm: 'Next',
cancel: 'Cancel'
}
}
},
laypage: {
prev: 'Prev',
next: 'Next',
first: 'First',
last: 'Last',
total: 'Total {total} items',
pagesize: 'items/page',
goto: 'Go to',
page: 'page',
confirm: 'Confirm'
},
table: {
sort: {
asc: 'Ascending',
desc: 'Descending'
},
noData: 'No Data',
tools: {
filter: {
title: 'Filter Columns'
},
export: {
title: 'Export',
noDataPrompt: 'No data in the table',
compatPrompt: 'Export is not supported in IE. Please use Chrome or another modern browser.',
csvText: 'Export CSV File'
},
print: {
title: 'Print',
noDataPrompt: 'No data in the table'
}
},
dataFormatError: 'Returned data is invalid. The correct success status code should be: "{statusName}": {statusCode}',
xhrError: 'Request Error: {msg}'
},
transfer: {
noData: 'No Data',
noMatch: 'No Match',
title: ['List One', 'List Two'],
searchPlaceholder: 'Search by Keyword'
},
tree: {
defaultNodeName: 'Unnamed',
noData: 'No Data',
deleteNodePrompt: 'Are you sure you want to delete the node "{name}"?'
},
upload: {
fileType: {
file: 'File',
image: 'Image',
video: 'Video',
audio: 'Audio'
},
validateMessages: {
fileExtensionError: 'Unsupported format in selected {fileType}',
filesOverLengthLimit: 'Maximum {length} files allowed at once',
currentFilesLength: 'You have selected {length} files',
fileOverSizeLimit: 'File size must not exceed {size}'
},
chooseText: '{length} files'
},
util: {
timeAgo: {
days: '{days} days ago',
hours: '{hours} hours ago',
minutes: '{minutes} minutes ago',
future: 'In the future',
justNow: 'Just now'
},
toDateString: {
meridiem: function (hours, minutes) {
return hours < 12 ? 'AM' : 'PM';
}
}
}
};