Skip to main content

FTB Quest Localization Tool - Extract and manage quest strings for easy localization

Project description

FTB Quest Localizer

PyPI version Python Version License

English | 中文

A tool for extracting and managing FTB Quest localization strings. Supports both new format (1.20+, with lang/ directory) and old format (pre-1.20, inline strings in chapter files).

Installation

From PyPI:

pip install ftb-quest-localizer

From source (using uv):

git clone https://github.com/zack-zzq/FTBQuestLocalizerPython
cd FTBQuestLocalizerPython
uv sync

Usage

The tool provides three commands: split, extract, and merge.

split — New Format (1.20+)

Split SNBT lang files from lang/en_us/ into per-chapter JSON files for translation:

ftb-quest-localizer split -i <ftbquests/quests> -o <output_dir>

This reads the lang/en_us/ directory and outputs one JSON file per chapter, plus separate files for chapter groups, reward tables, etc.

extract — Old Format (pre-1.20)

Extract translatable strings directly from chapter SNBT files:

ftb-quest-localizer extract -i <ftbquests/quests> -o <output_dir> -m <modpack_name>

This replaces inline strings with translation keys and generates an en_us.json language file.

merge — Merge Translations Back

Merge translated JSON files back into SNBT lang directory structure:

ftb-quest-localizer merge -i <json_dir> -o <output_lang_dir>

This recreates the same structure as lang/en_us/ (chapter.snbt, chapter_group.snbt, chapters/*.snbt, etc.) for direct use in a modpack.

As a Python Library

from ftb_quest_localizer.splitter import split_lang_files
from ftb_quest_localizer.extractor import extract_quest_strings
from ftb_quest_localizer.merger import merge_json_to_lang_dir

# New format: split SNBT lang files into JSON
split_lang_files("path/to/ftbquests/quests", "output/")

# Old format: extract strings from chapter files
extract_quest_strings("path/to/ftbquests/quests", "output/", "modpack_name")

# Merge translated JSON back into SNBT
merge_json_to_lang_dir("translated_json/", "lang/zh_cn/")

How It Works

New Format (1.20+)

  1. Reads SNBT lang files from lang/en_us/ (chapter, quest, task, reward entries)
  2. Flattens multi-line descriptions into numbered keys
  3. Groups entries by chapter and outputs per-chapter JSON files
  4. Merge reconstructs the original directory structure from translated JSON

Old Format (pre-1.20)

  1. Parses chapter SNBT files using snbtlib
  2. Extracts title, subtitle, description, text, and hover text fields
  3. Replaces original text with translation keys
  4. Generates JSON language files with the original text

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

ftb_quest_localizer-2.0.3.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

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

ftb_quest_localizer-2.0.3-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file ftb_quest_localizer-2.0.3.tar.gz.

File metadata

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

File hashes

Hashes for ftb_quest_localizer-2.0.3.tar.gz
Algorithm Hash digest
SHA256 0883d4e1780303e13d306aa4673cd943c3c128e7fdf551acd6dab5678dd14796
MD5 97a2f22b909f2eb8b1bb1303a07791ab
BLAKE2b-256 2049b62645ca3c1f0b58000d31accbf88c7623b92b76299bf8fa6193a6260858

See more details on using hashes here.

Provenance

The following attestation bundles were made for ftb_quest_localizer-2.0.3.tar.gz:

Publisher: publish-to-pypi.yml on zack-zzq/FTBQuestLocalizerPython

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

File details

Details for the file ftb_quest_localizer-2.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ftb_quest_localizer-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 494f71c6e825dab150d6dd1e06d25037839a0765c4b1b37d4b53ab3f3635f7a4
MD5 632d7b703ba865e3ecc55c99c80458d5
BLAKE2b-256 08ef1133449191f039e4ca6310c8c603d7201d4e42eddbb02462eda154641295

See more details on using hashes here.

Provenance

The following attestation bundles were made for ftb_quest_localizer-2.0.3-py3-none-any.whl:

Publisher: publish-to-pypi.yml on zack-zzq/FTBQuestLocalizerPython

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