Skip to content

Commit

Permalink
merge: 合入v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
XDawned committed Mar 9, 2024
1 parent f7341ab commit 4527434
Show file tree
Hide file tree
Showing 22 changed files with 4,388 additions and 616 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<a href="https://github.com/Tryanks/python-snbtlib">
<img src="https://img.shields.io/badge/lib-snbtlib-brightgreen" alt="lib">
</a>
<a href="https://github.com/XDawned/ModpackLocalizationTools/releases/tag/v1.0.0">
<img src="https://img.shields.io/badge/releases-1.0-blue" alt="releases">
<a href="https://github.com/XDawned/ModpackLocalizationTools/releases/latest">
<img src="https://img.shields.io/badge/releases-v1.0.0" alt="releases">
</a>

# 整合包本地化工具
Expand All @@ -35,8 +35,7 @@
2. 保存进度功能用于将你已经润色完的汉化放入记忆库中供后续使用, 你可以在cache中找到相应记录
3. 文件浏览页面右键可以进行lang与json互相转化
4. 如果不需要为FTBQ提lang,你可以直接在文件浏览器中打开snbt文件对其进行直接编辑
5. 本项目开源免费,激活与否只影响机翻之后是否保留原文,比如`apple`翻译后为`苹果[--apple--]`,主要为标记机翻以防止大范围传播
6. 激活码申请渠道,你可以加入我们的QQ群`565620304`进行免费申请,发放对象为有资历的汉化组或制作过相应汉化的个人,后续我们会为过审译者们提供更多的便利功能。
5. 维护翻译生态,请不要直接发布未经人工润色的机翻
### 效果:
![29BL(U}7()AT$V7HFOP(BGL](https://github.com/XDawned/ModpackLocalizationTools/assets/96915192/c43ec8fe-b0da-466f-be98-60299b03a76e)

Expand Down
6 changes: 5 additions & 1 deletion common/activate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ class Activate:
activate = False
activateInfo = ''

# 不予公开
def __init__(self):
self.check()

def check(self):
self.activate = True


activate = Activate()
13 changes: 9 additions & 4 deletions common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@ class Config(QConfig):
lowVersionLangFormat = ConfigItem("LangFormat", "LowVersionLangFormat", False, BoolValidator())
# 翻译API
translateApi = OptionsConfigItem(
"TranslateApi", "TranslateApi", "百度翻译", OptionsValidator(["0", "1", "2"]), restart=True)
"TranslateApi", "TranslateApi", "1", OptionsValidator(["0", "1", "2"]))
appKey = ConfigItem("TranslateApi", "AppKey", 'Your APP_KEY')
appSecret = ConfigItem("TranslateApi", "AppSecret", 'Your APP_SECRET')
# openapi
orgId = ConfigItem("TranslateApi", "OrgId", 'Your OrgId')
secretKey = ConfigItem("TranslateApi", "SecretKey", 'Your SecretKey')
openaiUrl = ConfigItem("OpenaiUrl", "OpenaiUrl", 'https://api.openai.com/v1')
modelName = ConfigItem("ModelName", "ModelName", 'gpt-3.5-turbo')

activateCode = ConfigItem("Activate", "ActivateCode", 'Your ActivateCode')
# 游戏版本
gameVersion = OptionsConfigItem("Meta", "GameVersion", "6", OptionsValidator(["1", "2", "3", "4", "11", "12",
"5", "6", "7", "8", "9", "13", "14",
"15"]), restart=True)
"15"]))
# 资源包名称
metaName = ConfigItem("Meta", "Name", 'Modpack-Localization-Pack')
# 资源包介绍
Expand All @@ -39,9 +44,9 @@ class Config(QConfig):
iconPath = ConfigItem("Meta", "Icon", "./work/pack.png")


YEAR = 2023
YEAR = 2024
AUTHOR = "XDawned"
VERSION = 'v1.0.0'
VERSION = 'v1.1.0'
HELP_URL = "https://github.com/XDawned"
REPO_URL = "https://github.com/XDawned"
EXAMPLE_URL = "https://github.com/XDawned"
Expand Down
1 change: 0 additions & 1 deletion common/style_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class StyleSheet(StyleSheetBase, Enum):
ICON_INTERFACE = "icon_interface"
VIEW_INTERFACE = "view_interface"
SETTING_INTERFACE = "setting_interface"
GALLERY_INTERFACE = "gallery_interface"
NAVIGATION_VIEW_INTERFACE = "navigation_view_interface"
TEST = "test"

Expand Down
2 changes: 1 addition & 1 deletion common/Dict-Mini.json → common/terms_dict.py

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion common/update_checker.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
import requests

from common.config import cfg, VERSION


class UpdateChecker:
latest_version = ''
logs = ''
link = ''
need_update = False

# 不予公开
def __init__(self):
if cfg.get(cfg.checkUpdateAtStartUp):
self.check()

def check(self):
url = 'https://mockapi.eolink.com/xTErhAwc4668071e4e0351ac3a2e20131a45027fac017a0/version?responseId=1346980'
try:
response = requests.get(url, timeout=3)
if response.status_code == 200:
result = response.json()
self.latest_version = result.get('latest_version')
self.logs = result.get('logs')
self.link = result.get('link')
if self.latest_version != VERSION:
self.need_update = True
except Exception as e:
print(e)


update_checker = UpdateChecker()
Loading

0 comments on commit 4527434

Please sign in to comment.