Skip to content

Commit 9d47a09

Browse files
committed
📝 补回贡献文档中的"协助翻译"章节,引导通过 GitHub PR 流程
CONTRIBUTING(中/英/俄)与 src/locales/README.md 在前一次清理中整段被删除,现补回引导内容,说明如何编辑现有翻译、新增语言并提交 PR。
1 parent ad5566f commit 9d47a09

4 files changed

Lines changed: 44 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ pnpm install
6565
pnpm start
6666
```
6767

68+
### 帮助我们翻译
69+
70+
ScriptCat 的翻译文件托管在 GitHub 上,欢迎通过 Pull Request 贡献翻译。
71+
72+
- 翻译文件位于 [`src/locales`](https://github.com/scriptscat/scriptcat/tree/main/src/locales),每种语言对应一个 `<语言代码>/translation.json`
73+
- **改进已有翻译**:直接编辑对应语言的 `translation.json`
74+
- **新增语言**:在 `src/locales/` 下新建对应语言代码目录(如 `fr-FR`),复制 `en-US/translation.json` 作为模板进行翻译,并在 `src/locales/locales.ts` 中注册
75+
- 完成后向 `main` 分支提交 Pull Request 即可
76+
6877
## 参与开发
6978

7079
ScriptCat 使用 ESLint 来规范代码风格,使用 Vitest 来进行单元测试。你可以使用以下命令来运行:

docs/CONTRIBUTING_EN.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ pnpm install
5757
pnpm start
5858
```
5959

60+
### Help Us Translate
61+
62+
ScriptCat's translation files are hosted on GitHub. Contributions via Pull Request are welcome.
63+
64+
- Translation files live in [`src/locales`](https://github.com/scriptscat/scriptcat/tree/main/src/locales); each language has its own `<locale>/translation.json`
65+
- **Improve an existing translation**: edit the corresponding `translation.json` directly
66+
- **Add a new language**: create a new directory under `src/locales/` (e.g. `fr-FR`), copy `en-US/translation.json` as a template and translate the strings, then register the locale in `src/locales/locales.ts`
67+
- Open a Pull Request against the `main` branch when you are done
68+
6069
## Participating in Development
6170

6271
ScriptCat uses ESLint to standardize code style and Vitest for unit testing. You can use the following commands to run them:

docs/CONTRIBUTING_RU.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ pnpm install
6363
pnpm start
6464
```
6565

66+
### Помощь с переводом
67+
68+
Файлы перевода ScriptCat размещены на GitHub. Мы приветствуем вклад через Pull Request.
69+
70+
- Файлы перевода находятся в каталоге [`src/locales`](https://github.com/scriptscat/scriptcat/tree/main/src/locales); для каждого языка есть отдельный файл `<язык>/translation.json`
71+
- **Улучшение существующего перевода**: отредактируйте соответствующий `translation.json` напрямую
72+
- **Добавление нового языка**: создайте каталог в `src/locales/` (например, `fr-FR`), скопируйте `en-US/translation.json` в качестве шаблона и переведите строки, затем зарегистрируйте локаль в `src/locales/locales.ts`
73+
- По завершении создайте Pull Request в ветку `main`
74+
6675
## Участие в разработке
6776

6877
ScriptCat использует ESLint для стандартизации стиля кода и Vitest для модульного тестирования. Вы можете использовать следующие команды для запуска:

src/locales/README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ for example:
2323
}
2424
```
2525

26+
## Help Us Translate
27+
28+
ScriptCat's translation files are hosted on GitHub — contributions via Pull Request are welcome.
29+
30+
- Translation files live in [`src/locales`](https://github.com/scriptscat/scriptcat/tree/main/src/locales); each language has its own `<locale>/translation.json`
31+
- **Improve an existing translation**: edit the corresponding `translation.json` directly
32+
- **Add a new language**: create a new directory under `src/locales/` (e.g. `fr-FR`), copy `en-US/translation.json` as a template and translate the strings, then register the locale in `src/locales/locales.ts`
33+
- Open a Pull Request against the `main` branch when you are done
34+
2635
# i18n 方案
2736

2837
i18n 使用[i8next](https://www.i18next.com/)实现,之所以不是用`chrome.i18n`的原因是该方案不支持动态切换语言。但是为了某些扩展市场的要求,我们还是在`src/assets/_locales`目录下添加了`chrome.i18n`的语言文件。
@@ -44,4 +53,11 @@ i18n 使用[i8next](https://www.i18next.com/)实现,之所以不是用`chrome.
4453
}
4554
```
4655

47-
- `src/locales`[扩展](https://github.com/scriptscat/scriptcat)翻译文件目录
56+
## 帮助我们翻译
57+
58+
ScriptCat 的翻译文件托管在 GitHub 上,欢迎通过 Pull Request 贡献翻译。
59+
60+
- 翻译文件位于 [`src/locales`](https://github.com/scriptscat/scriptcat/tree/main/src/locales),每种语言对应一个 `<语言代码>/translation.json`
61+
- **改进已有翻译**:直接编辑对应语言的 `translation.json`
62+
- **新增语言**:在 `src/locales/` 下新建对应语言代码目录(如 `fr-FR`),复制 `en-US/translation.json` 作为模板进行翻译,并在 `src/locales/locales.ts` 中注册
63+
- 完成后向 `main` 分支提交 Pull Request 即可

0 commit comments

Comments
 (0)