The rules and formats for translating a plugin. How to do it step by step is in Add settings and translations; the API is plugin.i18n.
The player's interface languages, the locale code that names a language's catalog file and is plugin.i18n.locale in a run, and the title of the Language command that picks it:
| Code | Language | The Language command's title |
|---|---|---|
en |
English (source language) | English |
zh-Hans |
Simplified Chinese | 简体中文 |
ja |
Japanese | 日本語 |
ko |
Korean | 한국어 |
de |
German | Deutsch |
fr |
French | Français |
es |
Spanish | Español |
A plugin may ship any subset; a .po file named after another code is reported by i18n check and never read. The user's choice takes effect at the next start and stays the same for the whole run.
| Place | What | Rule |
|---|---|---|
| Declarations | Command titles, categories and paths, settings page titles (settings.page), panel and tab titles (panels.mount), command reasons, the manifest's name, punchline, description and tags |
Plain English strings; menus of different plugins merge by the English words. The player's own menus are Open, Playback, Subtitles, Video, Audio, Screen, Settings (or @video and the other ids). |
| Slint | Every text in a .slint file |
@tr("…") |
| Templates | osd.show, OsdPanel.set, dialogs.confirm |
A template and its arguments: osd.show("Speed {}×", [rate]); never a sentence built in TypeScript |
| Text values | Text that mixes words and data anywhere a string goes | plugin.i18n.text(source, args), plugin.i18n.list(items, style), plugin.i18n.error(source, args) |
@tr{} (in order), {0}, {1} (by position), {name} (named, with an object of arguments). A translation keeps every {…} of the English exactly; it may reorder with {0}, {1} only where the English has them.@tr("{n} click" | "{n} clicks" % root.count), where {n} is the number. The player has two plural forms: one for n == 1, the other for every other number. A .po plural entry has as many msgstr[n] lines as its Plural-Forms nplurals: one for Japanese, Korean and Simplified Chinese, two for the others.@tr("Menu" => "Open") tells two meanings of one English word apart.TRANSLATORS: right before the text (in TypeScript on the property, the call or an entry of an as const table; in Slint on the line above the @tr) is copied into the files.| Where | Notes |
|---|---|
commands.add title, category, path segments, reason; Command.set({ reason }) |
not a list; the menu merges by the English rendering |
osd.show(value), OsdPanel.set(value), and as their args |
a text value as the message carries its own args |
dialogs.confirm message, detail, confirm, cancel, checkbox |
args fills only the string ones |
file dialog title; saveFile fileName |
a string fileName is data; text("Playlist.m3u8") is translated |
window, panel and settings page properties, where Slint has string |
at any depth: [string] models, struct fields |
TimelineLayer.set mark titles, subtitles.load({ title }) |
a plain string stays data |
a resolver's failure: throw plugin.i18n.error("The ROM file was not found.") |
shown translated as the open's failure and player.state.error |
list(items, style) joins with the language's separator: "list", "clauses", "semicolons", "sentences" or "lines". plugin.i18n.resolve(value) returns the translated string, for text that leaves the player. OsdPanel.set(value, args, { maxColumns }) cuts each line after translation (a CJK character is two columns).
locales/
messages.pot every text to translate (written by vestra-plugin i18n extract)
zh-Hans.po Simplified Chinese
de.po German …
One gettext <lang>.po per language, named by its locale code (English is the source and has none). vestra-plugin build compiles them into dist/locales/<lang>.json; with --plugin <dir> the player reads the .po files directly. An entry flagged fuzzy is left out.
i18n extract and i18n check do| Command | Does |
|---|---|
vestra-plugin i18n extract |
Writes locales/messages.pot and updates every locales/<lang>.po. Finds every @tr in the .slint files, the texts given to the calls above and every text(…) and error(…) source (literals, both branches of a ?:, as const tables, through the TypeScript type checker), and the manifest's display fields. Keeps existing translations, adds new texts untranslated, moves texts that disappeared to the end as obsolete (#~), keeps comments before the header and # comments on entries. |
vestra-plugin i18n extract --locale de |
Starts a new language. |
vestra-plugin i18n check |
Reports per language how much is translated, translations that lost or changed a placeholder, missing plural forms, a stale messages.pot, and text that cannot be translated (a sentence composed in TypeScript, a value that is not a literal, non-English source text, Slint text without @tr). Fails when messages.pot is out of date or a .po lacks some of its messages. |
vestra-plugin check prints the same lines as warnings when the plugin has a locales/ folder.
| Marker | Where | Meaning |
|---|---|---|
x-machine |
The entry's #, flags line, before its msgid (#, x-machine or #, fuzzy, x-machine) |
Made by a machine or a language model; nobody who knows the language has checked it yet. i18n extract keeps it, also on obsolete entries. The player and the SDK ignore it: the entry is compiled and shown like any other. |
# Reviewed by … on <date> |
A comment line before the msgid "" header |
A review of the whole file (# Reviewed by an AI reviewer on 2026-10-25, # Reviewed by Jane Doe on 2026-10-25 (menus and settings)). An automatic review leaves the x-machine flags in place. |
A reviewer deletes an entry's x-machine once it is checked; an entry still flagged has not been reviewed.
t() function.1.5), not in the language's own format.