Skip to main content

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.json for each.
    • If a mod JAR contains zh_cn.json, it's copied; otherwise, en_us.json is copied to zh_cn.json.
    • Performs initial synchronization of zh_cn.json with en_us.json (adds missing keys, removes extra keys).
    • Creates the necessary assets/<mod_id>/lang structure in your resource pack.
    • Saves the mod state for future comparisons.
  • 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.json files for updated mods.
    • Comprehensive Language Synchronization: Ensures all zh_cn.json files in the resource pack are synchronized with their corresponding en_us.json files (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.

  1. Ensure Python 3.11+ is installed.
  2. Install uv:
    pip install uv
    
  3. Clone the repository:
    git clone https://github.com/QianFuv/UpLang.git
    cd UpLang
    
  4. 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 where assets folder 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


Download files

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

Source Distribution

uplang-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

uplang-0.1.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

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

Hashes for uplang-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1eb35325fea1416d607949adedd735da35705f25818d027fc8876b484c3e0f06
MD5 68b836a1b06351c23ad144dcc55ef41a
BLAKE2b-256 6a4f41413adb715ff4f4b52a8e1d37f1735fc2e75f2406ec8266d950366362c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for uplang-0.1.0.tar.gz:

Publisher: publish-to-pypi.yml on QianFuv/UpLang

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

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

Hashes for uplang-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf500c1d1c012e3557ce0d1103d9845951e0e0d3decdeb8e71e1e7f4850acef6
MD5 2831b5dac8ecffffb04f9eb37e09d3c5
BLAKE2b-256 b8b3cd5741527a51948c94f8c090e7cda2aae6c39427ee62e0e7eaa71d47f749

See more details on using hashes here.

Provenance

The following attestation bundles were made for uplang-0.1.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on QianFuv/UpLang

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