From decb8cdff975ddbcebc9f2e1d8065dff3a4d5103 Mon Sep 17 00:00:00 2001 From: chenhe Date: Thu, 5 Nov 2020 17:17:50 +0800 Subject: [PATCH 1/4] Add Chinese support --- frontend/i18n/index.js | 10 ++++-- frontend/i18n/zh/generic.js | 20 ++++++++++++ frontend/i18n/zh/header.js | 3 ++ frontend/i18n/zh/home.js | 18 ++++++++++ frontend/i18n/zh/index.js | 35 ++++++++++++++++++++ frontend/i18n/zh/projects/annotation.js | 14 ++++++++ frontend/i18n/zh/projects/dataset.js | 19 +++++++++++ frontend/i18n/zh/projects/errors.js | 5 +++ frontend/i18n/zh/projects/guideline.js | 4 +++ frontend/i18n/zh/projects/home.js | 11 +++++++ frontend/i18n/zh/projects/labels.js | 17 ++++++++++ frontend/i18n/zh/projects/members.js | 16 +++++++++ frontend/i18n/zh/projects/overview.js | 19 +++++++++++ frontend/i18n/zh/projects/statistics.js | 9 +++++ frontend/i18n/zh/rules.js | 38 ++++++++++++++++++++++ frontend/i18n/zh/toastui.js | 3 ++ frontend/i18n/zh/user.js | 6 ++++ frontend/i18n/zh/vuetify.js | 4 +++ frontend/i18n/zh/zh/generic.js | 20 ++++++++++++ frontend/i18n/zh/zh/header.js | 3 ++ frontend/i18n/zh/zh/home.js | 18 ++++++++++ frontend/i18n/zh/zh/index.js | 35 ++++++++++++++++++++ frontend/i18n/zh/zh/projects/annotation.js | 14 ++++++++ frontend/i18n/zh/zh/projects/dataset.js | 19 +++++++++++ frontend/i18n/zh/zh/projects/errors.js | 5 +++ frontend/i18n/zh/zh/projects/guideline.js | 4 +++ frontend/i18n/zh/zh/projects/home.js | 11 +++++++ frontend/i18n/zh/zh/projects/labels.js | 17 ++++++++++ frontend/i18n/zh/zh/projects/members.js | 16 +++++++++ frontend/i18n/zh/zh/projects/overview.js | 19 +++++++++++ frontend/i18n/zh/zh/projects/statistics.js | 9 +++++ frontend/i18n/zh/zh/rules.js | 38 ++++++++++++++++++++++ frontend/i18n/zh/zh/toastui.js | 3 ++ frontend/i18n/zh/zh/user.js | 6 ++++ frontend/i18n/zh/zh/vuetify.js | 4 +++ frontend/nuxt.config.js | 2 +- frontend/static/js/all.js | 5 +++ 37 files changed, 496 insertions(+), 3 deletions(-) create mode 100644 frontend/i18n/zh/generic.js create mode 100644 frontend/i18n/zh/header.js create mode 100644 frontend/i18n/zh/home.js create mode 100644 frontend/i18n/zh/index.js create mode 100644 frontend/i18n/zh/projects/annotation.js create mode 100644 frontend/i18n/zh/projects/dataset.js create mode 100644 frontend/i18n/zh/projects/errors.js create mode 100644 frontend/i18n/zh/projects/guideline.js create mode 100644 frontend/i18n/zh/projects/home.js create mode 100644 frontend/i18n/zh/projects/labels.js create mode 100644 frontend/i18n/zh/projects/members.js create mode 100644 frontend/i18n/zh/projects/overview.js create mode 100644 frontend/i18n/zh/projects/statistics.js create mode 100644 frontend/i18n/zh/rules.js create mode 100644 frontend/i18n/zh/toastui.js create mode 100644 frontend/i18n/zh/user.js create mode 100644 frontend/i18n/zh/vuetify.js create mode 100644 frontend/i18n/zh/zh/generic.js create mode 100644 frontend/i18n/zh/zh/header.js create mode 100644 frontend/i18n/zh/zh/home.js create mode 100644 frontend/i18n/zh/zh/index.js create mode 100644 frontend/i18n/zh/zh/projects/annotation.js create mode 100644 frontend/i18n/zh/zh/projects/dataset.js create mode 100644 frontend/i18n/zh/zh/projects/errors.js create mode 100644 frontend/i18n/zh/zh/projects/guideline.js create mode 100644 frontend/i18n/zh/zh/projects/home.js create mode 100644 frontend/i18n/zh/zh/projects/labels.js create mode 100644 frontend/i18n/zh/zh/projects/members.js create mode 100644 frontend/i18n/zh/zh/projects/overview.js create mode 100644 frontend/i18n/zh/zh/projects/statistics.js create mode 100644 frontend/i18n/zh/zh/rules.js create mode 100644 frontend/i18n/zh/zh/toastui.js create mode 100644 frontend/i18n/zh/zh/user.js create mode 100644 frontend/i18n/zh/zh/vuetify.js create mode 100644 frontend/static/js/all.js diff --git a/frontend/i18n/index.js b/frontend/i18n/index.js index a25b8e40..85923be2 100644 --- a/frontend/i18n/index.js +++ b/frontend/i18n/index.js @@ -6,6 +6,12 @@ export default { iso: 'en-CA', file: 'en' }, + { + name: '中文', + code: 'zh', + iso: 'zh-CA', + file: 'zh' + }, { name: 'Français', code: 'fr', @@ -15,9 +21,9 @@ export default { ], lazy: true, langDir: 'i18n/', - defaultLocale: 'en', + defaultLocale: 'zh', vueI18n: { - fallbackLocale: 'en' + fallbackLocale: 'zh' }, detectBrowserLanguage: { useCookie: true, diff --git a/frontend/i18n/zh/generic.js b/frontend/i18n/zh/generic.js new file mode 100644 index 00000000..e8fbd5ad --- /dev/null +++ b/frontend/i18n/zh/generic.js @@ -0,0 +1,20 @@ +export default { + continue: '继续', + yes: '是', + all: '全部', + save: '保存', + edit: '编辑', + create: '创建', + cancel: '取消', + close: '关闭', + upload: '上传', + add: '增加', + delete: '删除', + search: '搜索', + name: '名称', + import: '导入', + export: '导出', + description: '描述', + type: '类型', + loading: '加载中... 请等待' +} diff --git a/frontend/i18n/zh/header.js b/frontend/i18n/zh/header.js new file mode 100644 index 00000000..9f50d6ab --- /dev/null +++ b/frontend/i18n/zh/header.js @@ -0,0 +1,3 @@ +export default { + projects: '项目' +} diff --git a/frontend/i18n/zh/home.js b/frontend/i18n/zh/home.js new file mode 100644 index 00000000..7124e357 --- /dev/null +++ b/frontend/i18n/zh/home.js @@ -0,0 +1,18 @@ +export default { + mainTitle: '文本标注平台', + getStarted: '快速开始', + startAnnotation: '开始标注', + featuresTitle: '最大特色', + featuresTitle1: '团队合作', + featuresText1: '与你的团队标注', + featuresTitle2: '任何语言', + featuresText2: '用任何语言标注', + featuresTitle3: '免费开源', + featuresText3: '免费可自定义', + footerTitle: '尽快实现你的想法', + demoDropDown: '试一试', + demoNER: '命名实体识别', + demoSent: '情感分析', + demoTranslation: '文本翻译', + demoTextToSQL: '语义解析Text-to-SQL' +} diff --git a/frontend/i18n/zh/index.js b/frontend/i18n/zh/index.js new file mode 100644 index 00000000..0f1ae8e6 --- /dev/null +++ b/frontend/i18n/zh/index.js @@ -0,0 +1,35 @@ +import home from './home' +import header from './header' +import generic from './generic' +import rules from './rules' +import toastui from './toastui' +import user from './user' +import vuetify from './vuetify' +import annotation from './projects/annotation' +import dataset from './projects/dataset' +import errors from './projects/errors' +import guideline from './projects/guideline' +import projectHome from './projects/home' +import labels from './projects/labels' +import members from './projects/members' +import overview from './projects/overview' +import statistics from './projects/statistics' + +export default { + home, + header, + generic, + rules, + toastui, + user, + vuetify, + annotation, + dataset, + errors, + guideline, + projectHome, + labels, + members, + overview, + statistics +} diff --git a/frontend/i18n/zh/projects/annotation.js b/frontend/i18n/zh/projects/annotation.js new file mode 100644 index 00000000..dd142a54 --- /dev/null +++ b/frontend/i18n/zh/projects/annotation.js @@ -0,0 +1,14 @@ +export default { + checkedTooltip: '已选', + notCheckedTooltip: '未选', + selectFilterTooltip: '过滤', + filterOption1: '全部', + filterOption2: '已标注', + filterOption3: '未标注', + guidelineTooltip: '显示指南', + guidelinePopupTitle: '标注指南', + metadataDefaultMessage: '没有数据可获得', + key: '键', + value: '值', + newText: '下一条' +} diff --git a/frontend/i18n/zh/projects/dataset.js b/frontend/i18n/zh/projects/dataset.js new file mode 100644 index 00000000..f3046a89 --- /dev/null +++ b/frontend/i18n/zh/projects/dataset.js @@ -0,0 +1,19 @@ +export default { + dataset: '数据集', + actions: '操作', + importDataset: '导入数据集', + exportDataset: '导出数据集', + text: '文本', + metadata: '元数据', + action: '操作', + annotate: '标注', + importDataTitle: '上传数据', + importDataMessage1: '选择文件格式', + importDataMessage2: '选择一个文件', + importDataPlaceholder: '请导入文件', + exportDataTitle: '导出数据', + exportDataMessage: '请选择文件格式', + deleteDocumentsTitle: '删除文档', + deleteDocumentsMessage: '你确定要从这个项目中删除这些文档吗?', + pageText: '{0}-{1} of {2}' +} diff --git a/frontend/i18n/zh/projects/errors.js b/frontend/i18n/zh/projects/errors.js new file mode 100644 index 00000000..933160e3 --- /dev/null +++ b/frontend/i18n/zh/projects/errors.js @@ -0,0 +1,5 @@ +export default { + fileCannotUpload: '这个文件不能被上传,获取格式错误,请仔细检查文件格式', + labelCannotCreate: '这个标签不能被创建,你可能在其它的键上用了相同的标签名', + invalidUserOrPass: '用户名或者密码不正确' +} diff --git a/frontend/i18n/zh/projects/guideline.js b/frontend/i18n/zh/projects/guideline.js new file mode 100644 index 00000000..dedb79b6 --- /dev/null +++ b/frontend/i18n/zh/projects/guideline.js @@ -0,0 +1,4 @@ +export default { + guideline: '指南', + writeGuidelinePrompt: '请写入标注指南' +} diff --git a/frontend/i18n/zh/projects/home.js b/frontend/i18n/zh/projects/home.js new file mode 100644 index 00000000..63d9faf4 --- /dev/null +++ b/frontend/i18n/zh/projects/home.js @@ -0,0 +1,11 @@ +export default { + home: '主页', + welcome: '欢迎进入数据标注平台', + importData: '导入数据集', + createLabels: '为这个项目创建标签名', + addMembers: '添加成员', + defineGuideline: '定义指南', + annotateDataset: '标注数据集', + viewStatistics: '查看统计', + exportDataset: '导出数据集' +} diff --git a/frontend/i18n/zh/projects/labels.js b/frontend/i18n/zh/projects/labels.js new file mode 100644 index 00000000..3a7d5320 --- /dev/null +++ b/frontend/i18n/zh/projects/labels.js @@ -0,0 +1,17 @@ +export default { + labels: '标签', + shortkey: '短键', + color: '颜色', + createLabel: '创建标签', + importLabels: '创建标签', + exportLabels: '导出标签', + labelName: '标签名', + labelMessage: '请输入标签名', + key: '键', + deleteLabel: '删除标签', + deleteMessage: '你确定要从这个项目中删除这些标签吗', + importTitle: '导入标签', + importMessage1: '样例格式', + importMessage2: '请选择一个文件', + filePlaceholder: '输入文件' +} diff --git a/frontend/i18n/zh/projects/members.js b/frontend/i18n/zh/projects/members.js new file mode 100644 index 00000000..2ce9a525 --- /dev/null +++ b/frontend/i18n/zh/projects/members.js @@ -0,0 +1,16 @@ +export default { + members: '成员', + role: '角色', + updateRole: '更行角色', + addMember: '添加成员', + userSearchAPIs: '用户搜索接口', + userSearchPrompt: '开始搜索', + removeMember: '移除成员', + removePrompt: '你确定要移除当前成员吗?', + roles: { + projectAdmin: '项目管理员', + annotator: '标注员', + annotationApprover: '审查员', + undefined: '角色未定义' + } +} diff --git a/frontend/i18n/zh/projects/overview.js b/frontend/i18n/zh/projects/overview.js new file mode 100644 index 00000000..5a74b10b --- /dev/null +++ b/frontend/i18n/zh/projects/overview.js @@ -0,0 +1,19 @@ +export default { + createProjectTitle: '添加项目', + projectName: '项目名称', + projectType: '项目类型', + textClassification: '文本分类', + sequenceLabeling: '序列标注', + sequenceToSequence: '序列到序列', + randomizeDocOrder: '随机文档顺序', + shareAnnotations: '在所有用户共享标注', + delete: '删除', + deleteProjectTitle: '删除项目', + deleteProjectMessage: '你确定要删除这些项目吗?', + search: '搜索', + projectTypes: [ + '文本分类', + '序列标注', + '序列到序列' + ] +} diff --git a/frontend/i18n/zh/projects/statistics.js b/frontend/i18n/zh/projects/statistics.js new file mode 100644 index 00000000..602c70ce --- /dev/null +++ b/frontend/i18n/zh/projects/statistics.js @@ -0,0 +1,9 @@ +export default { + statistics: '统计', + progress: [ + '已完成', + '未完成' + ], + labelStats: '标签统计', + userStats: '用户统计' +} diff --git a/frontend/i18n/zh/rules.js b/frontend/i18n/zh/rules.js new file mode 100644 index 00000000..23914714 --- /dev/null +++ b/frontend/i18n/zh/rules.js @@ -0,0 +1,38 @@ +export default { + colorRules: { + colorRequired: '请输入颜色' + }, + labelNameRules: { + labelRequired: '请输入名称', + labelLessThan30Chars: '名称必须少于30个字符' + }, + userNameRules: { + userNameRequired: '请输入用户名', + userNameLessThan30Chars: '用户名必须少于30个字符' + }, + roleRules: { + roleRequired: '请输入角色' + }, + projectNameRules: { + projectNameRequired: '请输入项目名称', + projectNameLessThan30Chars: '项目名称必须少于30个字符' + }, + descriptionRules: { + descriptionRequired: '请输入描述', + descriptionLessThan30Chars: '描述必须少于100个字符' + }, + projectTypeRules: { + projectTypeRequired: '请输入项目类型' + }, + fileFormatRules: { + fileFormatRequired: '请输入文件类型' + }, + uploadFileRules: { + fileRequired: '请输入文件', + fileLessThan1MB: '文件大小必须小于 1 MB!' + }, + passwordRules: { + passwordRequired: '请输入密码', + passwordLessThan30Chars: '密码必须小于30个字符' + } +} diff --git a/frontend/i18n/zh/toastui.js b/frontend/i18n/zh/toastui.js new file mode 100644 index 00000000..7d8afa93 --- /dev/null +++ b/frontend/i18n/zh/toastui.js @@ -0,0 +1,3 @@ +export default { + localeCode: 'zh_CN' +} diff --git a/frontend/i18n/zh/user.js b/frontend/i18n/zh/user.js new file mode 100644 index 00000000..d1b571ca --- /dev/null +++ b/frontend/i18n/zh/user.js @@ -0,0 +1,6 @@ +export default { + login: '登录', + signOut: '注销', + username: '用户名', + password: '密码' +} diff --git a/frontend/i18n/zh/vuetify.js b/frontend/i18n/zh/vuetify.js new file mode 100644 index 00000000..8f6d2420 --- /dev/null +++ b/frontend/i18n/zh/vuetify.js @@ -0,0 +1,4 @@ +export default { + itemsPerPageText: '每页最多可显示', + noDataAvailable: '没有数据可获得' +} diff --git a/frontend/i18n/zh/zh/generic.js b/frontend/i18n/zh/zh/generic.js new file mode 100644 index 00000000..e8fbd5ad --- /dev/null +++ b/frontend/i18n/zh/zh/generic.js @@ -0,0 +1,20 @@ +export default { + continue: '继续', + yes: '是', + all: '全部', + save: '保存', + edit: '编辑', + create: '创建', + cancel: '取消', + close: '关闭', + upload: '上传', + add: '增加', + delete: '删除', + search: '搜索', + name: '名称', + import: '导入', + export: '导出', + description: '描述', + type: '类型', + loading: '加载中... 请等待' +} diff --git a/frontend/i18n/zh/zh/header.js b/frontend/i18n/zh/zh/header.js new file mode 100644 index 00000000..9f50d6ab --- /dev/null +++ b/frontend/i18n/zh/zh/header.js @@ -0,0 +1,3 @@ +export default { + projects: '项目' +} diff --git a/frontend/i18n/zh/zh/home.js b/frontend/i18n/zh/zh/home.js new file mode 100644 index 00000000..a08eb781 --- /dev/null +++ b/frontend/i18n/zh/zh/home.js @@ -0,0 +1,18 @@ +export default { + mainTitle: '让文本标注服务人类', + getStarted: '快速开始', + startAnnotation: '开始标注', + featuresTitle: '功能特性', + featuresTitle1: '团队合作', + featuresText1: '与你的团队标注', + featuresTitle2: '任何语言', + featuresText2: '用任何语言标注', + featuresTitle3: '免费开源', + featuresText3: '标注免费可自定义', + footerTitle: '尽快实现你的想法', + demoDropDown: '试一试', + demoNER: '命名实体识别', + demoSent: '情感分析', + demoTranslation: '文本翻译', + demoTextToSQL: '语义解析Text-to-SQL' +} diff --git a/frontend/i18n/zh/zh/index.js b/frontend/i18n/zh/zh/index.js new file mode 100644 index 00000000..0f1ae8e6 --- /dev/null +++ b/frontend/i18n/zh/zh/index.js @@ -0,0 +1,35 @@ +import home from './home' +import header from './header' +import generic from './generic' +import rules from './rules' +import toastui from './toastui' +import user from './user' +import vuetify from './vuetify' +import annotation from './projects/annotation' +import dataset from './projects/dataset' +import errors from './projects/errors' +import guideline from './projects/guideline' +import projectHome from './projects/home' +import labels from './projects/labels' +import members from './projects/members' +import overview from './projects/overview' +import statistics from './projects/statistics' + +export default { + home, + header, + generic, + rules, + toastui, + user, + vuetify, + annotation, + dataset, + errors, + guideline, + projectHome, + labels, + members, + overview, + statistics +} diff --git a/frontend/i18n/zh/zh/projects/annotation.js b/frontend/i18n/zh/zh/projects/annotation.js new file mode 100644 index 00000000..dd142a54 --- /dev/null +++ b/frontend/i18n/zh/zh/projects/annotation.js @@ -0,0 +1,14 @@ +export default { + checkedTooltip: '已选', + notCheckedTooltip: '未选', + selectFilterTooltip: '过滤', + filterOption1: '全部', + filterOption2: '已标注', + filterOption3: '未标注', + guidelineTooltip: '显示指南', + guidelinePopupTitle: '标注指南', + metadataDefaultMessage: '没有数据可获得', + key: '键', + value: '值', + newText: '下一条' +} diff --git a/frontend/i18n/zh/zh/projects/dataset.js b/frontend/i18n/zh/zh/projects/dataset.js new file mode 100644 index 00000000..f3046a89 --- /dev/null +++ b/frontend/i18n/zh/zh/projects/dataset.js @@ -0,0 +1,19 @@ +export default { + dataset: '数据集', + actions: '操作', + importDataset: '导入数据集', + exportDataset: '导出数据集', + text: '文本', + metadata: '元数据', + action: '操作', + annotate: '标注', + importDataTitle: '上传数据', + importDataMessage1: '选择文件格式', + importDataMessage2: '选择一个文件', + importDataPlaceholder: '请导入文件', + exportDataTitle: '导出数据', + exportDataMessage: '请选择文件格式', + deleteDocumentsTitle: '删除文档', + deleteDocumentsMessage: '你确定要从这个项目中删除这些文档吗?', + pageText: '{0}-{1} of {2}' +} diff --git a/frontend/i18n/zh/zh/projects/errors.js b/frontend/i18n/zh/zh/projects/errors.js new file mode 100644 index 00000000..933160e3 --- /dev/null +++ b/frontend/i18n/zh/zh/projects/errors.js @@ -0,0 +1,5 @@ +export default { + fileCannotUpload: '这个文件不能被上传,获取格式错误,请仔细检查文件格式', + labelCannotCreate: '这个标签不能被创建,你可能在其它的键上用了相同的标签名', + invalidUserOrPass: '用户名或者密码不正确' +} diff --git a/frontend/i18n/zh/zh/projects/guideline.js b/frontend/i18n/zh/zh/projects/guideline.js new file mode 100644 index 00000000..dedb79b6 --- /dev/null +++ b/frontend/i18n/zh/zh/projects/guideline.js @@ -0,0 +1,4 @@ +export default { + guideline: '指南', + writeGuidelinePrompt: '请写入标注指南' +} diff --git a/frontend/i18n/zh/zh/projects/home.js b/frontend/i18n/zh/zh/projects/home.js new file mode 100644 index 00000000..63d9faf4 --- /dev/null +++ b/frontend/i18n/zh/zh/projects/home.js @@ -0,0 +1,11 @@ +export default { + home: '主页', + welcome: '欢迎进入数据标注平台', + importData: '导入数据集', + createLabels: '为这个项目创建标签名', + addMembers: '添加成员', + defineGuideline: '定义指南', + annotateDataset: '标注数据集', + viewStatistics: '查看统计', + exportDataset: '导出数据集' +} diff --git a/frontend/i18n/zh/zh/projects/labels.js b/frontend/i18n/zh/zh/projects/labels.js new file mode 100644 index 00000000..341b72e0 --- /dev/null +++ b/frontend/i18n/zh/zh/projects/labels.js @@ -0,0 +1,17 @@ +export default { + labels: '标签', + shortkey: '键', + color: '颜色', + createLabel: '创建标签', + importLabels: '创建标签', + exportLabels: '导出标签', + labelName: '标签名', + labelMessage: '请输入标签名', + key: 'Key', + deleteLabel: '删除标签', + deleteMessage: '你确定要从这个项目中删除这些标签吗', + importTitle: '导入标签', + importMessage1: '样例格式', + importMessage2: '请选择一个文件', + filePlaceholder: '输入文件' +} diff --git a/frontend/i18n/zh/zh/projects/members.js b/frontend/i18n/zh/zh/projects/members.js new file mode 100644 index 00000000..2ce9a525 --- /dev/null +++ b/frontend/i18n/zh/zh/projects/members.js @@ -0,0 +1,16 @@ +export default { + members: '成员', + role: '角色', + updateRole: '更行角色', + addMember: '添加成员', + userSearchAPIs: '用户搜索接口', + userSearchPrompt: '开始搜索', + removeMember: '移除成员', + removePrompt: '你确定要移除当前成员吗?', + roles: { + projectAdmin: '项目管理员', + annotator: '标注员', + annotationApprover: '审查员', + undefined: '角色未定义' + } +} diff --git a/frontend/i18n/zh/zh/projects/overview.js b/frontend/i18n/zh/zh/projects/overview.js new file mode 100644 index 00000000..5a74b10b --- /dev/null +++ b/frontend/i18n/zh/zh/projects/overview.js @@ -0,0 +1,19 @@ +export default { + createProjectTitle: '添加项目', + projectName: '项目名称', + projectType: '项目类型', + textClassification: '文本分类', + sequenceLabeling: '序列标注', + sequenceToSequence: '序列到序列', + randomizeDocOrder: '随机文档顺序', + shareAnnotations: '在所有用户共享标注', + delete: '删除', + deleteProjectTitle: '删除项目', + deleteProjectMessage: '你确定要删除这些项目吗?', + search: '搜索', + projectTypes: [ + '文本分类', + '序列标注', + '序列到序列' + ] +} diff --git a/frontend/i18n/zh/zh/projects/statistics.js b/frontend/i18n/zh/zh/projects/statistics.js new file mode 100644 index 00000000..602c70ce --- /dev/null +++ b/frontend/i18n/zh/zh/projects/statistics.js @@ -0,0 +1,9 @@ +export default { + statistics: '统计', + progress: [ + '已完成', + '未完成' + ], + labelStats: '标签统计', + userStats: '用户统计' +} diff --git a/frontend/i18n/zh/zh/rules.js b/frontend/i18n/zh/zh/rules.js new file mode 100644 index 00000000..23914714 --- /dev/null +++ b/frontend/i18n/zh/zh/rules.js @@ -0,0 +1,38 @@ +export default { + colorRules: { + colorRequired: '请输入颜色' + }, + labelNameRules: { + labelRequired: '请输入名称', + labelLessThan30Chars: '名称必须少于30个字符' + }, + userNameRules: { + userNameRequired: '请输入用户名', + userNameLessThan30Chars: '用户名必须少于30个字符' + }, + roleRules: { + roleRequired: '请输入角色' + }, + projectNameRules: { + projectNameRequired: '请输入项目名称', + projectNameLessThan30Chars: '项目名称必须少于30个字符' + }, + descriptionRules: { + descriptionRequired: '请输入描述', + descriptionLessThan30Chars: '描述必须少于100个字符' + }, + projectTypeRules: { + projectTypeRequired: '请输入项目类型' + }, + fileFormatRules: { + fileFormatRequired: '请输入文件类型' + }, + uploadFileRules: { + fileRequired: '请输入文件', + fileLessThan1MB: '文件大小必须小于 1 MB!' + }, + passwordRules: { + passwordRequired: '请输入密码', + passwordLessThan30Chars: '密码必须小于30个字符' + } +} diff --git a/frontend/i18n/zh/zh/toastui.js b/frontend/i18n/zh/zh/toastui.js new file mode 100644 index 00000000..7d8afa93 --- /dev/null +++ b/frontend/i18n/zh/zh/toastui.js @@ -0,0 +1,3 @@ +export default { + localeCode: 'zh_CN' +} diff --git a/frontend/i18n/zh/zh/user.js b/frontend/i18n/zh/zh/user.js new file mode 100644 index 00000000..d1b571ca --- /dev/null +++ b/frontend/i18n/zh/zh/user.js @@ -0,0 +1,6 @@ +export default { + login: '登录', + signOut: '注销', + username: '用户名', + password: '密码' +} diff --git a/frontend/i18n/zh/zh/vuetify.js b/frontend/i18n/zh/zh/vuetify.js new file mode 100644 index 00000000..8f6d2420 --- /dev/null +++ b/frontend/i18n/zh/zh/vuetify.js @@ -0,0 +1,4 @@ +export default { + itemsPerPageText: '每页最多可显示', + noDataAvailable: '没有数据可获得' +} diff --git a/frontend/nuxt.config.js b/frontend/nuxt.config.js index 6d5c4c89..b2bc2ff3 100644 --- a/frontend/nuxt.config.js +++ b/frontend/nuxt.config.js @@ -15,7 +15,7 @@ export default { { hid: 'description', name: 'description', content: process.env.npm_package_description || '' } ], script: [ - { src: 'https://use.fontawesome.com/releases/v5.0.6/js/all.js' } + { src: '/js/all.js' } ], link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }, diff --git a/frontend/static/js/all.js b/frontend/static/js/all.js new file mode 100644 index 00000000..21daa562 --- /dev/null +++ b/frontend/static/js/all.js @@ -0,0 +1,5 @@ +/*! + * Font Awesome Free 5.0.6 by @fontawesome - http://fontawesome.com + * License - http://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + */ +!function(){"use strict";var c={};try{"undefined"!=typeof window&&(c=window)}catch(c){}var l=(c.navigator||{}).userAgent,h=void 0===l?"":l,v=c,z=(~h.indexOf("MSIE")||h.indexOf("Trident/"),"___FONT_AWESOME___"),e=function(){try{return!0}catch(c){return!1}}(),a=[1,2,3,4,5,6,7,8,9,10],m=a.concat([11,12,13,14,15,16,17,18,19,20]);["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter"].concat(a.map(function(c){return c+"x"})).concat(m.map(function(c){return"w-"+c}));var t=v||{};t[z]||(t[z]={}),t[z].styles||(t[z].styles={}),t[z].hooks||(t[z].hooks={}),t[z].shims||(t[z].shims=[]);var s=t[z],r=Object.assign||function(c){for(var l=1;l1&&void 0!==arguments[1]?arguments[1]:{}).asNewDefault,h=void 0!==l&&l,v=Object.keys(O),z=h?function(c){return~v.indexOf(c)&&!~A.indexOf(c)}:function(c){return~v.indexOf(c)};Object.keys(c).forEach(function(l){z(l)&&(O[l]=c[l])})}m.FontAwesomeConfig=O;var N=m||{};N[n]||(N[n]={}),N[n].styles||(N[n].styles={}),N[n].hooks||(N[n].hooks={}),N[n].shims||(N[n].shims=[]);var E=N[n],P=[],_=!1;M&&((_=(t.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(t.readyState))||t.addEventListener("DOMContentLoaded",function c(){t.removeEventListener("DOMContentLoaded",c),_=1,P.map(function(c){return c()})}));var T=function(c){M&&(_?setTimeout(c,0):P.push(c))},F=H,I={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function R(c){if(c&&M){var l=t.createElement("style");l.setAttribute("type","text/css"),l.innerHTML=c;for(var h=t.head.childNodes,v=null,z=h.length-1;z>-1;z--){var e=h[z],a=(e.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(a)>-1&&(v=e)}return t.head.insertBefore(l,v),c}}var W=0;function B(){return++W}function D(c){for(var l=[],h=(c||[]).length>>>0;h--;)l[h]=c[h];return l}function X(c){return c.classList?D(c.classList):(c.getAttribute("class")||"").split(" ").filter(function(c){return c})}function Y(c,l){var h,v=l.split("-"),z=v[0],e=v.slice(1).join("-");return z!==c||""===e||(h=e,~g.indexOf(h))?null:e}function U(c){return(""+c).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function K(c){return Object.keys(c||{}).reduce(function(l,h){return l+(h+": ")+c[h]+";"},"")}function G(c){return c.size!==I.size||c.x!==I.x||c.y!==I.y||c.rotate!==I.rotate||c.flipX||c.flipY}function J(c){var l=c.transform,h=c.containerWidth,v=c.iconWidth;return{outer:{transform:"translate("+h/2+" 256)"},inner:{transform:"translate("+32*l.x+", "+32*l.y+") "+" "+("scale("+l.size/16*(l.flipX?-1:1)+", "+l.size/16*(l.flipY?-1:1)+") ")+" "+("rotate("+l.rotate+" 0 0)")},path:{transform:"translate("+v/2*-1+" -256)"}}}var Q={x:0,y:0,width:"100%",height:"100%"},Z=function(c){var l=c.children,h=c.attributes,v=c.main,z=c.mask,e=c.transform,a=v.width,m=v.icon,t=z.width,s=z.icon,r=J({transform:e,containerWidth:t,iconWidth:a}),f={tag:"rect",attributes:k({},Q,{fill:"white"})},M={tag:"g",attributes:k({},r.inner),children:[{tag:"path",attributes:k({},m.attributes,r.path,{fill:"black"})}]},i={tag:"g",attributes:k({},r.outer),children:[M]},n="mask-"+B(),H="clip-"+B(),o={tag:"defs",children:[{tag:"clipPath",attributes:{id:H},children:[s]},{tag:"mask",attributes:k({},Q,{id:n,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[f,i]}]};return l.push(o,{tag:"rect",attributes:k({fill:"currentColor","clip-path":"url(#"+H+")",mask:"url(#"+n+")"},Q)}),{children:l,attributes:h}},$=function(c){var l=c.children,h=c.attributes,v=c.main,z=c.transform,e=K(c.styles);if(e.length>0&&(h.style=e),G(z)){var a=J({transform:z,containerWidth:v.width,iconWidth:v.width});l.push({tag:"g",attributes:k({},a.outer),children:[{tag:"g",attributes:k({},a.inner),children:[{tag:v.icon.tag,children:v.icon.children,attributes:k({},v.icon.attributes,a.path)}]}]})}else l.push(v.icon);return{children:l,attributes:h}},cc=function(c){var l=c.children,h=c.main,v=c.mask,z=c.attributes,e=c.styles,a=c.transform;if(G(a)&&h.found&&!v.found){var m=h.width/h.height/2,t=.5;z.style=K(k({},e,{"transform-origin":m+a.x/16+"em "+(t+a.y/16)+"em"}))}return[{tag:"svg",attributes:z,children:l}]},lc=function(c){var l=c.prefix,h=c.iconName,v=c.children,z=c.attributes,e=c.symbol,a=!0===e?l+"-"+O.familyPrefix+"-"+h:e;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:k({},z,{id:a}),children:v}]}]};function hc(c){var l=c.icons,h=l.main,v=l.mask,z=c.prefix,e=c.iconName,a=c.transform,m=c.symbol,t=c.title,s=c.extra,r=c.watchable,f=void 0!==r&&r,M=v.found?v:h,i=M.width,n=M.height,H="fa-w-"+Math.ceil(i/n*16),o=[O.replacementClass,e?O.familyPrefix+"-"+e:"",H].concat(s.classes).join(" "),C={children:[],attributes:k({},s.attributes,{"data-prefix":z,"data-icon":e,class:o,role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 "+i+" "+n})};f&&(C.attributes[V]=""),t&&C.children.push({tag:"title",attributes:{id:C.attributes["aria-labelledby"]||"title-"+B()},children:[t]});var L=k({},C,{prefix:z,iconName:e,main:h,mask:v,transform:a,symbol:m,styles:s.styles}),u=v.found&&h.found?Z(L):$(L),d=u.children,p=u.attributes;return L.children=d,L.attributes=p,m?lc(L):cc(L)}function vc(c){var l=c.content,h=c.width,v=c.height,z=c.transform,e=c.title,a=c.extra,m=c.watchable,t=void 0!==m&&m,s=k({},a.attributes,e?{title:e}:{},{class:a.classes.join(" ")});t&&(s[V]="");var r,f,M,n,o,C,L,u,d,p=k({},a.styles);G(z)&&(p.transform=(f=(r={transform:z,startCentered:!0,width:h,height:v}).transform,M=r.width,n=void 0===M?H:M,o=r.height,C=void 0===o?H:o,L=r.startCentered,d="",d+=(u=void 0!==L&&L)&&i?"translate("+(f.x/F-n/2)+"em, "+(f.y/F-C/2)+"em) ":u?"translate(calc(-50% + "+f.x/F+"em), calc(-50% + "+f.y/F+"em)) ":"translate("+f.x/F+"em, "+f.y/F+"em) ",d+="scale("+f.size/F*(f.flipX?-1:1)+", "+f.size/F*(f.flipY?-1:1)+") ",d+="rotate("+f.rotate+"deg) "),p["-webkit-transform"]=p.transform);var b=K(p);b.length>0&&(s.style=b);var g=[];return g.push({tag:"span",attributes:s,children:[l]}),e&&g.push({tag:"span",attributes:{class:"sr-only"},children:[e]}),g}var zc=function(){},ec=O.measurePerformance&&r&&r.mark&&r.measure?r:{mark:zc,measure:zc},ac='FA "5.0.6"',mc=function(c){ec.mark(ac+" "+c+" ends"),ec.measure(ac+" "+c,ac+" "+c+" begins",ac+" "+c+" ends")},tc={begin:function(c){return ec.mark(ac+" "+c+" begins"),function(){return mc(c)}},end:mc},sc=function(c,l,h,v){var z,e,a,m,t,s=Object.keys(c),r=s.length,f=void 0!==v?(m=l,t=v,function(c,l,h,v){return m.call(t,c,l,h,v)}):l;for(void 0===h?(z=1,a=c[s[0]]):(z=0,a=h);z"+a.map(uc).join("")+""}var dc=function(){};function pc(c){return"string"==typeof(c.getAttribute?c.getAttribute(V):null)}var bc={replace:function(c){var l=c[0],h=c[1].map(function(c){return uc(c)}).join("\n");if(l.parentNode&&l.outerHTML)l.outerHTML=h+(O.keepOriginalSource&&"svg"!==l.tagName.toLowerCase()?"\x3c!-- "+l.outerHTML+" --\x3e":"");else if(l.parentNode){var v=document.createElement("span");l.parentNode.replaceChild(v,l),v.outerHTML=h}},nest:function(c){var l=c[0],h=c[1];if(~X(l).indexOf(O.replacementClass))return bc.replace(c);var v=new RegExp(O.familyPrefix+"-.*");delete h[0].attributes.style;var z=h[0].attributes.class.split(" ").reduce(function(c,l){return l===O.replacementClass||l.match(v)?c.toSvg.push(l):c.toNode.push(l),c},{toNode:[],toSvg:[]});h[0].attributes.class=z.toSvg.join(" ");var e=h.map(function(c){return uc(c)}).join("\n");l.setAttribute("class",z.toNode.join(" ")),l.setAttribute(V,""),l.innerHTML=e}};function gc(c,l){var h="function"==typeof l?l:dc;0===c.length?h():(m.requestAnimationFrame||function(c){return c()})(function(){var l=!0===O.autoReplaceSvg?bc.replace:bc[O.autoReplaceSvg]||bc.replace,v=tc.begin("mutate");c.map(l),v(),h()})}var yc=!1;var wc=function(c){var l=c.getAttribute("style"),h=[];return l&&(h=l.split(";").reduce(function(c,l){var h=l.split(":"),v=h[0],z=h.slice(1);return v&&z.length>0&&(c[v]=z.join(":").trim()),c},{})),h};var kc=function(c){var l,h,v,z,e=c.getAttribute("data-prefix"),a=c.getAttribute("data-icon"),m=void 0!==c.innerText?c.innerText.trim():"",t=Cc(X(c));return e&&a&&(t.prefix=e,t.iconName=a),t.prefix&&m.length>1?t.iconName=(v=t.prefix,z=c.innerText,ic[v][z]):t.prefix&&1===m.length&&(t.iconName=(l=t.prefix,h=function(c){for(var l="",h=0;h-1&&Xc(z.nextSibling),Xc(z),z=null),v&&!z){var e=h.getPropertyValue("content"),a=t.createElement("i");a.setAttribute("class",""+Wc[v[1]]),a.setAttribute(C,l),a.innerText=3===e.length?e.substr(1,1):e,":before"===l?c.insertBefore(a,c.firstChild):c.appendChild(a)}})})}(),yc=!1,l()}}function Uc(c){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(M){var h=t.documentElement.classList,v=function(c){return h.add(L+"-"+c)},z=function(c){return h.remove(L+"-"+c)},e=Object.keys(Fc),a=["."+Ic+":not(["+V+"])"].concat(e.map(function(c){return"."+c+":not(["+V+"])"})).join(", ");if(0!==a.length){var m=D(c.querySelectorAll(a));if(m.length>0){v("pending"),z("complete");var s=tc.begin("onTree"),r=m.reduce(function(c,l){try{var h=Dc(l);h&&c.push(h)}catch(c){u||c instanceof jc&&console.error(c)}return c},[]);s(),gc(r,function(){v("active"),v("complete"),z("pending"),"function"==typeof l&&l()})}}}}function Kc(c){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,h=Dc(c);h&&gc([h],l)}var Gc=function(){var c=o,l=O.familyPrefix,h=O.replacementClass,v="svg:not(:root).svg-inline--fa{overflow:visible}.svg-inline--fa{display:inline-block;font-size:inherit;height:1em;overflow:visible;vertical-align:-.125em}.svg-inline--fa.fa-lg{vertical-align:-.225em}.svg-inline--fa.fa-w-1{width:.0625em}.svg-inline--fa.fa-w-2{width:.125em}.svg-inline--fa.fa-w-3{width:.1875em}.svg-inline--fa.fa-w-4{width:.25em}.svg-inline--fa.fa-w-5{width:.3125em}.svg-inline--fa.fa-w-6{width:.375em}.svg-inline--fa.fa-w-7{width:.4375em}.svg-inline--fa.fa-w-8{width:.5em}.svg-inline--fa.fa-w-9{width:.5625em}.svg-inline--fa.fa-w-10{width:.625em}.svg-inline--fa.fa-w-11{width:.6875em}.svg-inline--fa.fa-w-12{width:.75em}.svg-inline--fa.fa-w-13{width:.8125em}.svg-inline--fa.fa-w-14{width:.875em}.svg-inline--fa.fa-w-15{width:.9375em}.svg-inline--fa.fa-w-16{width:1em}.svg-inline--fa.fa-w-17{width:1.0625em}.svg-inline--fa.fa-w-18{width:1.125em}.svg-inline--fa.fa-w-19{width:1.1875em}.svg-inline--fa.fa-w-20{width:1.25em}.svg-inline--fa.fa-pull-left{margin-right:.3em;width:auto}.svg-inline--fa.fa-pull-right{margin-left:.3em;width:auto}.svg-inline--fa.fa-border{height:1.5em}.svg-inline--fa.fa-li{width:2em}.svg-inline--fa.fa-fw{width:1.25em}.fa-layers svg.svg-inline--fa{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.fa-layers{display:inline-block;height:1em;position:relative;text-align:center;vertical-align:-.125em;width:1em}.fa-layers svg.svg-inline--fa{-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.fa-layers-text{left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter{background-color:#ff253a;border-radius:1em;color:#fff;height:1.5em;line-height:1;max-width:5em;min-width:1.5em;overflow:hidden;padding:.25em;right:0;text-overflow:ellipsis;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-bottom-right{bottom:0;right:0;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom right;transform-origin:bottom right}.fa-layers-bottom-left{bottom:0;left:0;right:auto;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom left;transform-origin:bottom left}.fa-layers-top-right{right:0;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-top-left{left:0;right:auto;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top left;transform-origin:top left}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;position:relative;width:2em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.svg-inline--fa.fa-stack-1x{height:1em;width:1em}.svg-inline--fa.fa-stack-2x{height:2em;width:2em}.fa-inverse{color:#fff}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}";if("fa"!==l||h!==c){var z=new RegExp("\\.fa\\-","g"),e=new RegExp("\\."+c,"g");v=v.replace(z,"."+l+"-").replace(e,"."+h)}return v};function Jc(c){return{found:!0,width:c[0],height:c[1],icon:{tag:"path",attributes:{fill:"currentColor",d:c.slice(4)[0]}}}}var Qc=!1;function Zc(){O.autoAddCss&&(Qc||R(Gc()),Qc=!0)}function $c(c,l){return Object.defineProperty(c,"abstract",{get:l}),Object.defineProperty(c,"html",{get:function(){return c.abstract.map(function(c){return uc(c)})}}),Object.defineProperty(c,"node",{get:function(){if(M){var l=t.createElement("div");return l.innerHTML=c.html,l.children}}}),c}function cl(c){var l=c.prefix,h=void 0===l?"fa":l,v=c.iconName;if(v)return Lc(hl.definitions,h,v)||Lc(E.styles,h,v)}var ll,hl=new(function(){function c(){y(this,c),this.definitions={}}return w(c,[{key:"add",value:function(){for(var c=this,l=arguments.length,h=Array(l),v=0;v1&&void 0!==arguments[1]?arguments[1]:{},h=l.transform,v=void 0===h?I:h,z=l.symbol,e=void 0!==z&&z,a=l.mask,m=void 0===a?null:a,t=l.title,s=void 0===t?null:t,r=l.classes,f=void 0===r?[]:r,M=l.attributes,i=void 0===M?{}:M,n=l.styles,H=void 0===n?{}:n;if(c){var o=c.prefix,V=c.iconName,C=c.icon;return $c(k({type:"icon"},c),function(){return Zc(),O.autoA11y&&(s?i["aria-labelledby"]=O.replacementClass+"-title-"+B():i["aria-hidden"]="true"),hc({icons:{main:Jc(C),mask:m?Jc(m.icon):{found:!1,width:null,height:null,icon:{}}},prefix:o,iconName:V,transform:k({},I,v),symbol:e,title:s,extra:{attributes:i,styles:H,classes:f}})})}},function(c){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},h=(c||{}).icon?c:cl(c||{}),v=l.mask;return v&&(v=(v||{}).icon?v:cl(v||{})),ll(h,k({},l,{mask:v}))}),zl={noAuto:function(){var c;j({autoReplaceSvg:c=!1,observeMutations:c})},dom:{i2svg:function(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(M){Zc();var l=c.node,h=void 0===l?t:l,v=c.callback,z=void 0===v?function(){}:v;O.searchPseudoElements&&Yc(h),Uc(h,z)}},css:Gc,insertCss:function(){R(Gc())}},library:hl,parse:{transform:function(c){return Sc(c)}},findIconDefinition:cl,icon:vl,text:function(c){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},h=l.transform,v=void 0===h?I:h,z=l.title,e=void 0===z?null:z,a=l.classes,m=void 0===a?[]:a,t=l.attributes,s=void 0===t?{}:t,r=l.styles,f=void 0===r?{}:r;return $c({type:"text",content:c},function(){return Zc(),vc({content:c,transform:k({},I,v),title:e,extra:{attributes:s,styles:f,classes:[O.familyPrefix+"-layers-text"].concat(S(m))}})})},layer:function(c){return $c({type:"layer"},function(){Zc();var l=[];return c(function(c){l=Array.isArray(c)?c.map(function(c){l=l.concat(c.abstract)}):l.concat(c.abstract)}),[{tag:"span",attributes:{class:O.familyPrefix+"-layers"},children:l}]})}},el=function(){M&&O.autoReplaceSvg&&zl.dom.i2svg({node:t})};Object.defineProperty(zl,"config",{get:function(){return O},set:function(c){j(c)}}),function(c){try{c()}catch(c){if(!u)throw c}}(function(){f&&(m.FontAwesome||(m.FontAwesome=zl),T(function(){Object.keys(E.styles).length>0&&el(),O.observeMutations&&"function"==typeof MutationObserver&&function(c){if(s){var l=c.treeCallback,h=c.nodeCallback,v=c.pseudoElementsCallback,z=new s(function(c){yc||D(c).forEach(function(c){if("childList"===c.type&&c.addedNodes.length>0&&!pc(c.addedNodes[0])&&(O.searchPseudoElements&&v(c.target),l(c.target)),"attributes"===c.type&&c.target.parentNode&&O.searchPseudoElements&&v(c.target.parentNode),"attributes"===c.type&&pc(c.target)&&~b.indexOf(c.attributeName))if("class"===c.attributeName){var z=Cc(X(c.target)),e=z.prefix,a=z.iconName;e&&c.target.setAttribute("data-prefix",e),a&&c.target.setAttribute("data-icon",a)}else h(c.target)})});M&&z.observe(t.getElementsByTagName("body")[0],{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}({treeCallback:Uc,nodeCallback:Kc,pseudoElementsCallback:Yc})})),E.hooks=k({},E.hooks,{addPack:function(c,l){E.styles[c]=k({},E.styles[c]||{},l),Hc(),el()},addShims:function(c){var l;(l=E.shims).push.apply(l,S(c)),Hc(),el()}})})}(); \ No newline at end of file From da4cea6c99839dbbb9addb9dfe507d89f44dc1c0 Mon Sep 17 00:00:00 2001 From: chenhe Date: Fri, 6 Nov 2020 09:37:38 +0800 Subject: [PATCH 2/4] fix translate --- frontend/i18n/zh/projects/labels.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/i18n/zh/projects/labels.js b/frontend/i18n/zh/projects/labels.js index 3a7d5320..47e2a846 100644 --- a/frontend/i18n/zh/projects/labels.js +++ b/frontend/i18n/zh/projects/labels.js @@ -3,7 +3,7 @@ export default { shortkey: '短键', color: '颜色', createLabel: '创建标签', - importLabels: '创建标签', + importLabels: '导入标签', exportLabels: '导出标签', labelName: '标签名', labelMessage: '请输入标签名', From 1a09da40b6ede59254ef3cf3062b0415383db332 Mon Sep 17 00:00:00 2001 From: chenhe Date: Wed, 11 Nov 2020 15:28:28 +0800 Subject: [PATCH 3/4] support chinese --- frontend/static/js/all.js | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 frontend/static/js/all.js diff --git a/frontend/static/js/all.js b/frontend/static/js/all.js deleted file mode 100644 index 21daa562..00000000 --- a/frontend/static/js/all.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Font Awesome Free 5.0.6 by @fontawesome - http://fontawesome.com - * License - http://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */ -!function(){"use strict";var c={};try{"undefined"!=typeof window&&(c=window)}catch(c){}var l=(c.navigator||{}).userAgent,h=void 0===l?"":l,v=c,z=(~h.indexOf("MSIE")||h.indexOf("Trident/"),"___FONT_AWESOME___"),e=function(){try{return!0}catch(c){return!1}}(),a=[1,2,3,4,5,6,7,8,9,10],m=a.concat([11,12,13,14,15,16,17,18,19,20]);["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter"].concat(a.map(function(c){return c+"x"})).concat(m.map(function(c){return"w-"+c}));var t=v||{};t[z]||(t[z]={}),t[z].styles||(t[z].styles={}),t[z].hooks||(t[z].hooks={}),t[z].shims||(t[z].shims=[]);var s=t[z],r=Object.assign||function(c){for(var l=1;l1&&void 0!==arguments[1]?arguments[1]:{}).asNewDefault,h=void 0!==l&&l,v=Object.keys(O),z=h?function(c){return~v.indexOf(c)&&!~A.indexOf(c)}:function(c){return~v.indexOf(c)};Object.keys(c).forEach(function(l){z(l)&&(O[l]=c[l])})}m.FontAwesomeConfig=O;var N=m||{};N[n]||(N[n]={}),N[n].styles||(N[n].styles={}),N[n].hooks||(N[n].hooks={}),N[n].shims||(N[n].shims=[]);var E=N[n],P=[],_=!1;M&&((_=(t.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(t.readyState))||t.addEventListener("DOMContentLoaded",function c(){t.removeEventListener("DOMContentLoaded",c),_=1,P.map(function(c){return c()})}));var T=function(c){M&&(_?setTimeout(c,0):P.push(c))},F=H,I={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function R(c){if(c&&M){var l=t.createElement("style");l.setAttribute("type","text/css"),l.innerHTML=c;for(var h=t.head.childNodes,v=null,z=h.length-1;z>-1;z--){var e=h[z],a=(e.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(a)>-1&&(v=e)}return t.head.insertBefore(l,v),c}}var W=0;function B(){return++W}function D(c){for(var l=[],h=(c||[]).length>>>0;h--;)l[h]=c[h];return l}function X(c){return c.classList?D(c.classList):(c.getAttribute("class")||"").split(" ").filter(function(c){return c})}function Y(c,l){var h,v=l.split("-"),z=v[0],e=v.slice(1).join("-");return z!==c||""===e||(h=e,~g.indexOf(h))?null:e}function U(c){return(""+c).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function K(c){return Object.keys(c||{}).reduce(function(l,h){return l+(h+": ")+c[h]+";"},"")}function G(c){return c.size!==I.size||c.x!==I.x||c.y!==I.y||c.rotate!==I.rotate||c.flipX||c.flipY}function J(c){var l=c.transform,h=c.containerWidth,v=c.iconWidth;return{outer:{transform:"translate("+h/2+" 256)"},inner:{transform:"translate("+32*l.x+", "+32*l.y+") "+" "+("scale("+l.size/16*(l.flipX?-1:1)+", "+l.size/16*(l.flipY?-1:1)+") ")+" "+("rotate("+l.rotate+" 0 0)")},path:{transform:"translate("+v/2*-1+" -256)"}}}var Q={x:0,y:0,width:"100%",height:"100%"},Z=function(c){var l=c.children,h=c.attributes,v=c.main,z=c.mask,e=c.transform,a=v.width,m=v.icon,t=z.width,s=z.icon,r=J({transform:e,containerWidth:t,iconWidth:a}),f={tag:"rect",attributes:k({},Q,{fill:"white"})},M={tag:"g",attributes:k({},r.inner),children:[{tag:"path",attributes:k({},m.attributes,r.path,{fill:"black"})}]},i={tag:"g",attributes:k({},r.outer),children:[M]},n="mask-"+B(),H="clip-"+B(),o={tag:"defs",children:[{tag:"clipPath",attributes:{id:H},children:[s]},{tag:"mask",attributes:k({},Q,{id:n,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[f,i]}]};return l.push(o,{tag:"rect",attributes:k({fill:"currentColor","clip-path":"url(#"+H+")",mask:"url(#"+n+")"},Q)}),{children:l,attributes:h}},$=function(c){var l=c.children,h=c.attributes,v=c.main,z=c.transform,e=K(c.styles);if(e.length>0&&(h.style=e),G(z)){var a=J({transform:z,containerWidth:v.width,iconWidth:v.width});l.push({tag:"g",attributes:k({},a.outer),children:[{tag:"g",attributes:k({},a.inner),children:[{tag:v.icon.tag,children:v.icon.children,attributes:k({},v.icon.attributes,a.path)}]}]})}else l.push(v.icon);return{children:l,attributes:h}},cc=function(c){var l=c.children,h=c.main,v=c.mask,z=c.attributes,e=c.styles,a=c.transform;if(G(a)&&h.found&&!v.found){var m=h.width/h.height/2,t=.5;z.style=K(k({},e,{"transform-origin":m+a.x/16+"em "+(t+a.y/16)+"em"}))}return[{tag:"svg",attributes:z,children:l}]},lc=function(c){var l=c.prefix,h=c.iconName,v=c.children,z=c.attributes,e=c.symbol,a=!0===e?l+"-"+O.familyPrefix+"-"+h:e;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:k({},z,{id:a}),children:v}]}]};function hc(c){var l=c.icons,h=l.main,v=l.mask,z=c.prefix,e=c.iconName,a=c.transform,m=c.symbol,t=c.title,s=c.extra,r=c.watchable,f=void 0!==r&&r,M=v.found?v:h,i=M.width,n=M.height,H="fa-w-"+Math.ceil(i/n*16),o=[O.replacementClass,e?O.familyPrefix+"-"+e:"",H].concat(s.classes).join(" "),C={children:[],attributes:k({},s.attributes,{"data-prefix":z,"data-icon":e,class:o,role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 "+i+" "+n})};f&&(C.attributes[V]=""),t&&C.children.push({tag:"title",attributes:{id:C.attributes["aria-labelledby"]||"title-"+B()},children:[t]});var L=k({},C,{prefix:z,iconName:e,main:h,mask:v,transform:a,symbol:m,styles:s.styles}),u=v.found&&h.found?Z(L):$(L),d=u.children,p=u.attributes;return L.children=d,L.attributes=p,m?lc(L):cc(L)}function vc(c){var l=c.content,h=c.width,v=c.height,z=c.transform,e=c.title,a=c.extra,m=c.watchable,t=void 0!==m&&m,s=k({},a.attributes,e?{title:e}:{},{class:a.classes.join(" ")});t&&(s[V]="");var r,f,M,n,o,C,L,u,d,p=k({},a.styles);G(z)&&(p.transform=(f=(r={transform:z,startCentered:!0,width:h,height:v}).transform,M=r.width,n=void 0===M?H:M,o=r.height,C=void 0===o?H:o,L=r.startCentered,d="",d+=(u=void 0!==L&&L)&&i?"translate("+(f.x/F-n/2)+"em, "+(f.y/F-C/2)+"em) ":u?"translate(calc(-50% + "+f.x/F+"em), calc(-50% + "+f.y/F+"em)) ":"translate("+f.x/F+"em, "+f.y/F+"em) ",d+="scale("+f.size/F*(f.flipX?-1:1)+", "+f.size/F*(f.flipY?-1:1)+") ",d+="rotate("+f.rotate+"deg) "),p["-webkit-transform"]=p.transform);var b=K(p);b.length>0&&(s.style=b);var g=[];return g.push({tag:"span",attributes:s,children:[l]}),e&&g.push({tag:"span",attributes:{class:"sr-only"},children:[e]}),g}var zc=function(){},ec=O.measurePerformance&&r&&r.mark&&r.measure?r:{mark:zc,measure:zc},ac='FA "5.0.6"',mc=function(c){ec.mark(ac+" "+c+" ends"),ec.measure(ac+" "+c,ac+" "+c+" begins",ac+" "+c+" ends")},tc={begin:function(c){return ec.mark(ac+" "+c+" begins"),function(){return mc(c)}},end:mc},sc=function(c,l,h,v){var z,e,a,m,t,s=Object.keys(c),r=s.length,f=void 0!==v?(m=l,t=v,function(c,l,h,v){return m.call(t,c,l,h,v)}):l;for(void 0===h?(z=1,a=c[s[0]]):(z=0,a=h);z"+a.map(uc).join("")+""}var dc=function(){};function pc(c){return"string"==typeof(c.getAttribute?c.getAttribute(V):null)}var bc={replace:function(c){var l=c[0],h=c[1].map(function(c){return uc(c)}).join("\n");if(l.parentNode&&l.outerHTML)l.outerHTML=h+(O.keepOriginalSource&&"svg"!==l.tagName.toLowerCase()?"\x3c!-- "+l.outerHTML+" --\x3e":"");else if(l.parentNode){var v=document.createElement("span");l.parentNode.replaceChild(v,l),v.outerHTML=h}},nest:function(c){var l=c[0],h=c[1];if(~X(l).indexOf(O.replacementClass))return bc.replace(c);var v=new RegExp(O.familyPrefix+"-.*");delete h[0].attributes.style;var z=h[0].attributes.class.split(" ").reduce(function(c,l){return l===O.replacementClass||l.match(v)?c.toSvg.push(l):c.toNode.push(l),c},{toNode:[],toSvg:[]});h[0].attributes.class=z.toSvg.join(" ");var e=h.map(function(c){return uc(c)}).join("\n");l.setAttribute("class",z.toNode.join(" ")),l.setAttribute(V,""),l.innerHTML=e}};function gc(c,l){var h="function"==typeof l?l:dc;0===c.length?h():(m.requestAnimationFrame||function(c){return c()})(function(){var l=!0===O.autoReplaceSvg?bc.replace:bc[O.autoReplaceSvg]||bc.replace,v=tc.begin("mutate");c.map(l),v(),h()})}var yc=!1;var wc=function(c){var l=c.getAttribute("style"),h=[];return l&&(h=l.split(";").reduce(function(c,l){var h=l.split(":"),v=h[0],z=h.slice(1);return v&&z.length>0&&(c[v]=z.join(":").trim()),c},{})),h};var kc=function(c){var l,h,v,z,e=c.getAttribute("data-prefix"),a=c.getAttribute("data-icon"),m=void 0!==c.innerText?c.innerText.trim():"",t=Cc(X(c));return e&&a&&(t.prefix=e,t.iconName=a),t.prefix&&m.length>1?t.iconName=(v=t.prefix,z=c.innerText,ic[v][z]):t.prefix&&1===m.length&&(t.iconName=(l=t.prefix,h=function(c){for(var l="",h=0;h-1&&Xc(z.nextSibling),Xc(z),z=null),v&&!z){var e=h.getPropertyValue("content"),a=t.createElement("i");a.setAttribute("class",""+Wc[v[1]]),a.setAttribute(C,l),a.innerText=3===e.length?e.substr(1,1):e,":before"===l?c.insertBefore(a,c.firstChild):c.appendChild(a)}})})}(),yc=!1,l()}}function Uc(c){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(M){var h=t.documentElement.classList,v=function(c){return h.add(L+"-"+c)},z=function(c){return h.remove(L+"-"+c)},e=Object.keys(Fc),a=["."+Ic+":not(["+V+"])"].concat(e.map(function(c){return"."+c+":not(["+V+"])"})).join(", ");if(0!==a.length){var m=D(c.querySelectorAll(a));if(m.length>0){v("pending"),z("complete");var s=tc.begin("onTree"),r=m.reduce(function(c,l){try{var h=Dc(l);h&&c.push(h)}catch(c){u||c instanceof jc&&console.error(c)}return c},[]);s(),gc(r,function(){v("active"),v("complete"),z("pending"),"function"==typeof l&&l()})}}}}function Kc(c){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,h=Dc(c);h&&gc([h],l)}var Gc=function(){var c=o,l=O.familyPrefix,h=O.replacementClass,v="svg:not(:root).svg-inline--fa{overflow:visible}.svg-inline--fa{display:inline-block;font-size:inherit;height:1em;overflow:visible;vertical-align:-.125em}.svg-inline--fa.fa-lg{vertical-align:-.225em}.svg-inline--fa.fa-w-1{width:.0625em}.svg-inline--fa.fa-w-2{width:.125em}.svg-inline--fa.fa-w-3{width:.1875em}.svg-inline--fa.fa-w-4{width:.25em}.svg-inline--fa.fa-w-5{width:.3125em}.svg-inline--fa.fa-w-6{width:.375em}.svg-inline--fa.fa-w-7{width:.4375em}.svg-inline--fa.fa-w-8{width:.5em}.svg-inline--fa.fa-w-9{width:.5625em}.svg-inline--fa.fa-w-10{width:.625em}.svg-inline--fa.fa-w-11{width:.6875em}.svg-inline--fa.fa-w-12{width:.75em}.svg-inline--fa.fa-w-13{width:.8125em}.svg-inline--fa.fa-w-14{width:.875em}.svg-inline--fa.fa-w-15{width:.9375em}.svg-inline--fa.fa-w-16{width:1em}.svg-inline--fa.fa-w-17{width:1.0625em}.svg-inline--fa.fa-w-18{width:1.125em}.svg-inline--fa.fa-w-19{width:1.1875em}.svg-inline--fa.fa-w-20{width:1.25em}.svg-inline--fa.fa-pull-left{margin-right:.3em;width:auto}.svg-inline--fa.fa-pull-right{margin-left:.3em;width:auto}.svg-inline--fa.fa-border{height:1.5em}.svg-inline--fa.fa-li{width:2em}.svg-inline--fa.fa-fw{width:1.25em}.fa-layers svg.svg-inline--fa{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.fa-layers{display:inline-block;height:1em;position:relative;text-align:center;vertical-align:-.125em;width:1em}.fa-layers svg.svg-inline--fa{-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter,.fa-layers-text{display:inline-block;position:absolute;text-align:center}.fa-layers-text{left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);-webkit-transform-origin:center center;transform-origin:center center}.fa-layers-counter{background-color:#ff253a;border-radius:1em;color:#fff;height:1.5em;line-height:1;max-width:5em;min-width:1.5em;overflow:hidden;padding:.25em;right:0;text-overflow:ellipsis;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-bottom-right{bottom:0;right:0;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom right;transform-origin:bottom right}.fa-layers-bottom-left{bottom:0;left:0;right:auto;top:auto;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:bottom left;transform-origin:bottom left}.fa-layers-top-right{right:0;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top right;transform-origin:top right}.fa-layers-top-left{left:0;right:auto;top:0;-webkit-transform:scale(.25);transform:scale(.25);-webkit-transform-origin:top left;transform-origin:top left}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;position:relative;width:2em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.svg-inline--fa.fa-stack-1x{height:1em;width:1em}.svg-inline--fa.fa-stack-2x{height:2em;width:2em}.fa-inverse{color:#fff}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}";if("fa"!==l||h!==c){var z=new RegExp("\\.fa\\-","g"),e=new RegExp("\\."+c,"g");v=v.replace(z,"."+l+"-").replace(e,"."+h)}return v};function Jc(c){return{found:!0,width:c[0],height:c[1],icon:{tag:"path",attributes:{fill:"currentColor",d:c.slice(4)[0]}}}}var Qc=!1;function Zc(){O.autoAddCss&&(Qc||R(Gc()),Qc=!0)}function $c(c,l){return Object.defineProperty(c,"abstract",{get:l}),Object.defineProperty(c,"html",{get:function(){return c.abstract.map(function(c){return uc(c)})}}),Object.defineProperty(c,"node",{get:function(){if(M){var l=t.createElement("div");return l.innerHTML=c.html,l.children}}}),c}function cl(c){var l=c.prefix,h=void 0===l?"fa":l,v=c.iconName;if(v)return Lc(hl.definitions,h,v)||Lc(E.styles,h,v)}var ll,hl=new(function(){function c(){y(this,c),this.definitions={}}return w(c,[{key:"add",value:function(){for(var c=this,l=arguments.length,h=Array(l),v=0;v1&&void 0!==arguments[1]?arguments[1]:{},h=l.transform,v=void 0===h?I:h,z=l.symbol,e=void 0!==z&&z,a=l.mask,m=void 0===a?null:a,t=l.title,s=void 0===t?null:t,r=l.classes,f=void 0===r?[]:r,M=l.attributes,i=void 0===M?{}:M,n=l.styles,H=void 0===n?{}:n;if(c){var o=c.prefix,V=c.iconName,C=c.icon;return $c(k({type:"icon"},c),function(){return Zc(),O.autoA11y&&(s?i["aria-labelledby"]=O.replacementClass+"-title-"+B():i["aria-hidden"]="true"),hc({icons:{main:Jc(C),mask:m?Jc(m.icon):{found:!1,width:null,height:null,icon:{}}},prefix:o,iconName:V,transform:k({},I,v),symbol:e,title:s,extra:{attributes:i,styles:H,classes:f}})})}},function(c){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},h=(c||{}).icon?c:cl(c||{}),v=l.mask;return v&&(v=(v||{}).icon?v:cl(v||{})),ll(h,k({},l,{mask:v}))}),zl={noAuto:function(){var c;j({autoReplaceSvg:c=!1,observeMutations:c})},dom:{i2svg:function(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(M){Zc();var l=c.node,h=void 0===l?t:l,v=c.callback,z=void 0===v?function(){}:v;O.searchPseudoElements&&Yc(h),Uc(h,z)}},css:Gc,insertCss:function(){R(Gc())}},library:hl,parse:{transform:function(c){return Sc(c)}},findIconDefinition:cl,icon:vl,text:function(c){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},h=l.transform,v=void 0===h?I:h,z=l.title,e=void 0===z?null:z,a=l.classes,m=void 0===a?[]:a,t=l.attributes,s=void 0===t?{}:t,r=l.styles,f=void 0===r?{}:r;return $c({type:"text",content:c},function(){return Zc(),vc({content:c,transform:k({},I,v),title:e,extra:{attributes:s,styles:f,classes:[O.familyPrefix+"-layers-text"].concat(S(m))}})})},layer:function(c){return $c({type:"layer"},function(){Zc();var l=[];return c(function(c){l=Array.isArray(c)?c.map(function(c){l=l.concat(c.abstract)}):l.concat(c.abstract)}),[{tag:"span",attributes:{class:O.familyPrefix+"-layers"},children:l}]})}},el=function(){M&&O.autoReplaceSvg&&zl.dom.i2svg({node:t})};Object.defineProperty(zl,"config",{get:function(){return O},set:function(c){j(c)}}),function(c){try{c()}catch(c){if(!u)throw c}}(function(){f&&(m.FontAwesome||(m.FontAwesome=zl),T(function(){Object.keys(E.styles).length>0&&el(),O.observeMutations&&"function"==typeof MutationObserver&&function(c){if(s){var l=c.treeCallback,h=c.nodeCallback,v=c.pseudoElementsCallback,z=new s(function(c){yc||D(c).forEach(function(c){if("childList"===c.type&&c.addedNodes.length>0&&!pc(c.addedNodes[0])&&(O.searchPseudoElements&&v(c.target),l(c.target)),"attributes"===c.type&&c.target.parentNode&&O.searchPseudoElements&&v(c.target.parentNode),"attributes"===c.type&&pc(c.target)&&~b.indexOf(c.attributeName))if("class"===c.attributeName){var z=Cc(X(c.target)),e=z.prefix,a=z.iconName;e&&c.target.setAttribute("data-prefix",e),a&&c.target.setAttribute("data-icon",a)}else h(c.target)})});M&&z.observe(t.getElementsByTagName("body")[0],{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}({treeCallback:Uc,nodeCallback:Kc,pseudoElementsCallback:Yc})})),E.hooks=k({},E.hooks,{addPack:function(c,l){E.styles[c]=k({},E.styles[c]||{},l),Hc(),el()},addShims:function(c){var l;(l=E.shims).push.apply(l,S(c)),Hc(),el()}})})}(); \ No newline at end of file From 44709e8878a1a30278611d9c5944d5e92a46fa72 Mon Sep 17 00:00:00 2001 From: chenhe Date: Wed, 11 Nov 2020 15:31:21 +0800 Subject: [PATCH 4/4] add support chinese --- frontend/i18n/index.js | 4 ++-- frontend/nuxt.config.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/i18n/index.js b/frontend/i18n/index.js index 85923be2..be51924a 100644 --- a/frontend/i18n/index.js +++ b/frontend/i18n/index.js @@ -21,9 +21,9 @@ export default { ], lazy: true, langDir: 'i18n/', - defaultLocale: 'zh', + defaultLocale: 'en', vueI18n: { - fallbackLocale: 'zh' + fallbackLocale: 'en' }, detectBrowserLanguage: { useCookie: true, diff --git a/frontend/nuxt.config.js b/frontend/nuxt.config.js index b2bc2ff3..6d5c4c89 100644 --- a/frontend/nuxt.config.js +++ b/frontend/nuxt.config.js @@ -15,7 +15,7 @@ export default { { hid: 'description', name: 'description', content: process.env.npm_package_description || '' } ], script: [ - { src: '/js/all.js' } + { src: 'https://use.fontawesome.com/releases/v5.0.6/js/all.js' } ], link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },