docs(i18n): 更新文档 (#2831)
Some checks failed
Issue Close Require / issue-close-require (push) Has been cancelled

* docs: 更新文档

* update

* docs(i18n): 优化文档细节

* docs(i18n): 微调说明

---------

Co-authored-by: 贤心 <3277200+sentsim@users.noreply.github.com>
This commit is contained in:
morning-star
2025-09-15 16:44:39 +08:00
committed by GitHub
parent 21a25629dd
commit 9b66ff7e39
3 changed files with 179 additions and 181 deletions

View File

@@ -434,7 +434,7 @@ highlightLine: {
333
```
highlightLine 选项的详细用法可参考:<a href="https://stackblitz.com/edit/iw6hx7mi?file=index.html" rel="nofollow" target="_blank">highlightLine 行高亮在线示例</a>
highlightLine 选项的详细用法可参考:<a href="https://github.com/layui/layui/blob/main/examples/code.html" rel="nofollow" target="_blank">highlightLine 行高亮在线示例</a>
</td>
</tr>

View File

@@ -1,9 +1,7 @@
<pre class="layui-code" lay-options="{style: 'height: 525px;', layout: ['code'], tools: []}">
<textarea>
i18n.set({
locale: 'zh-CN', // 设置语言环境
messages: { // 语言包
'zh-CN': { // 简体中文语言包(内置)
// 简体中文语言包(内置)
var zhCN = {
code: {
copy: '复制代码',
copied: '已复制',
@@ -176,7 +174,11 @@ i18n.set({
}
}
}
}
};
i18n.set({
locale: 'zh-CN', // 设置语言环境
messages: { // 语言包
'zh-CN': zhCN
}
});
</textarea>

View File

@@ -103,12 +103,8 @@ i18n.set({
});
```
为了节省时间,可以借助「**第三方提供并维护**的 Layui 多语言 AI 翻译工具」直接生成不同语言的消息文本,如:
| 翻译工具 | 提供者 |
| --- | --- |
| <a href="https://gitee.com/mail_osc/translate/tree/master/extend/layui-i18n-object-translate" target="_blank">https://gitee.com/mail_osc/translate/tree/master/extend/layui-i18n-object-translate</a> | <a href="https://github.com/xnx3" target="_blank">@xnx3</a> |
对消息文本进行翻译时,为了节省时间,可以使用 AI 直接生成不同语言的消息文本,或者使用第三方提供的 Layui 多语言 AI 翻译工具(如:<a href="https://gitee.com/mail_osc/translate/tree/master/extend/layui-i18n-object-translate" target="_blank">https://gitee.com/mail_osc/translate/tree/master/extend/layui-i18n-object-translate</a> By <a href="https://github.com/xnx3" target="_blank">@xnx3</a>)。
## 💖 心语
i18n 模块是在众多开发者强烈的需求呼声中,由 Layui 核心 Contributor [@Sight-wcg](https://github.com/Sight-wcg) 完成,该模块通过简练的设计,为 Layui 组件实现了多语言的无缝接入并且兼容了一些原本自带简单多语言或消息配置的组件Layui 2.x 版本也因此具备国际化能力
i18n 模块是在众多开发者的广泛需求背景下完成开发,它通过简练的设计,为 Layui 组件实现了多语言的无缝接入,并且兼容了一些原本自带简单多语言或消息配置的组件,从而使 Layui 2 系列版本全面支持国际化。