mirror of
https://github.com/SomboChea/ui
synced 2024-11-24 06:54:27 +07:00
feat: added zh-CN translations to the UI (#448)
This commit is contained in:
parent
6552f4c13f
commit
03114a842b
@ -5,6 +5,7 @@ import translationEN from './translations/en-US.json';
|
|||||||
import translationPT from './translations/pt-BR.json';
|
import translationPT from './translations/pt-BR.json';
|
||||||
import translationES from './translations/es-ES.json';
|
import translationES from './translations/es-ES.json';
|
||||||
import translationDE from './translations/de-DE.json';
|
import translationDE from './translations/de-DE.json';
|
||||||
|
import translationCN from './translations/zh-CN.json';
|
||||||
|
|
||||||
i18n
|
i18n
|
||||||
// pass the i18n instance to react-i18next.
|
// pass the i18n instance to react-i18next.
|
||||||
@ -15,7 +16,7 @@ i18n
|
|||||||
// in case window.VEDACCIO_LANGUAGE is undefined,it will fall back to 'en-US'
|
// in case window.VEDACCIO_LANGUAGE is undefined,it will fall back to 'en-US'
|
||||||
lng: window?.__VERDACCIO_BASENAME_UI_OPTIONS?.language,
|
lng: window?.__VERDACCIO_BASENAME_UI_OPTIONS?.language,
|
||||||
fallbackLng: 'en-US',
|
fallbackLng: 'en-US',
|
||||||
whitelist: ['en-US', 'pt-BR', 'es-ES', 'de-DE'],
|
whitelist: ['en-US', 'pt-BR', 'es-ES', 'de-DE', 'zh-CN'],
|
||||||
load: 'currentOnly',
|
load: 'currentOnly',
|
||||||
resources: {
|
resources: {
|
||||||
'en-US': {
|
'en-US': {
|
||||||
@ -30,6 +31,9 @@ i18n
|
|||||||
'de-DE': {
|
'de-DE': {
|
||||||
translation: translationDE,
|
translation: translationDE,
|
||||||
},
|
},
|
||||||
|
'zh-CN': {
|
||||||
|
translation: translationCN,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
debug: false,
|
debug: false,
|
||||||
interpolation: {
|
interpolation: {
|
||||||
|
138
i18n/translations/zh-CN.json
Normal file
138
i18n/translations/zh-CN.json
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
{
|
||||||
|
"copy-to-clipboard": "复制到粘贴板",
|
||||||
|
"author-anonymous": "匿名",
|
||||||
|
"action-bar-action": {
|
||||||
|
"visit-home-page": "访问主页",
|
||||||
|
"open-an-issue": "提交问题",
|
||||||
|
"download-tarball": "下载 tarball"
|
||||||
|
},
|
||||||
|
"dialog": {
|
||||||
|
"registry-info": {
|
||||||
|
"title": "注册信息"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"header": {
|
||||||
|
"documentation": "文档",
|
||||||
|
"registry-info": "登记信息",
|
||||||
|
"greetings": "您好 "
|
||||||
|
},
|
||||||
|
"search": {
|
||||||
|
"packages": "查找Packages"
|
||||||
|
},
|
||||||
|
"auto-complete": {
|
||||||
|
"loading": "加载中...",
|
||||||
|
"no-results-found": "没有找到结果"
|
||||||
|
},
|
||||||
|
"tab": {
|
||||||
|
"uplinks": "Uplinks",
|
||||||
|
"versions": "版本",
|
||||||
|
"dependencies": "依赖",
|
||||||
|
"readme": "Readme"
|
||||||
|
},
|
||||||
|
"uplinks": {
|
||||||
|
"title": "Uplinks",
|
||||||
|
"no-items": "{{name}} has no uplinks."
|
||||||
|
},
|
||||||
|
"versions": {
|
||||||
|
"current-tags": "当前标签",
|
||||||
|
"version-history": "历史版本",
|
||||||
|
"not-available": "不可用"
|
||||||
|
},
|
||||||
|
"package": {
|
||||||
|
"published-on": "发表于 {{time}} •",
|
||||||
|
"version": "v{{version}}",
|
||||||
|
"visit-home-page": "访问主页",
|
||||||
|
"homepage": "主页",
|
||||||
|
"open-an-issue": "提交问题",
|
||||||
|
"bugs": "Bugs",
|
||||||
|
"download": "下载 {{what}}",
|
||||||
|
"the-tar-file": "tar 文件",
|
||||||
|
"tarball": "Tarball"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"has-no-dependencies": "{{package}} 没有依赖包.",
|
||||||
|
"dependency-block": "{{package}}@{{version}}"
|
||||||
|
},
|
||||||
|
"form": {
|
||||||
|
"username": "用户名",
|
||||||
|
"password": "密码"
|
||||||
|
},
|
||||||
|
"form-placeholder": {
|
||||||
|
"username": "您的用户名",
|
||||||
|
"password": "您的密码"
|
||||||
|
},
|
||||||
|
"form-validation": {
|
||||||
|
"required-field": "必填项",
|
||||||
|
"required-min-length": "长度不能小于{{length}}",
|
||||||
|
"unable-to-sign-in": "登录失败",
|
||||||
|
"username-or-password-cant-be-empty": "用户名或密码不能为空!"
|
||||||
|
},
|
||||||
|
"help": {
|
||||||
|
"title": "还没有发布任何NPM包.",
|
||||||
|
"sub-title": "发布第一个NPM包:",
|
||||||
|
"first-step": "1. 登录",
|
||||||
|
"first-step-command-line": "npm adduser --registry {{registryUrl}}",
|
||||||
|
"second-step": "2. 发布",
|
||||||
|
"second-step-command-line": "npm publish --registry {{registryUrl}}",
|
||||||
|
"third-step": "3. 刷新当前页面."
|
||||||
|
},
|
||||||
|
"sidebar": {
|
||||||
|
"detail": {
|
||||||
|
"latest-version": "最新版本 v{{version}}",
|
||||||
|
"version": "v{{version}}"
|
||||||
|
},
|
||||||
|
"installation": {
|
||||||
|
"title": "安装",
|
||||||
|
"install-using-yarn": "使用yarn安装",
|
||||||
|
"install-using-yarn-command": "yarn add {{packageName}}",
|
||||||
|
"install-using-npm": "使用npm安装",
|
||||||
|
"install-using-npm-command": "npm install {{packageName}}",
|
||||||
|
"install-using-pnpm": "使用pnpm安装",
|
||||||
|
"install-using-pnpm-command": "pnpm install {{packageName}}"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"title": "库"
|
||||||
|
},
|
||||||
|
"author": {
|
||||||
|
"title": "作者"
|
||||||
|
},
|
||||||
|
"distribution": {
|
||||||
|
"title": "最后发布",
|
||||||
|
"license": "License",
|
||||||
|
"size": "大小",
|
||||||
|
"file-count": "文件数量"
|
||||||
|
},
|
||||||
|
"maintainers": {
|
||||||
|
"title": "维护人"
|
||||||
|
},
|
||||||
|
"contributors": {
|
||||||
|
"title": "贡献者"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"npm-version": "NPM Version",
|
||||||
|
"node-js": "NODE JS"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"footer": {
|
||||||
|
"powered-by": "Powered by",
|
||||||
|
"made-with-love-on": "Made with <0>♥</0> on"
|
||||||
|
},
|
||||||
|
"button": {
|
||||||
|
"close": "关闭",
|
||||||
|
"cancel": "取消",
|
||||||
|
"login": "登录",
|
||||||
|
"logout": "注销",
|
||||||
|
"go-to-the-home-page": "跳转到主页",
|
||||||
|
"learn-more": "了解更多",
|
||||||
|
"fund-this-package": "<0>Fund</0> this package"
|
||||||
|
},
|
||||||
|
"error": {
|
||||||
|
"unspecific": "发生错误.",
|
||||||
|
"404": {
|
||||||
|
"page-not-found": "404 - 页面不存在",
|
||||||
|
"sorry-we-could-not-find-it": "对不起, 我们没找到..."
|
||||||
|
},
|
||||||
|
"app-context-not-correct-used": "The app context was not correct used",
|
||||||
|
"package-meta-is-required-at-detail-context": "packageMeta is required at DetailContext"
|
||||||
|
}
|
||||||
|
}
|
@ -44,6 +44,12 @@ function loadDayJSLocale() {
|
|||||||
dayjs.locale('es');
|
dayjs.locale('es');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'zh-cn':
|
||||||
|
{
|
||||||
|
require('dayjs/locale/zh-cn');
|
||||||
|
dayjs.locale('zh-cn');
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user