Language packages
A language package presents a game’s text in another language. It changes no script, and no asset outside the language it gives versions for. The scripts keep running on their own text, and the port translates each string as it is drawn. Saves, history and read flags therefore stay those of the original game, and a save made in one language loads in any other.
This page is the reference. For a walkthrough from an empty folder to a shared package, start with translating.md.
Language packages run in the port only. Native AGE draws the text its scripts hold, so omp export leaves a
package’s text and language assets out (with a note).
Layout
Section titled “Layout”A language package is an ordinary Open Maid Pack (packages.md) with format version 2 and two more folders:
<mod>/├── manifest.toml omp = 2, with a [[language]] table├── text/│ └── <tag>/ catalogs (*.toml), in subfolders if you like├── fonts/ font files the language uses (optional)└── assets/ └── <tag>/ images and sounds shown only in that language (optional)<tag> is a lowercase BCP 47 language tag: en, pt-br, zh-hant. Catalog file names are free. Within a
language folder the files load in path order (_global.toml before SC0100.toml, a/x.toml before b.toml), and a
later file wins over an earlier one at the same scope.
A package may also hold patches, scripts or assets. It is then an ordinary content mod that happens to carry text, and its save stamps say so (see “Saves” below).
Making one
Section titled “Making one”-
Extract templates from your install. This writes one catalog per script with its messages and the patterns for the strings it builds, plus
_global.tomlwith every literal the scripts draw or store:Ome.Cli omp text extract --language en --output my.lang <game options>Every entry it writes has a
sourceand notext. An entry withouttextis a template: the port skips it. For a language the engine has no menus of its own for (it has Japanese and English), it also writes_engine.tomlwith a template for each of the engine’s strings (“Engine text” below). -
Translate by adding
text = "…"to the entries you translate. Leave the rest as they are, or delete them. -
Write the manifest (below), with
omp = 2and a[[language]]table for the language. -
Check the package without starting the game:
Ome.Cli omp text check --mod my.lang <game options> -
Run it in the port with
--mod my.lang --language en, or install it inmods/and pick the language in the settings panel’s OME section, which lists every language the installed packages define by itsname(or with[ui] LanguageinOME.INI). Add--text-logto collect every string that reached the screen without an entry, and every message narrowed or cut to fit its window (cli.md).
A switch in the settings panel applies at once to the menus and to text drawn after it. Text already on screen stays until the game draws it again; everything is in the new language after returning to the title.
The game driver switches the same way with its language TAG step, so a test can check a page before and after a
switch (cli.md, “Automated testing”).
Run extract again after a game update, or whenever you want the templates current: it keeps every entry the folder
holds, translated or not, adds templates for sources no file has yet, and marks obsolete = true each entry whose
source the scripts no longer draw or store (an obsolete entry is skipped, like a template). It rewrites only the
files whose entries changed, and it does not keep comments, so write notes for translators in note.
From a translation made in place
Section titled “From a translation made in place”Some translations replace the game’s own scripts and images in an install. import-scripts turns such an install
into a package for the port. It compares each translated script with the original and writes the translated text as
catalog entries. With --package it also writes the images the translation replaced to assets/<tag>/, each AGF
as a PNG. When the folder has no manifest, it writes one with the language’s [[language]] table:
Ome.Cli omp text import-scripts --from TRANSLATED_ROOT --output my.lang --language en --package <game options>- The game options name the original install.
--overlay-rootand--allow-bmp-as-agfapply to the translated install, as it is played without the port. --verifyreads the catalogs back and checks every message against the translated scripts.- The summary and
import-report.jsonlist what could not be carried. - The manifest’s
glyph_delay_scaleis the original’s character count divided by the translation’s. Itsidandnameare placeholders, and it has noauthors: edit them, and name the translators inauthors, since the importer leaves an existing manifest unchanged. Whatever shows the package’s text elsewhere, such as the game data export, credits it by these. - Run the result as any package, with
--mod my.lang --language en.
The text and images remain their translators’ work. The package is for playing a translated install you already have; share it only with the translators’ permission.
Manifest
Section titled “Manifest”omp = 2id = "fan.himegari-en"name = "English text"version = "1.0.0"
[game]profile = "<game>"target = "native"
[[language]]tag = "en"name = "English" # the language's own namefallback = [] # optional: the languages to try next; default is the tag's parentsline_break = "words" # "words" (default) or "anywhere"measure = "presented" # "presented" (default) or "source"digits = "ascii" # "keep" (default) or "ascii"glyph_delay_scale = 0.5 # reveal speed factor, above 0 and at most 4; default 1min_fit_scale = 0.6 # the narrowest fit and overflow make glyphs; default 0.75overflow = "shrink" # "shrink" (default) or "cut"
[[language.font]]requested = ["*"] # the game's faces this applies to; "*" for alluse = ["fonts/NotoSans-Regular.ttf", "Georgia"][[language]] needs omp = 2; a version 1 manifest with one is an error. Unknown keys are errors, as everywhere in
a manifest.
| Key | Meaning |
|---|---|
tag |
the language. Not ja (the source) or x-pseudo (the port’s test language) |
name |
the language’s own name |
fallback |
the chain tried after this language, before the source text. Without it, a tag’s parents: pt-br then pt |
line_break |
where presented text may wrap: words breaks after spaces and hyphens and between CJK characters; anywhere between any two characters |
measure |
what the scripts’ length opcodes measure: the presented text, so a name plate sized from a name fits the translated name, or the source text, so the game’s state never depends on the language. Presented text counts as the game counts its own: a character’s CP932 bytes, and for a character CP932 lacks 2 if Unicode marks it wide, else 1 |
digits |
ascii presents full-width digits (12) in numbers the scripts build as ASCII |
glyph_delay_scale |
scales the reveal’s delay per glyph for translated text. English has about twice the glyphs of Japanese per sentence, so 0.5 keeps the pace |
min_fit_scale |
the narrowest an entry’s fit = "shrink", or overflow, makes its glyphs, as a share of their width: above 0 and at most 1; default 0.75 |
overflow |
what a message that needs more rows than its window has does: shrink (default) narrows its glyphs just enough to fit; cut cuts it at the window’s bottom. Below |
[[language.font]] |
font mappings, below |
Several packages, one language. A package may add text to a language another package defines: give it
text/<tag>/ and no [[language]] table. Their catalogs merge in load order, and the later package wins at equal
scope. When two packages both declare the language, each key the later one sets wins, and the link report names it.
If no package in the stack defines a language that one adds text to, the link stops.
Catalogs
Section titled “Catalogs”script = "SC0100" # optional: the default scope of every entry in this filefingerprint = "sha256:…" # required only when an entry uses `at`
[[text]]source = "やっと匠士になる事が出来た。"text = "I'm finally a Tradesman."
[[text]]source = "はい"at = 0x2a43text = "Right."
[[text]]script = "" # global, whatever the file's scopesource = "黒石"text = "Black Stone"note = "item name"| Key | Meaning |
|---|---|
source |
the text as the game has it: a message, a literal, or a pattern |
text |
the translation. Without it the entry is a template and is skipped. \n forces a line break |
script, at |
the scope, below |
obsolete |
true skips the entry; omp text extract sets it when the source is gone |
measure |
this string’s measurement, over the language’s |
row_gap |
pixels between the rows of a draw-string whose text holds \n, beyond the font’s height; default 2 |
note |
for translators; the port ignores it |
align, fit |
where the translation sits and how narrow it may get, against the original text: below |
A file that does not read stops the link (and the port) with every problem, its file and its line.
An entry matches the exact source text. A scope narrows where:
| Scope | Written as | Matches the text |
|---|---|---|
| global | script = "", or no scope in a file without one |
wherever it is drawn |
| script | script = "STATUS" |
where that script draws it, or where it was stored by that script |
| site | script and at = 0x… |
at that one instruction |
The narrowest entry wins, then a later file or package. at is the instruction’s dword offset in the original
script; a message’s is its first show-text’s, as --text-log writes it. The F3 locator prints the page’s last
show-text (text SC0100@0x2a43), the same instruction for a message drawn in one piece, when no mod patches that
script. A file with site entries
gives the script’s fingerprint (Ome.Cli oms-patch --fingerprint SC0100.BIN). Site entries bind only to that
revision of the script:
- in a script another mod patches, they move with their instructions; an entry on an instruction a patch replaced is dropped;
- in a script a mod replaces, or one whose fingerprint differs, they are all dropped.
The link report and the port’s [text] lines say what was dropped and why. With a patching mod loaded, the
locator prints the patched script’s offsets: take at from a run without it, or from extract.
A string stored in a table and drawn later (an item name, a quest line) is looked up at the instruction that stored
it too, so text/en/QUINIT.toml with script = "QUINIT" translates what QUINIT stores.
Messages
Section titled “Messages”A sentence the script draws in pieces (text, a word with furigana, more text) is one entry: its pieces joined,
without the ruby and without the script’s line breaks. extract writes the authored line breaks into note. The
translation wraps on its own; keep \n only for breaks that are structure, such as a header line.
Patterns
Section titled “Patterns”A string the scripts build at runtime matches a pattern:
[[text]]script = "SHOP"source = "{item}を{count:num}個手に入れた"text = "Got {count} {item}"{name}matches any non-empty text;{name:num}matches a number (half- or full-width digits, an optional minus).{{and}}are literal braces.- A pattern matches the whole string. Each capture is itself looked up, so
{item}comes out translated when it has an entry. - A pattern that starts or ends with a placeholder needs a script scope.
extractwrites a message with variables as{v1},{v2}, … and a string the scripts compose as a pattern scoped to the composing script.- Two patterns at one scope that can match the same string are an error in
omp text check.
Alignment and fit
Section titled “Alignment and fit”Some text sits where the script put the original: a title centred by its cursor, a name plate, an item name in a fixed box. Two keys place a translation against the room the original text took, from its first character to its last (spaces at either end do not count):
[[text]]script = "FELLOW"source = "鉄槌"text = "Iron Hammer"fit = "shrink" # narrow the glyphs to the original's roomalign = "end" # "start" (default), "center" or "end"align = "center"puts each line’s centre where the original’s centre was;"end"puts its end where the original’s end was. A line stays inside its window or surface: it moves no further left than the window’s left margin (or where the text starts, when that is further left), nor past the right edge.fit = "shrink"narrows every glyph of the translation by one factor, never below the language’smin_fit_scale. An original on one row gives the width: the translation’s widest line is made no wider than it. An original that took several rows in the text window gives the rows: the translation is narrowed only as far as it needs to wrap into no more rows. A message that still does not fit its window is narrowed further (below).- Both apply to text the game draws in its windows and to strings it draws onto pictures. History shows the text as written.
- A name plate the game sizes from the name’s length is sized from the translation (
measure, above); withmeasure = "source"it keeps the original’s size, andalign = "center"centres the name on it.
Text too long for its window
Section titled “Text too long for its window”A message that needs more rows than its window has would be cut at the window’s bottom, as the game cuts its own
text. The port wraps a translation at word breaks, where an in-place translation broke its lines by hand, and a
proportional face outside aspect mode does not keep to the half cells the scripts count (below, “Fonts”). A translation written
to the line lengths of an in-place one can therefore need a row more than it had there. By default
(overflow = "shrink") the port narrows such a message’s glyphs, all by one factor and only as far as it needs to
fit, never below min_fit_scale. The window is whatever the game’s script set up; nothing about it is per game.
- A message that fits, or one whose entry’s
fitalready made it fit, is drawn as before. - A message that does not fit even at
min_fit_scale, or whose own\nbreaks make more rows than the window has, is drawn at full width and cut. The port does not add a page. overflow = "cut"always cuts, as the game does.- History shows the text as written.
--text-log lists each narrowed message with the width it got (width_percent) and each cut one with the rows it
lost (rows_cut; cli.md). To fit a message without narrowing it, shorten it or patch the script to break
the page.
The port draws translated text with the system’s fonts by default. A [[language.font]] table maps the game’s
faces to others: requested lists faces ("*" for all), and use lists files under the package’s fonts/ and
font family names, tried in order. The first table whose requested names a face wins. A character the listed fonts
lack falls back to the next font, then to the system’s.
fonts/holds.ttf,.otf,.ttc,.woffand.woff2files, at most 64 MiB each, without subfolders. Each bundled file ausenames must be in the package.- A bundled font has only its own weight. Where the game asks for bold and the font has no bold style, the port draws it bold as Windows does for such a face (each letter one pixel wider).
omp text checklists the characters of the translations that no bundled font of a table covers, and warns when a table’s first font is bundled and proportional to the game (below).
Without a table the port draws the face the game asks for (the player’s choice in the game’s config, or the script’s) when the machine has it. On a machine without it, the port’s stand-ins for MS ゴシック and MS 明朝 are other fixed-width Japanese faces (Noto Sans Mono CJK JP, BIZ UDGothic and BIZ UDMincho, IPAGothic and IPAMincho, Osaka-Mono) first, and proportional faces only as a last resort. A stand-in draws in the room of the face it stands in for, half the height per half cell, whatever its own metrics.
A table’s font is not a stand-in: it replaces the face as a whole, as a player’s choice in the game’s config does, and the game treats it as Windows treats that font. Its first font decides how.
Use a fixed-width font. The scripts place and size text by counting characters: a name plate, a box or a
right-aligned name gets room for so many half cells, the count the length opcodes give (measure, above). A font
whose Latin letters are all half-width, as MS ゴシック’s and MS 明朝’s are, fills exactly that room. A
proportional font does not, unless the game selects aspect mode (below): its wide letters run past the room, its
narrow ones fall short, and right-aligned text ends ragged.
- A
[[language.font]]table should name a fixed-width face whose Latin letters are half-width. - Fixed-width means what Windows reads from the font file, not its name: a PANOSE proportion of monospaced, or, in a
font with TrueType outlines,
post.isFixedPitch. BIZ UDGothic and IPAGothic are fixed-width. Noto Sans Mono CJK JP is not: its file carries neither mark, and its average width is that of its Japanese glyphs, almost a whole em. - The game asks for its font with half the height as the average width, and Windows narrows a proportional font by
that over the font’s own average. A Japanese proportional font is drawn at about half its width (Noto Sans Mono
CJK JP at 51 %), and a Latin one near its own width, which runs past the half cells.
omp text checkwarns about such a font and gives the width. - Outside aspect mode nothing makes a proportional font fit but
fitandoverflow, which narrow the letters.overflow = "shrink"is still worth keeping for a quick or machine translation, whose messages can run a row longer than the window.
Aspect mode. A game whose scripts select aspect mode (op 0x2db) lays its text out on cells whatever the font,
and the port lays a translation out exactly as native AGE lays out the same characters. A character of one CP932
byte takes half a cell and one of two bytes a whole cell (Ⅰ, ― and ♪ are two bytes); a character CP932 lacks takes a
whole cell if Unicode marks it wide, else half. In a proportional face (the player’s メイリオ, say) the game narrows
each letter by a width it calibrates for the face, a half-width letter by one it calibrates for that letter, and
centres it in its cell; an opening bracket sits at its cell’s right edge, and a closing bracket, 、 or 。 at its
left. A fixed-width face is drawn as it is. fit and overflow narrow the cells too. Which games select aspect mode is in their game notes.
Images and other assets
Section titled “Images and other assets”Text drawn into a picture (a title logo, a menu button, a map label) is not text the port can translate. Give the
picture a language version instead: put the file in assets/<tag>/ under the name the game asks for, and it replaces
that asset while the language, or one that falls back to it, is selected. The port’s F5 names the pictures on screen,
and Ome.Cli picture writes one out as PNG (translating.md, step 8).
<mod>/assets/en/SO001.png an image: PNG stands for SO001.AGF<mod>/assets/en/VC0001.OGG any other asset under its own name- A
.pngfile stands for the.AGFof the same name. Use PNG for edited images: any colour type and depth, with transparency. Any other file keeps its name and is read as the game reads that asset. - The name must be an asset of the base game, or one your package adds in
[assets].names. A script cannot have a language version: its text goes intext/. - The language must be one some package in the stack defines with
[[language]]. - Load order decides between packages. Inside one package, its language version wins over its own plain asset in
assets/. A later package’s plain asset wins over an earlier package’s language version, andomp checklists that: ship a version for the language in the later package, or in one that loads after it. - A language switch shows a picture the game draws from its file at once. A picture the game copied into another one changes when the game next loads it, which a restart always does.
omp explain NAMEshows which language versions an asset has and which one wins.
Engine text
Section titled “Engine text”The port’s own text has keys: the menu bar and its strip, the settings panel, the quit dialog, the folder picker,
the name entry, and the error box AGE shows when a script fails. The engine has it in Japanese and English. A
catalog sets it for its language with [[engine]] tables:
[[engine]]key = "command.skip"text = "Ü&berspringen"keynames the string, not its text.&marks a menu item’s or button’s access key;&&is a literal ampersand.- A string that takes values has
{0},{1}, … where its Japanese has them. The text may reorder or leave them out but not add one. Write a literal brace as{{or}}. - An entry without
textis a template:omp text extractwrites one per key into_engine.tomlfor a language the engine has no table for, with the Japanese and English innote. - The shell looks a key up in the selected language’s entries from every package (a later package wins), then in the
engine’s own table for that language, then the same for each language of its fallback chain, then in the engine’s
Japanese. A German package with
fallback = ["en"]shows the engine’s English for every key it leaves out. - An entry the engine cannot use (a key it does not have, or a value it does not take) is left out, with a
[text]line in the log.omp text checkwarns about unknown keys and fails on the rest. - Game text and engine text never mix:
[[text]]entries match the game’s text,[[engine]]entries the engine’s keys. One catalog file may hold both. - The game driver reads the menus and boxes in Japanese, whatever is shown.
extract lists every key. The engine’s own tables are engine/Ome.Engine.Frontend/Shell/Strings/ja.json and
en.json in the source, with the error box’s strings (error.*) in engine/Ome.Engine/Model/AgeBoxText.cs.
A shell language for every game
Section titled “A shell language for every game”A version 2 package may leave out [game]. It then targets every game:
omp = 2id = "fan.shell-de"name = "Deutsche Oberfläche"version = "1.0.0"
[[language]]tag = "de"name = "Deutsch"fallback = ["en"]Such a package holds only [[language]] tables, catalogs with [[engine]] entries alone, and fonts/. A [[text]]
entry, patches/, scripts/, replace/ or assets/, or a [scripts], [assets] or [replace] table is an error
in it. Install it in each game’s mods/ folder or pass it with --mod. With its language selected, the shell speaks
that language and the game’s text stays as the game has it.
| Command | What it does |
|---|---|
omp text extract --language TAG --output DIR |
writes or updates the templates in DIR/text/TAG/, with _engine.toml for a language the engine has no table for |
omp text check [--mod PATH …] [--data-root DIR] [--text-root DIR] [--language TAG] [--no-scripts] |
links the packages and validates their catalogs; exits non-zero on an error |
omp text stats [--mod PATH …] [--data-root DIR] [--text-root DIR] [--language TAG] [--scripts] |
counts the translated messages, strings and composed strings, per script with --scripts |
omp text po-export --language TAG (--package DIR | --text-root DIR) --output FILE.po |
writes the language’s catalogs as one gettext PO file |
omp text po-import --language TAG (--package DIR | --text-root DIR) --input FILE.po |
puts the PO file’s translations back into the catalogs |
omp text import-scripts --from GAME_ROOT --output DIR [--language TAG] [--package] [--verify] |
builds catalogs from an install translated in place, and with --package its images and a manifest (“From a translation made in place”) |
check reports errors (a file that does not read, two patterns that can match one string, too many entries, a stack
that does not link, an engine entry with a value its key does not take) and warnings (entries whose source no
installed script draws or stores where their scope reaches, site entries that do not bind, characters no bundled font
covers, engine keys the engine does not have). Full options are in cli.md.
Working in PO
Section titled “Working in PO”Translation tools such as Poedit, Weblate and Lokalize read gettext PO. po-export writes one PO file of a
language’s catalogs, and po-import puts what the translators wrote back into them. The catalogs stay the source:
import changes only each entry’s text, keeps every other key and the files’ header comments, and rewrites only the
files whose entries changed.
- Each catalog entry is one message. Its
msgctxtis its scope: none at global scope, the script name at script scope (SC0100), and the script and offset at a site (SC0100@0x2a43). An engine entry’s context isengine:and its key, and itsmsgidis the engine’s Japanese. - A comment on each message gives the entry’s
noteand the file and line it came from. A template exports with an emptymsgstr, an obsolete entry as an obsolete message (#~). - Import skips empty, fuzzy and obsolete messages and warns about messages no entry has. If a translation does not fit its entry (a placeholder the source does not have, or a value an engine key does not take), it writes nothing and lists each problem.
- PO cannot tell an empty translation from a missing one. An entry translated as empty text (
text = "") exports with an emptymsgstrand a comment saying so; import leaves it as it is. - gettext’s
msgfmtrefuses a message whose source and translation do not both start, or both end, with a line break. The port does not mind; a catalog imported from a translated install can hold such messages.
A package that holds only text/, fonts/, assets/<tag>/ and [[language]] changes no script, table or asset a
save depends on. Its save stamp marks it, and adding, removing or updating it is reported as “(presentation only)”.
A save made with any language loads with any other, or with none.
What the scripts compute from a measured length is saved as computed: with measure = "presented", a name plate
sized from a translated name is saved at that size. measure = "source" keeps a save the same as the original
game’s.
Testing without a package
Section titled “Testing without a package”--text-root DIR mounts a loose folder laid out as a package’s text/ (DIR/<tag>/*.toml), with its languages in
DIR/languages.toml and its fonts in DIR/fonts/. It loads after the packages and wins over them. Restart the port
to see an edit. --language x-pseudo presents every string bracketed and a third longer, with no catalog, to find
text that bypasses translation and layouts that cannot take longer text.
Not yet
Section titled “Not yet”- shaping and right-to-left scripts (Arabic, Hebrew, Thai, the Indic scripts).
The design behind this page is ../superpowers/specs/2026-11-10-localization-design.md; the open items are in
../backlog.md, “Localization”.