-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin): add i18n support, zh-cn and en-us now
- Loading branch information
Showing
13 changed files
with
256 additions
and
86 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
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,28 @@ | ||
import i18n from 'i18next'; | ||
import LanguageDetector from 'i18next-browser-languagedetector'; | ||
import { initReactI18next } from 'react-i18next'; | ||
|
||
import langs from './locales'; | ||
|
||
|
||
i18n | ||
.use(LanguageDetector) | ||
.use(initReactI18next) | ||
.init({ | ||
// we init with resources | ||
resources: langs, | ||
fallbackLng: "zh-CN", | ||
debug: true, | ||
|
||
// have a common namespace used around the full app | ||
ns: ["translations"], | ||
defaultNS: "translations", | ||
|
||
keySeparator: false, // we use content as keys | ||
|
||
interpolation: { | ||
escapeValue: false | ||
} | ||
}); | ||
|
||
export default i18n; |
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,58 @@ | ||
{ | ||
"management": "Management", | ||
"comment": "Comment", | ||
"login": "Login", | ||
"logout": "Logout", | ||
"register": "Register", | ||
"email": "Email", | ||
"password": "Password", | ||
"remember me": "Remember me", | ||
"back to home": "Back to Home", | ||
"please input email": "Please input email!", | ||
"please input password": "Please input password!", | ||
"email or password error": "Email or Password error!", | ||
"nickname": "Nickname", | ||
"website": "Personal Website", | ||
"password again": "Password Again", | ||
"register.login": "Login", | ||
"nickname illegal": "Nickname Illegal!", | ||
"passwords don't match": "Passwords don't match", | ||
"register error! try again later": "Register error! Try again later!", | ||
"setting": "Setting", | ||
"profile": "Profile", | ||
"go to gravatar to change avatar": "Go to Gravatar to change avatar", | ||
"homepage": "Homepage", | ||
"homepage tips": "Current users' homepage. It must be start with <1>http:\/\/<\/1> or <1>https:\/\/<\/1>.", | ||
"update my profile": "Update my profile", | ||
"connect to social account": "Connect to Social Account", | ||
"change password": "Change Password", | ||
"update password": "Update password", | ||
"password tips": "It's recommended to use a mixed style of special characters, letters and numbers to increase system security.", | ||
"password again tips": "Please confirm your password, consistent with the password entered above.", | ||
"nickname and homepage are required": "Both nickname and personal homepage are required fields.", | ||
"all": "All", | ||
"mine": "Mine", | ||
"approved": "Approved", | ||
"approved button": "Approved", | ||
"waiting": "Waiting", | ||
"spam": "Spam", | ||
"mark as spam": "Mark as Spam", | ||
"edit": "Edit", | ||
"reply": "Reply", | ||
"delete": "Delete", | ||
"delete one confirm": "Are you sure you want to delete {{nick}}'s comment?", | ||
"delete multiple confirm": "Are you sure you want to delete these comments?", | ||
"manage comments": "Manage Comments", | ||
"select all": "Select All", | ||
"action": "Action", | ||
"selected items": "Selected Action", | ||
"please input keywords": "Please input keywords", | ||
"filter": "Filter", | ||
"author": "Author", | ||
"content": "Content", | ||
"username": "Username", | ||
"submit": "Submit", | ||
"cancel": "Cancel", | ||
"at": "At", | ||
"get userinfo failed": "Get userinfo failed!" | ||
} |
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,12 @@ | ||
import en from './en.json'; | ||
import zhCN from './zh-CN.json'; | ||
|
||
export default { | ||
"zh-cn": { translations: zhCN }, | ||
"zh-CN": { translations: zhCN }, | ||
"en": { translations: en }, | ||
"en-US": { translations: en }, | ||
"zh-TW": { translations: en }, | ||
"jp": { translations: en }, | ||
"jp-JP": { translations: en } | ||
}; |
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,58 @@ | ||
{ | ||
"management": "管理", | ||
"comment": "评论", | ||
"login": "登录", | ||
"logout": "登出", | ||
"register": "用户注册", | ||
"email": "邮箱", | ||
"password": "密码", | ||
"remember me": "下次自动登录", | ||
"back to home": "返回首页", | ||
"please input email": "请输入邮箱", | ||
"please input password": "请输入密码", | ||
"email or password error": "账号密码错误", | ||
"nickname": "昵称", | ||
"website": "个人网站", | ||
"password again": "再次输入密码", | ||
"register.login": "用户登录", | ||
"nickname illegal": "请输入正确的昵称", | ||
"passwords don't match": "两次密码不一致", | ||
"register error! try again later": "注册失败,请稍后再试!", | ||
"setting": "个人设置", | ||
"profile": "个人资料", | ||
"go to gravatar to change avatar": "在 Gravatar 上修改头像", | ||
"homepage": "个人主页地址", | ||
"homepage tips": "此用户的个人主页地址, 请用 <1>http:\/\/</1> 或 <1>https:\/\/</1> 开头.", | ||
"update my profile": "更新我的档案", | ||
"connect to social account": "账号绑定", | ||
"change password": "密码修改", | ||
"update password": "更新密码", | ||
"password tips": "为此用户分配一个密码.<br />建议使用特殊字符与字母、数字的混编样式,以增加系统安全性.", | ||
"password again tips": "请确认你的密码, 与上面输入的密码保持一致.", | ||
"nickname and homepage are required": "昵称和个人主页都是必填字段", | ||
"all": "所有", | ||
"mine": "我的", | ||
"approved": "已通过", | ||
"approved button": "通过", | ||
"waiting": "待审核", | ||
"spam": "垃圾", | ||
"mark as spam": "标记垃圾", | ||
"edit": "编辑", | ||
"reply": "回复", | ||
"delete": "删除", | ||
"delete one confirm": "你确认要删除{{nick}}的评论吗?", | ||
"delete multiple confirm": "你确认要删除这些评论吗?", | ||
"manage comments": "管理评论", | ||
"select all": "全选", | ||
"action": "操作", | ||
"selected items": "选中项", | ||
"please input keywords": "请输入关键字", | ||
"filter": "筛选", | ||
"author": "作者", | ||
"content": "内容", | ||
"username": "用户名", | ||
"submit": "提交", | ||
"cancel": "取消", | ||
"at": "于", | ||
"get userinfo failed": "获取用户信息失败" | ||
} |
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
Oops, something went wrong.