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
Release files for mods-string-extractor 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mods_string_extractor-1.0.2.tar.gz | 19.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mods_string_extractor-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.0 kB
Release files / mods_string_extractor-1.0.2.tar.gz
| Download URL | mods_string_extractor-1.0.2.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f4408e5c80c36de22dd26c4c4a790771bfca4ad330554273bb803d93a2b58ee
|
|
BLAKE2b-256 checksum How to use checksums |
93f2bab4f35f407eef78c9a7121b3eefbfdf008a8012e98cf5469e5059c25c82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 28, 2026.
Transparency logRelease files / mods_string_extractor-1.0.2-py3-none-any.whl
| Download URL | mods_string_extractor-1.0.2-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35dbe1bcb4558cb5f5fd3d72310922c5c850360b662f505b605dd4bcdd698d7f
|
|
BLAKE2b-256 checksum How to use checksums |
fbdfe5d9ae1ef8bd997a5991d5ed297673dffcd3e4cd1791de9c66bc2f2bf8b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 28, 2026.
Transparency log