EnglishУкраїнськаGitHub

Localization Pipeline

Language: English · Українська

Open with Tools → Localization Pipeline…. Window title: Localization Pipeline.

The dialog is deliberately thin (ui/pipeline_wizard_dialog.py): it computes no pipeline of its own. Every button runs the same QAction as the Tools menu. Steps that are whole workflows are embedded in the right pane instead of opening a second window.

Left: a tree of steps with a status icon and a count. Right: the tool, or an explanation plus a run button. Footer: Refresh and Close. Coming back to the window re-reads the project after 250 ms.

Headline: Localization pipeline — N / M steps complete.

Icon State (core/pipeline_status.py)
⚪ not started
🟡 partial
✅ done

Which steps you see

steps_for(plugin.get_capabilities()). An empty capability set is valid: you still get every step that works on extracted text. A step with requires="…" appears only if the active plugin declared that name.

Recognised capability names (from plugins/base_game_rules.py):

Capability What the plugin must implement Wizard effect
glossary_seed get_glossary_seed_entries() Seeds the glossary from game data
external_lore get_external_lore(term) Extra describe-pass material
speaker_attribution get_speaker_for_string() Shows Name the speakers
message_window_preview window chrome / pagination Preview chrome (not a wizard step)

Twilight Princess (plugins/zelda_bmg) declares all four. Default Plugin Template declares none.


The steps (as shipped)

Order in STEPS:

1. Mark up the script (markup)

Embedded: Script Markup Studio (Close hidden; host Close is the wizard’s).

A walkthrough is prose. Markup says which line is a speaker and which is speech. Merge Speakers and the Context Builder read this file.

Status: markable (non-blank) source lines covered by approved marks, excluding type Unmarked. “No script found for this game” vs “script not marked up” are different.

Do: finish markup before Merge Speakers. Do not skip it and hope ALL-CAPS guessing will name the cast.

Details: 9. Script Markup.

2. Name the speakers (speakers) — child of markup

Shown only if speaker_attribution is in capabilities.

Button: Merge speakers from the script → merge_speakers_action.

The game groups lines by voice (Voice 8, placement names). The script has display names. This joins them on line text (SpeakerMergeHandler.merge_from_script). Needs an open project and get_speaker_for_string. If markup speaker lines are missing, it may guess from ALL-CAPS and warn. Apply saves aliases beside the project. Names then reach the Speaker field, virtual folders, translation prompts, and glossary seeds.

Status: named placeholder codes / total placeholder codes the plugin still reports.

Do merge before a glossary auto-pass if you want characters seeded under the decided name rather than CLERK_B. Do not vote a script line onto the plugin’s System speaker (TP: signs, credits, item windows, location plates, howling stones, boss cards).

3. Build the story context (context)

Embedded: MemePalace Context Builder (its own Close / Done buttons are hidden; Stop stays while a job runs).

Copies markup into MemePalace and links each game line to a place in the story.

Window title MemPalace Context Builder. Tab 1. Source: Select project…, Import/Sync, Continue to Story Context →. Then:

Steps 2–3 need an AI provider. They do not invent glossary terms and they do not replace Merge Speakers.

Status: all-or-nothing — “story context built” if a MemePalace DB path exists, else “no story context yet”.

Without this step, translation still works as “translate this sentence”. With it, the prompt can know the scene.

Do run step 1 before timeline/voices. Do not expect voices to work before lines are linked.

4. Prepare and enrich the glossary (glossary)

Embedded: Prepare Glossary (GlossaryPipelineHandler with target_step="auto").

One automatic pass:

  1. Seed terms from game data (get_glossary_seed_entries) and from Script Markup characters.
  2. Rename seeds using Merge Speakers aliases (one voice that names several characters becomes several terms, never "A / B").
  3. Sweep selected project blocks for missing terms.
  4. Build descriptions from available context.
  5. Propose translation variants.

The pass does not stop for questions. Ambiguities stay as AI notes / review backlog.

UI (auto mode):

Status: empty → “automatic pass not run”; else N terms; M awaiting review (unconfirmed entries). Partial until the review backlog is empty.

Manual glossary: Glossary… / Ctrl+G. Same store. Features a direct Force Retranslate... button (with automatic glossary.json.bak backup creation) to re-translate all terms via AI and update proposals in place. When a reference patch is loaded, reference variants from external patches are styled distinctly (cyan/italic), blocked from double-click application, and kept separate in AI notes (with automatic context from mention lines when no explicit variant exists).

Do configure AI first (11, 5). Do not treat unconfirmed entries as a blocker for translating text.

Other launch titles exist in GlossaryBuildDialog for non-auto routes (Sweep Text with AI, Describe Glossary Terms, Build Glossary from Text) with depths:

Radio Meaning
Thorough (recommended) Sweep, then describe from every occurrence
Draft (fast, rough) One sweep; first-seen descriptions; unconfirmed
Structural seed only (no AI) Game tables + markup names only
Augment existing entries Describe existing terms; no sweep
Translate existing entries only Propose translations for described-but-untranslated terms

Chunk size: Local / small (2000), Balanced (4000), Cloud / large (8000).

How the glossary stays consistent

Series glossaries (shared by the games of a series)

Glossaries shared by several projects: a game (its GC and HD projects), a generation, a whole series. Each is a glossary.json-shaped file (core/glossary/series.py). A project has a chain of them, nearest first; the project glossary wins, then a nearer level over a farther one.

5. Translate the text (text)

Features embedded action buttons directly in the right pane: - Translate Story First (Chronological): Translates main narrative dialogue lines in chronological order, so the story text is settled first. - Translate Remaining Blocks (Semantic & System): Translates menus, shops, and system text after the story, with the same glossary and per-line context. - Run Full Pipeline (Story ➔ Semantic): Runs the complete automated multi-agent pipeline (Story first, then the remaining blocks).

Translation can also be triggered from the editor (AI Translate, selection right-click, main toolbar AI button, or Tools → AI Batch Translation ➔).

Status: non-empty rows whose current text differs from the original. Lines kept identical (names, numbers) undercount on purpose.

See 11. AI Translation.


Appendix: the automatic glossary pass in detail

Where it starts. Tools → Prepare Glossary…, the wizard step Prepare and enrich the glossary, and the button inside the Glossary dialog all open the same route. The internal modes (seed, thorough, augment, translate) remain as building blocks; nobody has to run them in order.

Files. The glossary is <project folder>/glossary.json. Beside it the pass keeps glossary.scan.json: fingerprints of the blocks already swept. It is bookkeeping for incremental runs, not a second glossary.

Scope. With only part of the project ticked, global structural entries that belong to no block are not mixed into the partial pass. A block whose content did not change is not swept again; Re-scan every selected block with AI forces the long full sweep and still does not overwrite anything a person confirmed.

What merges. An exact normalized match joins an existing entry without touching confirmed translations and descriptions. A fuzzy match never merges by itself — the pair is shown for a person to decide.

In the Glossary dialog the data is kept apart: Description (the clean summary used for translation), Proposed variants (candidates with a rationale each), AI notes and unresolved choices (sweep observations, alternative translations, evidence of who a character is, possible duplicates), Occurrences.

The report after a pass shows a remainder instead of "done": entries awaiting review, entries with several variants, entries without a translation or a description, possible duplicates. Review glossary opens the queue; Continue in editor returns to translating even when the queue is not empty.

Checking a pass by hand (ten minutes, two small blocks):

  1. Run the pass for the two blocks only: seed → sweep → describe → translate go through without a pause.
  2. In the Glossary dialog, description and AI notes are in different panes; an ambiguous term has several variants with different rationales.
  3. Run the same blocks again: nothing is swept. Change one string in one block and run again: only that block is swept.
  4. Confirm a translation by hand and run again: it stays. Tick the full re-scan: sources are read again, the confirmed entry still stays.

Recommended order

  1. Markup
  2. Merge Speakers (if the plugin has speaker_attribution)
  3. Context Builder step 1 (optional 2–3)
  4. Prepare Glossary
  5. Translate in the editor, with glossary + speaker + scene in the prompt

You can still open every tool from Tools without the wizard.


What not to do