Skip to content

Commit

Permalink
📝 协助翻译
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Oct 12, 2023
1 parent 5807a2a commit dabe7f3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ npm install
npm start
```

### 帮助我们翻译

[Crowdin](https://crowdin.com/project/scriptcat) 是一个在线的多语言翻译平台。如果你想帮助我们翻译 ScriptCat 的文档,可以在 Crowdin 上找到 ScriptCat 的项目,然后开始翻译。

扩展的翻译文件在`src/locales`目录下。

## 参与开发

ScriptCat 使用 ESLint 来规范代码风格,使用 Jest
Expand All @@ -94,7 +100,6 @@ ScriptCat 的页面开发使用了以下技术:
npm run dev
```


如果你想打包扩展,可以使用以下命令:

```bash
Expand All @@ -104,5 +109,6 @@ npm run pack
在打包前,请确保在`dist`目录下生成了`scriptcat.pem`文件。

# 注意问题
* 使用`yarn install`时可能会出现错误,最好使用`npm i`
* `npm run dev`之后需要把`dist/ext`目录里面内容在浏览器扩展里面导入加载,然后开始改代码保存即可,浏览器是实时更新的

- 使用`yarn install`时可能会出现错误,最好使用`npm i`
- `npm run dev`之后需要把`dist/ext`目录里面内容在浏览器扩展里面导入加载,然后开始改代码保存即可,浏览器是实时更新的
2 changes: 1 addition & 1 deletion crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project_id: '620320'
project_id: "620320"
api_token_env: CROWDIN_PERSONAL_TOKEN
preserve_hierarchy: true

Expand Down
1 change: 1 addition & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"helpcenter": "Help Center",
"general": "General",
"language": "Language",
"help_translate": "Help Translate",
"script_sync": "Script Sync",
"sync_delete": "Sync Delete",
"enable_script_sync_to": "Enable Script Sync to",
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh-CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"helpcenter": "帮助中心",
"general": "通用",
"language": "语言",
"help_translate": "帮助翻译",
"script_sync": "脚本同步",
"sync_delete": "同步删除",
"enable_script_sync_to": "启用脚本同步至",
Expand Down
11 changes: 11 additions & 0 deletions src/pages/options/routes/Setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ function Setting() {
title: i18n.store.data[key].title as string,
});
});
languageList.push({
key: "help",
title: t("help_translate"),
});

return (
<Space
Expand All @@ -67,6 +71,13 @@ function Setting() {
value={language}
className="w-24"
onChange={(value) => {
if (value === "help") {
window.open(
"https://crowdin.com/project/scriptcat",
"_blank"
);
return;
}
setLanguage(value);
i18n.changeLanguage(value);
dayjs.locale(
Expand Down

0 comments on commit dabe7f3

Please sign in to comment.