Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ i18n基础框架 * 🚧 i18n基础结构&使用yaml作为i18n语言文件格式 * 🌐 国际化初版 #188 * 🌐 English i18n * 💚 修复i18n文件错误导致的构建失败 * 🐛 修复i18n的一些问题
- Loading branch information
Showing
40 changed files
with
1,666 additions
and
658 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,5 @@ | |
|
||
(function() { | ||
'use strict'; | ||
|
||
// Your code here... | ||
})(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# i18n 方案 | ||
|
||
i18n 使用[i8next](https://www.i18next.com/)实现,之所以不是用`chrome.i18n`的原因是该方案不支持动态切换语言。但是为了某些扩展市场的要求,我们还是在`build/assets/_locales`目录下添加了`chrome.i18n`的语言文件。 | ||
|
||
## 语言文件 | ||
|
||
语言文件位于`src/locales`目录下,按照页面划分,每个页面对应一个语言文件,最终由`index.ts`合并进行导出。 | ||
|
||
## 关键字冲突 | ||
|
||
如果页面中的关键字一样,但是翻译不一样,可以使用`page.key`的方式进行区分,例如: | ||
|
||
```yaml | ||
list: | ||
confirm_delete: 确定要删除吗?请注意这个操作无法恢复! | ||
``` |
Oops, something went wrong.