Skip to main content

Extract translatable strings from Minecraft modpack mods and pack translations into resource packs

Project description

Mods String Extractor

PyPI version

从 Minecraft modpack 的 mods 中提取待翻译字符串,并在翻译完成后一键打包成资源包。

功能

  • 🔍 自动扫描 mods 目录下所有 .jar 文件
  • 🌐 智能提取 待翻译字符串:
    • 如果 mod 已有 zh_cn.json,只提取 en_us.jsonzh_cn.json 的差集
    • 如果 mod 没有 zh_cn.json,全量提取 en_us.json
  • 📦 一键打包 翻译好的字符串为 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mods_string_extractor-1.0.2.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mods_string_extractor-1.0.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

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

Hashes for mods_string_extractor-1.0.2.tar.gz
Algorithm Hash digest
SHA256 8f4408e5c80c36de22dd26c4c4a790771bfca4ad330554273bb803d93a2b58ee
MD5 7d003ce0a5eb1eb2f0e95c153211d436
BLAKE2b-256 93f2bab4f35f407eef78c9a7121b3eefbfdf008a8012e98cf5469e5059c25c82

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mods_string_extractor-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mods_string_extractor-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 35dbe1bcb4558cb5f5fd3d72310922c5c850360b662f505b605dd4bcdd698d7f
MD5 5dc051e32f78a4f1974e710644dee87a
BLAKE2b-256 fbdfe5d9ae1ef8bd997a5991d5ed297673dffcd3e4cd1791de9c66bc2f2bf8b6

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page