Skip to content

translation patterns

Jinwoo Lee edited this page May 16, 2026 · 2 revisions

Translation Patterns — {0} / {1}

Some lines the game shows you aren't fixed strings — they're built at runtime with numbers, prices, or item names spliced in. The plugin handles them with pattern entries: translation lines that use numbered placeholders like {0} and {1}.

You'll see patterns scattered through translate.txt and translate_teletext.txt. They look like normal translation entries with placeholders in them:

PRICE TOTAL: {0} = 총 금액: {0}
TAKE MONEY {0} = 돈 가져가기: {0}
PAY POST ORDER {0} = 택배비 납부: {0}
CONDITION {0}% = 상태 {0}%
CURRENT BET {0} MK = 현재 베팅 {0} MK
KEYBOARD AND MOUSE {0} MK = 키보드 마우스 세트 {0} MK
pakkasta {0} astetta = 영하 {0} 도

At runtime, when the game renders PRICE TOTAL: 1234, the plugin sees 1234 matches the {0} slot in PRICE TOTAL: {0} and produces 총 금액: 1234. Same idea for pakkasta -5 astetta → 영하 -5 도.

This can also be useful for situations where the game generates a lot of similar lines with different values — for example, the "cigarettes left" counter that counts down from 20 to 0:

20 cigarettes left = 담배 20개비 남음
19 cigarettes left = 담배 19개비 남음
18 cigarettes left = 담배 18개비 남음
...

That's a lot of lines to write by hand, but with a pattern you can fold these into single line with {0} and the plugin handles the rest.

{0} cigarettes left = 담배 {0}개비 남음

Rules of thumb

  1. Keep every placeholder. If the source has {0} and {1}, your translation needs both. Dropping one will leave the slot un-substituted.
  2. Order can change. You can move {0} and {1} anywhere in your translation to fit your language's grammar. For example, STAND AT {0} could become {0}에서 중단 — the placeholder moved to the front, the rest of the phrase wrapped around it.
  3. {0} and {1} are distinct. If the source uses both, treat them as separate variables — {0} always refers to the first runtime value, {1} to the second.
  4. Surrounding text can be edited freely. Only the {n} tokens are special. Punctuation, spacing, units (MK, %), and prefixes/suffixes are all yours to rewrite.
  5. Don't add placeholders that aren't in the source. {2} won't match anything if the source only has {0} and {1}.

When the captured value should itself be translated

A pattern can capture a substring that is also a translatable phrase — for example, a phone-line format where {0} is the price digits but the surrounding text needs the localized PHONE label. The plugin supports several pattern modes for this internally, but as a translator you don't pick the mode — it's set by the file the entry lives in (the magazine price/phone pipeline is wired up via the PHONE entry in translate_magazine.txt; you just provide the label).

For everything you write by hand in translate.txt or translate_teletext.txt, treat {n} placeholders as "the game will paste a value here" and you're done.

If you're curious how it's wired up under the hood, the runtime architecture is in AGENTS.md — search for TranslationPattern.

Common patterns in the shipping pack

Worth knowing about so you recognize them on sight:

Source What {0} is
PRICE TOTAL: {0} A money amount
TAKE MONEY {0} A money amount
PAY POST ORDER {0} A money amount
UNPAID FINES, {0} A fine amount
CONDITION {0}% An integer percentage
CURRENT BET {0} MK A bet amount in markka
<item name> {0} MK An item price
pakkasta {0} astetta Temperature in degrees (teletext weather)

Clone this wiki locally