Skip to main content

更新 MC Java 整合包语言文件的命令行工具

Project description

logo

UpLang

更新 MC Java 整合包语言文件的命令行工具

Python Version Coverage Stars
Pypi downloads Pypi version Repo Size Stars License

1. 安装

1.1 要求

  • Python >= 3.13
  • pip 或 uv 包管理器

1.2 使用 pip 安装

pip install uplang

1.3 使用 uv 安装

uv add uplang

1.4 从源代码安装

git clone https://github.com/QianFuv/UpLang
cd UpLang
uv pip install -e .

2. 主要命令

2.1 同步语言文件

将 mods 目录中的语言文件同步到资源包:

uplang sync <mods目录> <资源包目录>

选项:

  • --dry-run - 模拟运行,不修改文件
  • --force - 忽略缓存,处理所有 mod
  • -p, --parallel <数量> - 并行工作线程数(默认: 4)
  • --force-english-on-change - 英文翻译更改时覆盖已有中文翻译

2.2 检查差异

检查差异而不进行同步:

uplang check <mods目录> <资源包目录>

2.3 列出 mod 信息

列出所有 mod 及其语言文件:

uplang list <mods目录>

2.4 提取语言文件

从单个 mod JAR 文件提取语言文件:

uplang extract <mod文件.jar> <输出目录>

2.5 显示详细差异

显示单个 mod 的详细差异:

uplang diff <mod文件.jar> <资源包目录>

2.6 导入翻译

从资源包 zip 文件导入翻译:

uplang import <zip文件> <资源包目录>

选项:

  • --dry-run - 预览变更而不修改文件
  • --overwrite - 覆盖已有翻译(默认:仅导入未翻译的条目)

2.7 清理孤立文件

删除不存在的 mod 的语言文件:

uplang clean <mods目录> <资源包目录>

选项:

  • -y, --yes - 跳过确认,直接删除

2.8 翻译统计

显示翻译统计信息:

uplang stats <资源包目录>

2.9 格式化 JSON

修复 JSON 格式并同步键顺序:

uplang format <资源包目录>

选项:

  • --dry-run - 检查而不修改文件
  • --check - 仅检查问题,不修复

2.10 缓存管理

清除缓存以强制完全同步:

uplang cache clear <资源包目录>

2.11 Web 翻译界面

启动 Web 界面进行可视化翻译管理:

uplang web <资源包目录>

选项:

  • --host <地址> - 服务器主机地址(默认:127.0.0.1)
  • --port <端口> - 服务器端口(默认:8000)
  • --no-open-browser - 不自动打开浏览器

2.12 全局选项

所有命令都支持以下全局选项:

  • -v, --verbose - 启用详细输出
  • -q, --quiet - 静默模式(仅显示错误)
  • --no-color - 禁用彩色输出
  • --log-file <路径> - 指定日志文件路径
  • --version - 显示版本信息
  • --help - 显示帮助信息

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-1.1.0.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

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

uplang-1.1.0-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

Details for the file uplang-1.1.0.tar.gz.

File metadata

  • Download URL: uplang-1.1.0.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for uplang-1.1.0.tar.gz
Algorithm Hash digest
SHA256 54f937e878654906c828fef1edc1ab2a495fad6fc2a13f4d790d4eae20c5fefd
MD5 f1160c65ff23b0c35856442255279a09
BLAKE2b-256 4868349d893bfcce118ddef5fb24805348a8917cacb06720c89a528533a4d993

See more details on using hashes here.

Provenance

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

Publisher: publish.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-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: uplang-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for uplang-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e785ba50ff34d568bed858998cd1f4ce2897aa8dd686004a5c756864200dbed
MD5 759080aa8fa10fa977840d94abd03479
BLAKE2b-256 a314544a3683253ca7e7a8c0eb9d1b9d3a5b0548dd43549222d14fbc098a81b2

See more details on using hashes here.

Provenance

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

Publisher: publish.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