Skip to content

Commit 31bf213

Browse files
committed
初始化项目
0 parents  commit 31bf213

54 files changed

Lines changed: 7890 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/shelf/
2+
/hook-ctypes.macholib.py
3+
/.idea/
4+
/build/
5+
/dist/
6+
/cache/
7+
/work/
8+
/gui/
9+
/save/
10+
/t
11+
/整合包本地化工具.spec
12+
/resource/controls
13+
/models/
14+

LICENSE

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

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<div align="center">
2+
<img width="115" height="115" src="https://i.postimg.cc/FzQGyDgr/logo.png">
3+
</div>
4+
<div align="center">
5+
<a href="https://github.com/XDawned/ModpackLocalizationTools/blob/main/LICENSE">
6+
<img src="https://img.shields.io/github/license/mashape/apistatus.svg" alt="license">
7+
</a>
8+
<a href="https://github.com/Tryanks/python-snbtlib">
9+
<img src="https://img.shields.io/badge/lib-snbtlib-brightgreen" alt="lib">
10+
</a>
11+
<a href="https://github.com/XDawned/ModpackLocalizationTools/releases/latest">
12+
<img src="https://img.shields.io/badge/releases-v1.0.0" alt="releases">
13+
</a>
14+
15+
# 整合包本地化工具
16+
</div>
17+
18+
### 介绍:
19+
20+
一个辅助翻译我的世界整合包汉化任务的工具集
21+
22+
你可以用它:
23+
1. 快速找到整合包中需要翻译的任务或模组,并提取出相应语言文件
24+
2. 生成机翻并进行在线润色
25+
3. 自动生成汉化资源包
26+
4. lang与json语言文件互相转化
27+
5. MC模组术语查询
28+
### 使用:
29+
1. 首先进入右下角调整通用配置,选择使用的翻译API(离线翻译或[百度翻译api](bce.baidu.com))等
30+
2. 提取整合包中待提取部分送入工作目录下
31+
3. 进入工作台编辑
32+
4. 生成汉化资源包,注意替换原先任务文件为local目录下的使用键值的文件
33+
### 说明
34+
1. 中断预翻译请务必使用终止翻译按钮
35+
2. 保存进度功能用于将你已经润色完的汉化放入记忆库中供后续使用, 你可以在cache中找到相应记录
36+
3. 文件浏览页面右键可以进行lang与json互相转化
37+
4. 如果不需要为FTBQ提lang,你可以直接在文件浏览器中打开snbt文件对其进行直接编辑
38+
5. 本项目开源免费。加设激活码机制为出于生态考虑,请不要直接上传机翻
39+
6. 激活与否只影响能否关闭保留原文,不影响整体使用,激活码发放人群为有汉化发布资历的个人或组织,可以加入本项目群聊免费申请
40+
### 效果:
41+
![29BL(U}7()AT$V7HFOP(BGL](https://github.com/XDawned/ModpackLocalizationTools/assets/96915192/c43ec8fe-b0da-466f-be98-60299b03a76e)
42+
43+
44+
### 可能遇到的问题
45+
1. 闪退,大概率为异常操作
46+
2. API调用出错,网络环境不佳或翻译的文本有误
47+
48+
### 未来的计划
49+
1. 支持对kubejs等更多类型硬编码的处理
50+
2. 完成LangChain设计以方便后续对接ChatGLM2等大语言模型,以期辅助进行硬编码处理以及带来更好翻译效果
51+
### 感谢
52+
1. [snbtlib](https://github.com/Tryanks/python-snbtlib)--提供snbt文本解析
53+
2. [PyQt-Fluent-Widgets](https://github.com/zhiyiYo/PyQt-Fluent-Widgets)--界面实现
54+
3. [JSON-i18n](https://github.com/MonianHello/JSON-i18n)--编辑平台界面设计(不包含代码)
55+
4. [i18n-dict](https://github.com/CFPATools/i18n-dict)--术语查询支持
56+
5. [opus-mt-en-zh](https://huggingface.co/Helsinki-NLP/opus-mt-en-zh)--离线翻译模型
57+
6. [CFPA全体成员](https://cfpa.site/)--汉化数据贡献
58+
### Tips
59+
1. 为了获取更好的翻译效果,如果使用百度翻译api建议先在百度翻译api中扩充自己的术语库,原版术语可以参考[CFPA术语库](https://github.com/CFPAOrg/Glossary)
60+
2. 如果你有更好的思路或者发现了某些bug,欢迎在此发起issue或pr!
61+

common/Dict-Mini.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

common/activate.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Activate:
2+
activate = False
3+
activateInfo = ''
4+
5+
# 不予公开
6+
7+
8+
activate = Activate()

common/config.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# coding:utf-8
2+
3+
from qfluentwidgets import (qconfig, QConfig, ConfigItem, OptionsConfigItem, BoolValidator,
4+
OptionsValidator, FolderValidator)
5+
6+
7+
class Config(QConfig):
8+
workFolder = ConfigItem(
9+
"Folders", "WorkFolder", "work", FolderValidator())
10+
cacheFolder = ConfigItem(
11+
"Folders", "CacheFolder", "cache", FolderValidator())
12+
saveFolder = ConfigItem(
13+
"Folders", "SaveFolder", "save", FolderValidator())
14+
15+
dpiScale = OptionsConfigItem(
16+
"MainWindow", "DpiScale", "Auto", OptionsValidator([1, 1.25, 1.5, 1.75, 2, "Auto"]), restart=True)
17+
# software update
18+
checkUpdateAtStartUp = ConfigItem("Update", "UpdateAtStartUp", True, BoolValidator())
19+
# 保留原文
20+
keepOriginal = ConfigItem("BackFill", "KeepOriginal", False, BoolValidator())
21+
# 使用低版本lang格式
22+
lowVersionLangFormat = ConfigItem("LangFormat", "LowVersionLangFormat", False, BoolValidator())
23+
# 翻译API
24+
translateApi = OptionsConfigItem(
25+
"TranslateApi", "TranslateApi", "百度翻译", OptionsValidator(["0", "1", "2"]), restart=True)
26+
appKey = ConfigItem("TranslateApi", "AppKey", 'Your APP_KEY')
27+
appSecret = ConfigItem("TranslateApi", "AppSecret", 'Your APP_SECRET')
28+
29+
activateCode = ConfigItem("Activate", "ActivateCode", 'Your ActivateCode')
30+
# 游戏版本
31+
gameVersion = OptionsConfigItem("Meta", "GameVersion", "6", OptionsValidator(["1", "2", "3", "4", "11", "12",
32+
"5", "6", "7", "8", "9", "13", "14",
33+
"15"]), restart=True)
34+
# 资源包名称
35+
metaName = ConfigItem("Meta", "Name", 'Modpack-Localization-Pack')
36+
# 资源包介绍
37+
metaDesc = ConfigItem("Meta", "Desc", 'generated by &aModpackLocalizationTools')
38+
# 资源包图标位置
39+
iconPath = ConfigItem("Meta", "Icon", "./work/pack.png")
40+
41+
42+
YEAR = 2023
43+
AUTHOR = "XDawned"
44+
VERSION = 'v1.0.0'
45+
HELP_URL = "https://github.com/XDawned"
46+
REPO_URL = "https://github.com/XDawned"
47+
EXAMPLE_URL = "https://github.com/XDawned"
48+
FEEDBACK_URL = "https://github.com/XDawned/FTBQLocalizationTools/issues"
49+
RELEASE_URL = "https://github.com/XDawned/FTBQLocalizationTools/releases/latest"
50+
SUPPORT_URL = "https://afdian.net/a/XDawned"
51+
52+
cfg = Config()
53+
qconfig.load('config/config.json', cfg)

0 commit comments

Comments
 (0)