Repository navigation
translation patterns
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}개비 남음
-
Keep every placeholder. If the source has
{0}and{1}, your translation needs both. Dropping one will leave the slot un-substituted. -
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. -
{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. -
Surrounding text can be edited freely. Only the
{n}tokens are special. Punctuation, spacing, units (MK,%), and prefixes/suffixes are all yours to rewrite. -
Don't add placeholders that aren't in the source.
{2}won't match anything if the source only has{0}and{1}.
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.
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) |
Getting Started
Translation Files
- Configuration
- translate.txt
- translate_magazine.txt
- translate_teletext.txt
- Optional Files
- Translation Patterns
Advanced
- Text Adjustments
- Testing & Debugging
- Creating font assetbundle
- Creating texture pack
- Setting up development environment
Community