A command-line tool to streamline the process of updating language files for Minecraft Java Edition modpacks.
Project description
UpLang
UpLang is a command-line tool designed to streamline the process of updating language files for Minecraft Java Edition modpacks. It assists localization teams by automatically detecting changes in mods (new, updated, or deleted) and synchronizing new translation keys into the resource pack. It also ensures consistency between English and Chinese language files, adding missing keys and removing obsolete ones.
Features
- Mod Scanning: Automatically detects new, updated, and deleted mods in your modpack directory.
- Initial Setup (
uplang init):- Scans mods and extracts
en_us.jsonfor each. - If a mod JAR contains
zh_cn.json, it's copied; otherwise,en_us.jsonis copied tozh_cn.json. - Performs initial synchronization of
zh_cn.jsonwithen_us.json(adds missing keys, removes extra keys). - Creates the necessary
assets/<mod_id>/langstructure in your resource pack. - Saves the mod state for future comparisons.
- Scans mods and extracts
- Update Checking (
uplang check):- Compares the current mod state against the last known state.
- Reports new, updated, and deleted mods.
- Automatically merges new translation keys into
zh_cn.jsonfiles for updated mods. - Comprehensive Language Synchronization: Ensures all
zh_cn.jsonfiles in the resource pack are synchronized with their correspondingen_us.jsonfiles (adds keys present in English but missing in Chinese, removes keys present in Chinese but missing in English).
- Cross-platform Compatibility: Designed to work on Windows, macOS, and Linux.
Installation
UpLang is built with Python 3.11 and uses uv for dependency management.
- Ensure Python 3.11+ is installed.
- Install
uv:pip install uv
- Clone the repository:
git clone https://github.com/QianFuv/UpLang.git cd UpLang
- Install dependencies with
uv:uv pip install -e .
Usage
uplang init <mods_dir> <resource_pack_dir>
Run this command once for a new project or when setting up a new resource pack.
<mods_dir>: The absolute or relative path to your Minecraft modpack's mods directory (e.g.,C:\Users\YourUser\AppData\Roaming\.minecraft\mods).<resource_pack_dir>: The absolute or relative path to your resource pack's root directory whereassetsfolder will be created (e.g.,C:\Users\YourUser\Desktop\MyResourcePack).
Example:
uplang init "C:\Users\YourUser\AppData\Roaming\.minecraft\mods" "C:\Users\YourUser\Desktop\MyResourcePack"
uplang check <mods_dir> <resource_pack_dir>
Run this command whenever you update your mods. It will detect changes and synchronize language files.
<mods_dir>: The absolute or relative path to your Minecraft modpack's mods directory.<resource_pack_dir>: The absolute or relative path to your resource pack's root directory.
Example:
uplang check "C:\Users\YourUser\AppData\Roaming\.minecraft\mods" "C:\Users\YourUser\Desktop\MyResourcePack"
Testing
The project includes a full suite of automated integration tests.
To run the tests, execute the following command from the project root:
uv run pytest tests/test_integration.py
This command will set up dummy mods, run both the init and check commands, and verify that the outcomes are correct, including language file synchronization.
Contributing
We welcome contributions to UpLang! Please see our CONTRIBUTING.md for guidelines on how to contribute.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 uplang-0.1.0.tar.gz.
File metadata
- Download URL: uplang-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1eb35325fea1416d607949adedd735da35705f25818d027fc8876b484c3e0f06
|
|
| MD5 |
68b836a1b06351c23ad144dcc55ef41a
|
|
| BLAKE2b-256 |
6a4f41413adb715ff4f4b52a8e1d37f1735fc2e75f2406ec8266d950366362c6
|
Provenance
The following attestation bundles were made for uplang-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on QianFuv/UpLang
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uplang-0.1.0.tar.gz -
Subject digest:
1eb35325fea1416d607949adedd735da35705f25818d027fc8876b484c3e0f06 - Sigstore transparency entry: 528695427
- Sigstore integration time:
-
Permalink:
QianFuv/UpLang@448a937f650a883c362f6e4085c6688e0232bc1b -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/QianFuv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@448a937f650a883c362f6e4085c6688e0232bc1b -
Trigger Event:
release
-
Statement type:
File details
Details for the file uplang-0.1.0-py3-none-any.whl.
File metadata
- Download URL: uplang-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 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 |
bf500c1d1c012e3557ce0d1103d9845951e0e0d3decdeb8e71e1e7f4850acef6
|
|
| MD5 |
2831b5dac8ecffffb04f9eb37e09d3c5
|
|
| BLAKE2b-256 |
b8b3cd5741527a51948c94f8c090e7cda2aae6c39427ee62e0e7eaa71d47f749
|
Provenance
The following attestation bundles were made for uplang-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on QianFuv/UpLang
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uplang-0.1.0-py3-none-any.whl -
Subject digest:
bf500c1d1c012e3557ce0d1103d9845951e0e0d3decdeb8e71e1e7f4850acef6 - Sigstore transparency entry: 528695445
- Sigstore integration time:
-
Permalink:
QianFuv/UpLang@448a937f650a883c362f6e4085c6688e0232bc1b -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/QianFuv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@448a937f650a883c362f6e4085c6688e0232bc1b -
Trigger Event:
release
-
Statement type: