Extract translatable strings from Minecraft modpack mods and pack translations into resource packs
Project description
Mods String Extractor
从 Minecraft modpack 的 mods 中提取待翻译字符串,并在翻译完成后一键打包成资源包。
功能
- 🔍 自动扫描 mods 目录下所有
.jar文件 - 🌐 智能提取 待翻译字符串:
- 如果 mod 已有
zh_cn.json,只提取en_us.json与zh_cn.json的差集 - 如果 mod 没有
zh_cn.json,全量提取en_us.json
- 如果 mod 已有
- 📦 一键打包 翻译好的字符串为 Minecraft 资源包
安装
pip install mods-string-extractor
或使用 uv:
uv tool install mods-string-extractor
使用方法
1. 提取待翻译字符串
mods-string-extractor extract --mods /path/to/mods --output ./extracted
提取后的文件结构:
extracted/
├── ae2/
│ └── en_us.json
├── create/
│ └── en_us.json
├── mekanism/
│ └── en_us.json
└── ...
2. 翻译
编辑 extracted/ 中的 en_us.json 文件,将英文值替换为中文翻译。
3. 打包资源包
mods-string-extractor pack --input ./extracted --output translation_pack.zip
可选参数:
mods-string-extractor pack \
--input ./extracted \
--output translation_pack.zip \
--pack-format 34 \
--description "My Translation Pack"
4. 使用资源包
将生成的 .zip 文件放入 Minecraft 的 resourcepacks 目录即可。
开发
# 克隆项目
git clone https://github.com/zack-zzq/mods-string-extractor.git
cd mods-string-extractor
# 安装开发依赖
uv sync
# 运行测试
uv run pytest tests/ -v
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mods_string_extractor-1.0.2.tar.gz.
File metadata
- Download URL: mods_string_extractor-1.0.2.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f4408e5c80c36de22dd26c4c4a790771bfca4ad330554273bb803d93a2b58ee
|
|
| MD5 |
7d003ce0a5eb1eb2f0e95c153211d436
|
|
| BLAKE2b-256 |
93f2bab4f35f407eef78c9a7121b3eefbfdf008a8012e98cf5469e5059c25c82
|
Provenance
The following attestation bundles were made for mods_string_extractor-1.0.2.tar.gz:
Publisher:
publish.yml on zack-zzq/mods-string-extractor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mods_string_extractor-1.0.2.tar.gz -
Subject digest:
8f4408e5c80c36de22dd26c4c4a790771bfca4ad330554273bb803d93a2b58ee - Sigstore transparency entry: 1004618545
- Sigstore integration time:
-
Permalink:
zack-zzq/mods-string-extractor@a951dff56a2b99c41ac4273fe74880d30bee5c88 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/zack-zzq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a951dff56a2b99c41ac4273fe74880d30bee5c88 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mods_string_extractor-1.0.2-py3-none-any.whl.
File metadata
- Download URL: mods_string_extractor-1.0.2-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35dbe1bcb4558cb5f5fd3d72310922c5c850360b662f505b605dd4bcdd698d7f
|
|
| MD5 |
5dc051e32f78a4f1974e710644dee87a
|
|
| BLAKE2b-256 |
fbdfe5d9ae1ef8bd997a5991d5ed297673dffcd3e4cd1791de9c66bc2f2bf8b6
|
Provenance
The following attestation bundles were made for mods_string_extractor-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on zack-zzq/mods-string-extractor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mods_string_extractor-1.0.2-py3-none-any.whl -
Subject digest:
35dbe1bcb4558cb5f5fd3d72310922c5c850360b662f505b605dd4bcdd698d7f - Sigstore transparency entry: 1004618548
- Sigstore integration time:
-
Permalink:
zack-zzq/mods-string-extractor@a951dff56a2b99c41ac4273fe74880d30bee5c88 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/zack-zzq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a951dff56a2b99c41ac4273fe74880d30bee5c88 -
Trigger Event:
push
-
Statement type: