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.0.tar.gz (17.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.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file mods_string_extractor-1.0.0.tar.gz.

File metadata

  • Download URL: mods_string_extractor-1.0.0.tar.gz
  • Upload date:
  • Size: 17.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.0.tar.gz
Algorithm Hash digest
SHA256 1c2fef5900f8ccb904b4c2c3c3eb6bda59ec82bd83d67f4614c1ff9b98dde57d
MD5 5b05fa15fee24294ce5380b5a873bde1
BLAKE2b-256 73c3619d869a94d7399e1eb0ddaf1f844b7527071fa7963b5f37a61cbf8ae624

See more details on using hashes here.

Provenance

The following attestation bundles were made for mods_string_extractor-1.0.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mods_string_extractor-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d4032fc6ae363debb6d199d4ced6890319643121547e5acd1f3551724e459c8
MD5 0094e67be30978e363e8a2d88032f611
BLAKE2b-256 506d42ccdbec8af602a40d864a2b91bbb83a40000c0eefceb772474c0e9f0194

See more details on using hashes here.

Provenance

The following attestation bundles were made for mods_string_extractor-1.0.0-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