Skip to content

Commit 6a7f3a8

Browse files
committed
🌐 增加日语、德语翻译并设置默认语言为English #485
Add Japanese and German translations and set the default language to English
1 parent bdc681b commit 6a7f3a8

7 files changed

Lines changed: 860 additions & 3 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"i18n": {
3+
"message": "i18n"
4+
},
5+
"scriptcat": {
6+
"message": "ScriptCat"
7+
},
8+
"scriptcat_beta": {
9+
"message": "ScriptCat Beta"
10+
},
11+
"scriptcat_description": {
12+
"message": "Alles kann geskriptet werden, damit Ihr Browser mehr kann!"
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"i18n": {
3+
"message": "i18n"
4+
},
5+
"scriptcat": {
6+
"message": "ScriptCat"
7+
},
8+
"scriptcat_beta": {
9+
"message": "ScriptCat Beta"
10+
},
11+
"scriptcat_description": {
12+
"message": "すべてをスクリプト化し、ブラウザでより多くのことができるようになります!"
13+
}
14+
}

src/locales/de/translation.json

Lines changed: 412 additions & 0 deletions
Large diffs are not rendered by default.

src/locales/ja/translation.json

Lines changed: 412 additions & 0 deletions
Large diffs are not rendered by default.

src/locales/locales.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ import viVN from "./vi/translation.json";
88
import zhCN from "./zh-CN/translation.json";
99
import zhTW from "./zh-TW/translation.json";
1010
import achUG from "./ach-UG/translation.json";
11+
import jaJP from "./ja/translation.json";
12+
import deDE from "./de/translation.json";
1113
import "dayjs/locale/zh-cn";
1214
import "dayjs/locale/zh-tw";
15+
import "dayjs/locale/ja";
16+
import "dayjs/locale/de";
1317
import { systemConfig } from "@App/pages/store/global";
1418

1519
i18n.use(initReactI18next).init({
16-
fallbackLng: "zh-CN",
20+
fallbackLng: "en",
1721
lng: chrome.i18n.getUILanguage(),
1822
interpolation: {
1923
escapeValue: false, // react already safes from xss => https://www.i18next.com/translation-function/interpolation#unescape
@@ -24,6 +28,8 @@ i18n.use(initReactI18next).init({
2428
"zh-CN": { title: "简体中文", translation: zhCN },
2529
"zh-TW": { title: "繁体中文", translation: zhTW },
2630
"ach-UG": { title: "伪语言", translation: achUG },
31+
"ja-JP": { title: "日本語", translation: jaJP },
32+
"de-DE": { title: "Deutsch", translation: deDE },
2733
},
2834
});
2935

src/locales/zh-CN/translation.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@
374374
"get_backup_files_failed": "获取备份文件失败",
375375
"develop_mode_guide": "检测到当前未开启开发者模式,您的脚本无法正常使用,<a href=\"https://docs.scriptcat.org/docs/use/open-dev/\" target=\"black\" style=\"color: var(--color-text-1)\">👉点我了解如何开启</a>",
376376
"allow_user_script_guide": "检测到当前未开启允许用户脚本,您的脚本无法正常使用,<a href=\"https://docs.scriptcat.org/docs/use/open-dev/\" target=\"black\" style=\"color: var(--color-text-1)\">👉点我了解如何开启</a>",
377-
"lower_version_browser_guide": "检测到当前浏览器版本过低,您的脚本无法正常使用,<a href=\"https://docs.scriptcat.org/docs/use/open-dev/\" target=\"black\" style=\"color: var(--color-text-1)\">👉点我了解更多</a>",
378377
"enable_script_failed": "脚本开启失败",
379378
"disable_script_failed": "脚本关闭失败",
380379
"confirm_leave_page": "当前正在编辑状态,跳转其它页面将会丢失当前内容,是否跳转?",

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"icons": {
2222
"128": "assets/logo.png"
2323
},
24-
"default_locale": "zh_CN",
24+
"default_locale": "en",
2525
"permissions": [
2626
"tabs",
2727
"alarms",

0 commit comments

Comments
 (0)