Wiki › Project

Loc Translate

Project · agent skill · 2026

Loc Translate is a free, open-source agent skill, written in Python, that translates locale files for game mods and apps into any language without breaking a single token. It is the translation step of his Localization Kit, which shares a glossary with Glossary Forge.

The problem

Game dialogue files are full of control codes: {{x}}, #$b#, $h, @, ^, %item … %%, {0} and markup tags. If a translator, human or AI, moves, drops or translates one of these, the game shows garbage or crashes.

How it works

  • Locks every token behind a numbered placeholder before translation. After translation it checks the placeholders' count and order and the dialogue structure before writing anything back. Lines that fail are rejected with the reason and sent back for another try.
  • Keeps the file intact: translator comments, key order, trailing commas and formatting all survive. New keys appear where the source has them.
  • Gives the agent context:
    • translator notes taken from comments;
    • speaker hints taken from keys;
    • glossary terms for each line;
    • a style guide for game dialogue, and notes for each language.
  • Reuses translations: identical strings already translated elsewhere are offered, or filled in automatically.
  • Builds a review page, l10n/review.html, with source and translation side by side and every token highlighted.
bash
python3 scripts/loctx.py init --target th
python3 scripts/loctx.py prepare
python3 scripts/loctx.py apply
python3 scripts/loctx.py review

A real run

The README's example translates 16 lines of a character's story from GI Extra Locations – Redux into Thai, keeping his voice consistent (ฉัน/คุณ, without polite particles). It protected 28 tokens and rejected none.

See also

In the knowledge graph

Loc Translate and the 10 things it is linked to. Open any dot for its page, or explore it in the full graph.

When
2023202420252026
Oct 2026 · 2 commits

As data

Everything on this page is read from triples in the knowledge graph. These are the 23 it states about Loc Translate, and 2 more its ontology implies; the console runs SPARQL over the whole graph, here in your browser.

Download
@prefix id: <https://ask.chaipat.cc/id/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix cj: <https://ask.chaipat.cc/ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

id:LocTranslate
    a cj:Project ;
    rdfs:label "Loc Translate" ;
    cj:description "Agent skill that translates game-mod and app locale files into any language without breaking tokens." ;
    cj:context id:OpenSource ;
    cj:repository "https://github.com/AppleBoiy/loc-translate"^^xsd:anyURI ;
    cj:firstCommit "2026-10-27"^^xsd:date ;
    cj:lastCommit "2026-10-27"^^xsd:date ;
    cj:commitCount 2 ;
    cj:kind "agent skill" ;
    cj:license "MIT" ;
    cj:theme id:ThemeAgentSkills , id:ThemeLocalisation ;
    cj:uses id:Python , id:AgentSkillsStd , id:Localisation ;
    cj:tier 2 ;
    cj:implements id:TokenLocking ;
    cj:partOf id:LocalizationKit ;
    cj:relatedTo id:StardewThai ;
    cj:mentions id:GlossaryForge ;
    cj:article "https://ask.chaipat.cc/wiki/LocTranslate"^^xsd:anyURI ;
    cj:activeIn id:Y2026 ;
    cj:activity _:b95 .