Skip to content

Commit 19579ee

Browse files
committed
Add Chinese into selector
1 parent 1e78225 commit 19579ee

4 files changed

Lines changed: 71 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,16 @@ Project Link: [https://github.com/khoeos/Paradox-mod-language-converter](https:/
139139

140140
## Project Setup
141141

142+
Install [Node.js](https://nodejs.org/en/download)
143+
142144
### Recommended IDE Setup
143145

144146
- [VSCode](https://code.visualstudio.com/) + [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) + [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
145147

146148
### Install
147149

148150
```bash
149-
$ npm run install
151+
$ npm install
150152
```
151153

152154
### Development

src/i18n/zh.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"languages": {
3+
"en": "英语",
4+
"fr": "法语",
5+
"de": "德语",
6+
"es": "西班牙语",
7+
"ru": "俄语",
8+
"zh": "中文",
9+
"pt": "葡萄牙语",
10+
"pl": "波兰语",
11+
"kr": "韩语",
12+
"jp": "日语",
13+
"custom": "自定义"
14+
},
15+
"ModFolder": "Mod 文件夹",
16+
"ModFolderDescription": "选择需要翻译文件所在的文件夹。它可以是包含所有 Mod 的目录,也可以是某个特定 Mod 的文件夹。",
17+
"Mode": "模式",
18+
"ModeDescription": {
19+
"0": "管理缺失翻译的处理方式",
20+
"1": "将缺失的翻译添加到当前 Mod 文件夹中",
21+
"2": "将缺失的翻译提取到一个新文件夹中,并保留原始目录结构",
22+
"3": "创建一个包含缺失翻译的新 Mod(尚未实现)"
23+
},
24+
"AddToCurrent": "添加到当前目录",
25+
"ExtractToFolder": "提取到文件夹",
26+
"CreateTranslationMod": "创建翻译 Mod",
27+
"Options": "选项",
28+
"SourceLanguage": "源语言",
29+
"TargetLanguage": "目标语言",
30+
"subtitle": "原名为 Paradox Mod 语言转换器",
31+
"ConvertTranslations": "转换翻译",
32+
"CheckFilesBeforeCreation": "创建前检查文件",
33+
"CheckFilesBeforeCreationDesc": "允许你查看并选择将要创建的文件",
34+
"DeepCheck": "深度检查",
35+
"DeepCheckDesc": "不只是比较现有文件,还会检查现有文件中是否包含源语言的全部键。",
36+
"DeepCheckWarn": "实验性功能:请自行承担风险,速度会很慢",
37+
"conversionLog": {
38+
"starting": "开始扫描文件",
39+
"done": "转换完成"
40+
},
41+
"Close": "关闭",
42+
"HowToUse": "使用方法",
43+
"HowToUseDesc": {
44+
"1": "在顶部选择你的游戏",
45+
"2": "选择 Mod 所在目录。它可以是单个 Mod 的文件夹、创意工坊 Mod 的目录,或任何包含 Mod 的文件夹",
46+
"3": "选择目标语言",
47+
"4": "选择模式",
48+
"5": "如果需要,修改相关选项",
49+
"6": "等待处理完成",
50+
"7": "检查将要创建的文件"
51+
},
52+
"HowItWorks": "工作原理",
53+
"HowItWorksDesc": {
54+
"1": "简单来说,该工具会检查源语言的所有翻译文件,并确认是否存在目标语言的对应文件。如果不存在,就会基于源语言创建这些文件,以避免出现缺失翻译。",
55+
"2": "它可以避免在你的语言尚未翻译时显示键名而不是文本。它不会自动翻译 Mod 本身,只会生成本地化文件。",
56+
"3": "如果检测到本地化文件,即使它并不完整,默认情况下本应用也不会覆盖它。你可以在选项中修改此行为。",
57+
"4": "未来你将能够检查现有文件中缺失的键。"
58+
},
59+
"Limitations": "限制与说明",
60+
"LimitationsDesc": {
61+
"1": "我看到有些 Mod 使用了比较特殊的文件夹或文件名,例如 \"synced_localisation\"\"replace\"。目前该工具会忽略这些文件夹。",
62+
"2": "这个工具主要在 Stellaris 上进行了测试,也测试过 EU4 和 CK3,但覆盖的 Mod 和使用场景较少;尚未测试过 Hoi4。整体逻辑是一样的,所以理论上不应有问题,但在某些特殊情况下可能无法正常工作。目前我暂时禁用了 Imperator: Rome 和 Victoria。"
63+
}
64+
}

src/renderer/src/components/Header.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export default function Header(): JSX.Element {
9191
<SelectGroup>
9292
<SelectItem value="en">{t('languages.en')}</SelectItem>
9393
<SelectItem value="fr">{t('languages.fr')}</SelectItem>
94+
<SelectItem value="zh">{t('languages.zh')}</SelectItem>
9495
</SelectGroup>
9596
</SelectContent>
9697
</Select>

src/renderer/src/i18n.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import i18n from 'i18next'
22
import { initReactI18next } from 'react-i18next'
33
import en from '../../i18n/en.json'
44
import fr from '../../i18n/fr.json'
5+
import zh from '../../i18n/zh.json'
56

67
// the translations
78
// (tip move them in a JSON file and import them,
@@ -24,7 +25,8 @@ i18n
2425
.init({
2526
resources: {
2627
en: { translation: en },
27-
fr: { translation: fr }
28+
fr: { translation: fr },
29+
zh: { translation: zh }
2830
},
2931
lng: 'en', // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources
3032
// you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage

0 commit comments

Comments
 (0)