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.1.tar.gz (19.4 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.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mods_string_extractor-1.0.1.tar.gz
  • Upload date:
  • Size: 19.4 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.1.tar.gz
Algorithm Hash digest
SHA256 860d5c38fd4fd5d0a089da370fb355db75d176ad5081b36f59547b8053270e43
MD5 bdd10e66a09f859cedc8fdbfc780fab1
BLAKE2b-256 f4311c25a6b759971d30a820d4ee6fe422723c5c48987cf9918522eb2fe14d3e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mods_string_extractor-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 053517bcb8251e6d914734a0475a45811e37e231d3e1f02503fe2dd296f59304
MD5 3b8d19b23b8b86a58e4042db79ca25a4
BLAKE2b-256 1c6b10647b738c4b24d36316ec1f78ea87fbdd64fee20d8c0a98ddc2cd1d199d

See more details on using hashes here.

Provenance

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