Skip to content

Commit

Permalink
国际化支持
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangkaili committed Jan 8, 2021
1 parent cc3de2e commit 371c73e
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ build
node_modules/*
server/scripts
.env
.log
*.log
npm-debug.log
stats.json
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions shared/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const initI18n = () => {

export const languageOptions = [
{ label: "English (US)", value: "en_US" },
{ label: "简体中文 (Chinese)", value: "zh_CN" },
{ label: "Deutsch (Deutschland)", value: "de_DE" },
{ label: "Español (España)", value: "es_ES" },
{ label: "Français (France)", value: "fr_FR" },
Expand Down
2 changes: 2 additions & 0 deletions shared/i18n/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import i18n from "i18next";
import de_DE from "./locales/de_DE/translation.json";
import en_US from "./locales/en_US/translation.json";
import pt_PT from "./locales/pt_PT/translation.json";
import zh_CN from "./locales/zh_CN/translation.json";
import { initI18n } from ".";

describe("i18n process.env is unset", () => {
beforeEach(() => {
delete process.env.DEFAULT_LANGUAGE;
initI18n()
.addResources("en_US", "translation", en_US)
.addResources("zh_CN", "translation", zh_CN)
.addResources("de_DE", "translation", de_DE)
.addResources("pt_PT", "translation", pt_PT);
});
Expand Down
204 changes: 107 additions & 97 deletions shared/i18n/locales/zh_CN/translation.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"currently editing": "正在编辑",
"currently viewing": "目前查看",
"currently editing": "正在编辑",
"currently viewing": "正在浏览",
"viewed {{ timeAgo }} ago": "{{ timeAgo }} 前浏览",
"You": "",
"Trash": "回收站",
"Archive": "归档",
"Drafts": "草稿",
"Templates": "文档模板",
"Deleted Collection": "删除文档集",
"New": "",
"Only visible to you": "只对您可见",
"Draft": "草稿",
"Template": "模板",
"New doc": "新文档",
"deleted": "已删除",
"archived": "已归档",
"created": "已创建",
Expand All @@ -17,11 +22,6 @@
"Never viewed": "未被浏览",
"Viewed": "已浏览",
"in": "",
"New": "",
"Only visible to you": "只对您可见",
"Draft": "草稿",
"Template": "模板",
"New doc": "新文档",
"More options": "更多选项",
"Insert column after": "向后插入列",
"Insert column before": "向前插入列",
Expand All @@ -43,7 +43,7 @@
"Delete table": "删除表格",
"Italic": "斜体",
"Sorry, that link won’t work for this embed type": "抱歉,该链接不适用于此嵌入类型",
"Find or create a doc": "Find or create a doc",
"Find or create a doc": "查找或创建文档",
"Big heading": "主标题",
"Medium heading": "次标题",
"Small heading": "小标题",
Expand All @@ -56,17 +56,17 @@
"Link": "链接",
"Link copied to clipboard": "链接已经复制到剪贴板",
"Highlight": "高亮",
"Type '/' to insert": "Type '/' to insert",
"Keep typing to filter": "Keep typing to filter",
"Type '/' to insert": "输入/以插入",
"Keep typing to filter": "继续输入以过滤",
"No results": "没有找到结果",
"Open link": "打开链接",
"Ordered list": "有序列表",
"Paste a link": "Paste a link",
"Paste a link": "粘贴链接",
"Paste a {{service}} link…": "粘贴 {{service}} 链接…",
"Placeholder": "占位符",
"Quote": "引用",
"Remove link": "移除链接",
"Search or paste a link": "Search or paste a link",
"Search or paste a link": "搜索或粘贴链接",
"Strikethrough": "删除线",
"Bold": "加粗",
"Subheading": "副标题",
Expand All @@ -76,15 +76,15 @@
"Warning": "警告",
"Warning notice": "警告信息",
"Icon": "图标",
"Loading": "Loading",
"Loading": "加载中",
"Search": "搜索",
"Outline is available in your language {{optionLabel}}, would you like to change?": "Outline 当前支持 {{optionLabel}},您想要更改吗?",
"Change Language": "更改界面语言",
"Dismiss": "忽略",
"Keyboard shortcuts": "快捷键",
"Expand": "Expand",
"Collapse": "Collapse",
"New collection": "New collection",
"Expand": "展开",
"Collapse": "折叠",
"New collection": "新建文档集",
"Collections": "文档集",
"Untitled": "无标题文档",
"Home": "主页",
Expand All @@ -100,59 +100,62 @@
"Security": "安全性",
"People": "用户",
"Groups": "用户组",
"Share Links": "Share Links",
"Export Data": "Export Data",
"Integrations": "Integrations",
"Installation": "Installation",
"Settings": "Settings",
"Share Links": "已共享链接",
"Export Data": "导出数据",
"Integrations": "集成",
"Installation": "安装",
"Settings": "设置",
"API documentation": "API 文档",
"Changelog": "更新日志",
"Send us feedback": "发送反馈",
"Report a bug": "Report a bug",
"Report a bug": "反馈 Bug",
"Appearance": "界面外观",
"System": "系统信息",
"Light": "Light",
"Dark": "Dark",
"Light": "浅色主题",
"Dark": "深色主题",
"Log out": "退出登录",
"Collection permissions": "文档集权限",
"New document": "新建文档",
"Import document": "导入文档",
"Edit": "编辑",
"Permissions": "Permissions",
"Export": "Export",
"Delete": "Delete",
"Permissions": "权限",
"Export": "导出",
"Delete": "删除",
"Edit collection": "编辑文档集",
"Delete collection": "删除文档集",
"Export collection": "导出文档集",
"Document duplicated": "Document duplicated",
"Sort in sidebar": "调整侧边栏的显示顺序",
"Alphabetical sort": "按字母顺序排序",
"Manual sort": "手动排序",
"Document duplicated": "文档已复制",
"Document archived": "文件已封存",
"Document restored": "文档已恢复",
"Document unpublished": "Document unpublished",
"Document unpublished": "未发布的文档",
"Restore": "恢复",
"Choose a collection": "选择一个文档集",
"Unpin": "取消置顶",
"Pin to collection": "置顶文档集",
"Unstar": "取消星标",
"Star": "加星标",
"Share link": "Share link",
"Share link": "共享链接",
"Enable embeds": "启用嵌入",
"Disable embeds": "禁用嵌入",
"New nested document": "新的嵌套文档",
"Create template": "创建模板",
"Duplicate": "复制项目",
"Unpublish": "取消发布",
"Move": "Move",
"Move": "移动",
"History": "历史记录",
"Download": "下载",
"Print": "打印",
"Delete {{ documentName }}": "删除 {{ documentName }}",
"Share document": "共享文档",
"Edit group": "编辑群组",
"Delete group": "刪除群組",
"Members": "Members",
"Members": "成员",
"collection": "文档集",
"New document in <1>{{collectionName}}</1>": "New document in <1>{{collectionName}}</1>",
"New template": "New template",
"New document in <1>{{collectionName}}</1>": "<1>{{collectionName}}</1>中创建新文档",
"New template": "新建模板",
"Link copied": "链接已复制",
"Restore version": "恢复此版本",
"Copy link": "复制链接",
Expand All @@ -166,70 +169,77 @@
"Are you sure you want to suspend this account? Suspended users will be prevented from logging in.": "您确定要冻结此帐户吗?被冻结的用户将无法登录。",
"Make {{ userName }} a member…": "将 {{ userName }} 设为成员…",
"Make {{ userName }} an admin…": "将 {{ userName }} 设为管理员…",
"Revoke invite": "Revoke invite",
"Revoke invite": "撤消邀请",
"Activate account": "激活帐号",
"Suspend account": "Suspend account",
"Suspend account": "冻结账号",
"Documents": "文档",
"The document archive is empty at the moment.": "目前没有被归档的文档",
"Search in collection": "Search in collection",
"Search in collection": "在文档集中搜索",
"<0>{{collectionName}}</0> doesn’t contain any documents yet.": "<0>{{collectionName}}</0>目前还没有任何文档",
"Get started by creating a new one!": "从创建一个新文档集开始!",
"Create a document": "创建文档",
"Manage members": "Manage members",
"Manage members": "管理成员",
"Pinned": "已置顶",
"Recently updated": "最近更新",
"Recently published": "最近发布",
"Least recently updated": "最旧未更新",
"A–Z": "字母序",
"The collection was updated": "文档集已更新",
"You can edit the name and other details at any time, however doing so often might confuse your team mates.": "You can edit the name and other details at any time, however doing so often might confuse your team mates.",
"Name": "Name",
"Description": "Description",
"You can edit the name and other details at any time, however doing so often might confuse your team mates.": "您可以随时编辑姓名和其他详细信息,但是经常这样做可能会使您的队友感到困惑。",
"Name": "名称",
"Description": "说明",
"More details about this collection…": "有关此文档集的更多详细信息…",
"Alphabetical": "按字母顺序排列",
"Private collection": "私密文档集",
"A private collection will only be visible to invited team members.": "私密文档集仅对受邀团队成员可见。",
"Saving": "Saving",
"Save": "Save",
"Saving": "保存中",
"Save": "保存",
"{{ groupName }} was added to the collection": "{{ groupName }} 已添加到文档集",
"Could not add user": "Could not add user",
"Can’t find the group you’re looking for?": "Can’t find the group you’re looking for?",
"Create a group": "Create a group",
"Search by group name": "Search by group name",
"Search groups": "Search groups",
"No groups matching your search": "No groups matching your search",
"No groups left to add": "No groups left to add",
"Add": "Add",
"Could not add user": "无法添加用户",
"Can’t find the group you’re looking for?": "找不到您正在寻找的组?",
"Create a group": "创建组",
"Search by group name": "按组名搜索",
"Search groups": "搜索分组",
"No groups matching your search": "没有符合您搜索的组",
"No groups left to add": "没有可添加的组",
"Add": "添加",
"{{ userName }} was added to the collection": "{{ userName }} 已添加到文档集",
"Need to add someone who’s not yet on the team yet?": "Need to add someone who’s not yet on the team yet?",
"Invite people to {{ teamName }}": "Invite people to {{ teamName }}",
"Search by name": "Search by name",
"Search people": "Search people",
"No people matching your search": "No people matching your search",
"No people left to add": "No people left to add",
"Read only": "Read only",
"Read & Edit": "Read & Edit",
"Remove": "Remove",
"Active <1></1> ago": "Active <1></1> ago",
"Never signed in": "Never signed in",
"Invited": "Invited",
"Admin": "Admin",
"Need to add someone who’s not yet on the team yet?": "需要添加还没有帐号的人?",
"Invite people to {{ teamName }}": "邀请他们使用 {{ teamName }}",
"Search by name": "按名称搜索",
"Search people": "搜索用户",
"No people matching your search": "没有符合搜索条件的用户",
"No people left to add": "没有人可以添加",
"Read only": "只读",
"Read & Edit": "阅读和编辑",
"Remove": "移除",
"Active <1></1> ago": "<1></1>前活跃",
"Never signed in": "从未登录",
"Invited": "已获邀",
"Admin": "管理员",
"Collections are for grouping your knowledge base. They work best when organized around a topic or internal team — Product or Engineering for example.": "文档集用于对文档进行分组。建议使用文档集管理同一主题或固定团队(比如产品团队或工程师团队)的文档。",
"Creating": "Creating",
"Create": "Create",
"Recently viewed": "Recently viewed",
"Created by me": "Created by me",
"Hide contents": "Hide contents",
"Show contents": "Show contents",
"Archived": "Archived",
"Anyone with the link <1></1>can view this document": "Anyone with the link <1></1>can view this document",
"Share": "Share",
"Save Draft": "Save Draft",
"Done Editing": "Done Editing",
"Edit {{noun}}": "Edit {{noun}}",
"New from template": "New from template",
"Creating": "正在创建",
"Create": "创建",
"Recently viewed": "最近浏览",
"Created by me": "由我创建",
"Hide contents": "隐藏目录",
"Show contents": "显示目录",
"Archived": "已归档",
"Anyone with the link <1></1>can view this document": "拥有此链接的任何人<1></1>都能查看此内容",
"Share": "共享",
"Save Draft": "存为草稿",
"Done Editing": "编辑完成",
"Edit {{noun}}": "编辑 {{noun}}",
"New from template": "从模板新建",
"Publish": "发布",
"Publish document": "发布文档",
"Publishing": "Publishing",
"Publishing": "发布中",
"Are you sure you want to delete the <2>{{documentTitle}}</2> template?": "您确定要删除<2>{{documentTitle}}</2> 模板吗?",
"Are you sure about that? Deleting the <2>{{documentTitle}}</2> document will delete all of its history and any nested documents.": "您确定要删除吗?删除<2>{{documentTitle}}</2>文档将删除其所有历史记录以及所有的嵌套文件。",
"If you’d like the option of referencing or restoring the {{noun}} in the future, consider archiving it instead.": "如果您将来希望引用或还原{{noun}},请考虑将其存档。",
"Deleting": "正在删除",
"I’m sure – Delete": "我确定–删除",
"Archiving": "正在归档",
"No documents found for your filters.": "没有找到相关文档。",
"You’ve not got any drafts at the moment.": "您目前还没有任何草稿。",
"Not found": "没有找到",
Expand All @@ -243,7 +253,7 @@
"Invite them to {{teamName}}": "邀请他们加入 {{teamName}}",
"{{userName}} was removed from the group": "从群组中移除 {{userName}}。",
"Could not remove user": "无法删除用户",
"Add people": "Add people",
"Add people": "添加人员",
"This group has no members.": "这个群组没有任何成员",
"Outline is designed to be fast and easy to use. All of your usual keyboard shortcuts work here, and there’s Markdown too.": "Outline 旨在快速且易于使用。您常用的键盘快捷键都可使用,还支持 Markdown 语法。",
"Navigation": "导航",
Expand All @@ -253,6 +263,7 @@
"Jump to search": "跳转到搜索",
"Jump to dashboard": "跳转到仪表板",
"Table of contents": "目录",
"Toggle sidebar": "切换侧边栏",
"Open this guide": "打开本指南",
"Editor": "编辑器",
"Save and exit document edit mode": "保存并退出文档编辑模式",
Expand All @@ -278,22 +289,21 @@
"Profile saved": "配置文件已保存",
"Profile picture updated": "个人图片已更新",
"Unable to upload new profile picture": "不能上传个人资料照片",
"Photo": "Photo",
"Upload": "Upload",
"Full name": "Full name",
"Language": "Language",
"Please note that translations are currently in early access.<1></1>Community contributions are accepted though our <4>translation portal</4>": "Please note that translations are currently in early access.<1></1>Community contributions are accepted though our <4>translation portal</4>",
"Delete Account": "Delete Account",
"You may delete your account at any time, note that this is unrecoverable": "You may delete your account at any time, note that this is unrecoverable",
"Delete account": "Delete account",
"Alphabetical": "Alphabetical",
"You’ve not starred any documents yet.": "You’ve not starred any documents yet.",
"There are no templates just yet. You can create templates to help your team create consistent and accurate documentation.": "There are no templates just yet. You can create templates to help your team create consistent and accurate documentation.",
"Trash is empty at the moment.": "Trash is empty at the moment.",
"You joined": "You joined",
"Joined": "Joined",
"{{ time }} ago.": "{{ time }} ago.",
"Suspended": "Suspended",
"Edit Profile": "Edit Profile",
"{{ userName }} hasn’t updated any documents yet.": "{{ userName }} hasn’t updated any documents yet."
"Photo": "图片",
"Upload": "上传",
"Full name": "全名",
"Language": "语言",
"Please note that translations are currently in early access.<1></1>Community contributions are accepted though our <4>translation portal</4>": "请注意,目前翻译是抢先版本。<1></1>我们通过<4>翻译门户网站</4>接受社区贡献",
"Delete Account": "删除帐户",
"You may delete your account at any time, note that this is unrecoverable": "您可以随时删除您的帐户,请注意,这是无法恢复的",
"Delete account": "删除账户",
"You’ve not starred any documents yet.": "您尚未标记文档。",
"There are no templates just yet. You can create templates to help your team create consistent and accurate documentation.": "目前还没有模板。您可以创建模板来帮助您的团队创建风格一致和准确的文档。",
"Trash is empty at the moment.": "回收站目前是空的。",
"You joined": "您已加入",
"Joined": "已加入",
"{{ time }} ago.": "{{ time }} 之前。",
"Suspended": "已冻结",
"Edit Profile": "编辑个人资料",
"{{ userName }} hasn’t updated any documents yet.": "{{ userName }} 尚未更新任何文档。"
}

0 comments on commit 371c73e

Please sign in to comment.