-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from Ray-D-Song/i18n
feat: add i18n
- Loading branch information
Showing
41 changed files
with
880 additions
and
239 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"logout": "Logout", | ||
"change-plugin-settings": "Change Plugin Settings", | ||
"create": "Create", | ||
"create-folder-failed": "Failed to create folder", | ||
"create-folder-input-placeholder": "Folder name", | ||
"create-folder-success": "Folder created", | ||
"create-new-folder": "Create New Folder", | ||
"auth-failed": "Authentication failed", | ||
"get-current-tab-info-failed": "Can not get current tab info", | ||
"block-audios": "Block Audios", | ||
"block-scripts": "Block Scripts", | ||
"block-videos": "Block Videos", | ||
"compress-HTML": "Compress HTML", | ||
"group-duplicate-images": "Group Duplicate Images", | ||
"load-deferred-images": "Load Deferred Images", | ||
"load-deferred-images-max-idle-time": "Load Deferred Images Max Idle Time", | ||
"remove-alternative-fonts": "Remove Alternative Fonts", | ||
"remove-alternative-images": "Remove Alternative Images", | ||
"remove-alternative-medias": "Remove Alternative Medias", | ||
"remove-hidden-elements": "Remove Hidden Elements", | ||
"remove-imports": "Remove Imports", | ||
"remove-unused-fonts": "Remove Unused Fonts", | ||
"remove-unused-styles": "Remove Unused Styles", | ||
"save-page": "Save Page", | ||
"singlefile-settings": "Single File Settings", | ||
"clear-finished-task-list": "Clear finished history task list", | ||
"save": "Save", | ||
"title": "Title", | ||
"tag": "Tag", | ||
"add-save-page-task-success": "Add save page task success", | ||
"page-desc": "Page Description", | ||
"scraping-page-data": "Scraping Page Data...", | ||
"ai-tag-not-configured": "Please configure in website settings first", | ||
"select-folder-placeholder": "Select a folder", | ||
"folder-required": "Please select a folder", | ||
"no-folder-found": "No Folder Found.", | ||
"confirm": "Confirm", | ||
"toggle-theme": "Toggle Theme", | ||
"server-url": "Server URL", | ||
"input-server-url-placeholder": "Enter the server URL", | ||
"input-token-placeholder": "Enter the token", | ||
"task-init": "Init", | ||
"task-scraping": "Scraping page", | ||
"task-done": "Done", | ||
"task-failed": "Failed", | ||
"task-uploading": "Uploading to server", | ||
"folder-name-required": "Folder name is required", | ||
"cancel": "Cancel", | ||
"folder": "Folder", | ||
"view-save-history": "View Save History", | ||
"open-showcase-page": "Open Showcase Page", | ||
"open-home-page": "Open Home Page", | ||
"save-page-not-available": "Save Page (Not Available)", | ||
"language": "Language:" | ||
} |
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,56 @@ | ||
{ | ||
"logout": "登出", | ||
"change-plugin-settings": "更改插件设置", | ||
"create": "创建", | ||
"create-folder-failed": "创建文件夹失败", | ||
"create-folder-input-placeholder": "文件夹名称", | ||
"create-folder-success": "文件夹创建成功", | ||
"create-new-folder": "创建新文件夹", | ||
"auth-failed": "认证失败", | ||
"get-current-tab-info-failed": "获取当前标签页信息失败", | ||
"block-audios": "拦截音频", | ||
"block-scripts": "拦截脚本", | ||
"block-videos": "拦截视频", | ||
"compress-HTML": "压缩 HTML", | ||
"group-duplicate-images": "分组重复图片", | ||
"load-deferred-images": "加载延迟图片", | ||
"load-deferred-images-max-idle-time": "加载延迟图片最大空闲时间(毫秒)", | ||
"remove-alternative-fonts": "移除备选字体", | ||
"remove-alternative-images": "移除用于备选分辨率的图片", | ||
"remove-alternative-medias": "移除用于备选设备屏幕的样式表", | ||
"remove-hidden-elements": "移除隐藏元素", | ||
"remove-imports": "移除导入", | ||
"remove-unused-fonts": "移除未使用的字体", | ||
"remove-unused-styles": "移除未使用的样式", | ||
"save-page": "保存页面", | ||
"singlefile-settings": "SingleFile 设置", | ||
"clear-finished-task-list": "清除已完成的历史任务列表", | ||
"save": "保存", | ||
"title": "标题", | ||
"tag": "标签", | ||
"add-save-page-task-success": "添加保存页面任务成功", | ||
"page-desc": "页面描述", | ||
"scraping-page-data": "正在抓取页面数据...", | ||
"ai-tag-not-configured": "请现在网站中配置相关设置", | ||
"select-folder-placeholder": "选择一个文件夹", | ||
"folder-required": "请选择一个文件夹", | ||
"no-folder-found": "未找到文件夹", | ||
"confirm": "确认", | ||
"toggle-theme": "切换主题", | ||
"server-url": "服务器 URL", | ||
"input-server-url-placeholder": "请输入服务器 URL", | ||
"input-token-placeholder": "请输入Token", | ||
"task-init": "初始化", | ||
"task-scraping": "正在抓取页面", | ||
"task-done": "完成", | ||
"task-failed": "失败", | ||
"task-uploading": "正在上传到服务器", | ||
"folder-name-required": "请输入文件夹名称", | ||
"cancel": "取消", | ||
"folder": "文件夹", | ||
"view-save-history": "查看保存历史", | ||
"open-showcase-page": "打开 Showcase 页面", | ||
"open-home-page": "打开首页", | ||
"save-page-not-available": "保存页面(不可用)", | ||
"language": "语言: " | ||
} |
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,31 @@ | ||
import i18n from 'i18next' | ||
import { initReactI18next } from 'react-i18next' | ||
import LanguageDetector from 'i18next-browser-languagedetector' | ||
import enTranslation from '~/assets/locales/en/translation.json' | ||
import zhCNTranslation from '~/assets/locales/zh-CN/translation.json' | ||
|
||
i18n | ||
// detect user language | ||
// learn more: https://github.com/i18next/i18next-browser-languageDetector | ||
.use(LanguageDetector) | ||
// pass the i18n instance to react-i18next. | ||
.use(initReactI18next) | ||
// init i18next | ||
// for all options read: https://www.i18next.com/overview/configuration-options | ||
.init({ | ||
fallbackLng: 'en', | ||
debug: true, | ||
interpolation: { | ||
escapeValue: false, // not needed for react as it escapes by default | ||
}, | ||
resources: { | ||
'en': { | ||
translation: enTranslation, | ||
}, | ||
'zh-CN': { | ||
translation: zhCNTranslation, | ||
}, | ||
}, | ||
}) | ||
|
||
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
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
Oops, something went wrong.