Refreshes QtPass translation sources with make lupdate, edits and verifies localization/*.ts files, bootstraps new languages in src/src.pro, fills and reviews empty entries with scripts/fill_ts.py (by hand, by an agent or with a local model), and handles reviewer fixes alongside Weblate. Use when working on translations, i18n, a locale or .ts file, Weblate, adding a language, lupdate, lrelease, unfinished or empty strings, or machine translation.
97%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Translations are Qt Linguist .ts files in localization/localization_<lang>.ts
(64 locales at the time of writing; re-derive with
ls localization/localization_*.ts | wc -l). They are managed on
Weblate. The build turns
them into .qm files (CONFIG += lrelease embed_translations in src/src.pro)
and embeds them under :/localization; .qm files are never committed.
Reference files (one level deep, read only when needed):
src/src.pro registration).& accelerator or a reviewer flags a missing or clashing shortcut.fill_ts.py review reports a finding and you decide whether to revert it.scripts/test_fill_ts.py.tr() changeslupdate is an explicit target in qtpass.pro. A plain qmake6 run no longer
touches localization/.
make distclean # only if you built in-source: stale ui_*.h in src/ get scanned
qmake6 # at the repository root, Qt 6.8 or newer
make lupdate # lupdate over src/ and main/, rewrites every localization/*.tsNever run lupdate on src/src.pro alone: that misses the strings in main/.
What make lupdate changes: source text, <location> line numbers and file
names, and the status of changed messages (set to type="unfinished"; removed
ones become type="vanished"). Existing <translation> text is kept.
Then run the verify loop below on a few locales and commit localization/ as
its own change (for example chore: update localization source references).
.ts file directlyWeblate is the normal path. Direct edits are appropriate for:
% 1 vs %1), broken HTML,
made-up words from machine translation, mixed-script artifacts.type="unfinished", so Weblate reviewers can refine it.Rules while editing:
%1, %2, %n and \n exactly as in the source..gpg-id, pass, GPG, Git untranslated.type="unfinished" unless a native speaker confirmed it.linguist localization/localization_<lang>.ts) or a text
editor; with a script, edit only the <translation> element, never the
<source> line (tools strip its trailing whitespace and the message then no
longer matches).Findings tend to arrive in batches (CodeRabbit, GitHub code quality, native speakers):
.ts; reviewer diffs may target an
older state.Short form (details and a worked example in references/adding-a-language.md):
fa, de) unless the text is region-specific.localization_en_US.ts).../localization/localization_<lang>.ts to TRANSLATIONS += in
src/src.pro.qmake6 && make lupdate, confirm the file was populated.type="unfinished"; Weblate translators fill them.After make lupdate adds strings, every locale has empty
<translation type="unfinished"></translation> entries. scripts/fill_ts.py
fills them and leaves them type="unfinished" for Weblate reviewers. It writes
only those elements; <source> lines, locations and finished translations stay
byte for byte. Before it writes a translation it checks:
%1, %2 and %n placeholders, the HTML tags and the line breaks match
the source;& shortcut is kept (it is put back when a model drops it);A translation that fails a check stays empty. en_US is never filled; en_GB
gets the source text. A plural entry takes one text per form (a list in the
JSON); llm leaves plurals with more than one form for a person.
T=.opencode/skills/qtpass-localization/scripts/fill_ts.py
# 1. What is empty, with each locale's glossary terms, as JSON
python3 "$T" pending localization/localization_de_DE.ts > de.json
# 2a. Translate by hand or with an agent: fill the "translation" fields, then
python3 "$T" apply localization/localization_de_DE.ts de.json
# 2b. Or with a local model behind an OpenAI-compatible API
python3 "$T" llm --skip ru,he --cache /tmp/fill-cache.jsonllm defaults to FastFlowLM on an NPU (http://localhost:52625/v1, model
translategemma:4b); for ollama pass --url http://localhost:11434/v1 --model <name>. Each request names the dialog the string comes from and lists the terms
the locale's file already uses for words in it. For example, it tells the model
that "store" is "Opslag" in Dutch, so a 4B model does not write "winkel" (a
shop). Each string gets three tries; --cache keeps the answers, so a rerun
asks only for what is new.
Small models still get meaning wrong where the checks cannot see it (for example "Clipboard restored" as "copy restored from the bin"). After a run:
Run the qtpass-localization-audit
loop. Its SCRIPT check catches a locale written in the wrong script (a
Punjabi file in Devanagari instead of Gurmukhi).
Review what the run filled. review is pedantic on purpose: it reports, and
empties only what --revert names.
python3 "$T" review --since origin/main # checks without a model
python3 "$T" review --since origin/main --back --cache /tmp/back.json # qwen3.5:9b
python3 "$T" review --since origin/main --revert alarm,negationreferences/review-codes.md explains each code.
Read the result for the languages you know, and empty any locale that is mostly wrong. Say in the PR which locales were read and which were not.
Run after any .ts change, before pushing:
f=localization/localization_<lang>.ts
xmllint --noout "$f" # well-formed XML
lrelease6 "$f" -qm "$(mktemp --suffix=.qm)" # compiles, prints countsxmllint must print nothing. lrelease6 (or lrelease-qt6 / lrelease)
must print Generated N translation(s) (F finished and U unfinished) with no
errors. Writing the .qm to a temporary file keeps the tree clean.lrelease does not catch placeholder or HTML problems..ts and go back to step 1. Stop only when
all checks are clean.tests/auto/locale/tst_locale: its project globs every
localization_*.ts, so a broken file fails the test build.git commit -s -S (DCO sign-off plus GPG
signature). See the qtpass-github skill for the full PR flow.gh pr checkout <PR>, git pull
first (bots may have pushed), edit, verify, push to the same branch.gh pr merge <PR> --squash --auto --delete-branch..ts merge conflicts are mostly <location> line numbers. Resolve by taking
one side's file for the conflicting locale, rerun make lupdate if your
branch changed tr() strings, then run the verify loop. During a rebase,
--theirs is your own commit, not main.tr().tr("Delete %1?").arg(name), never string concatenation inside tr().tr("Found %n password(s)", nullptr, count).GPG, Git, clipboard) so translators
can reuse them.make lupdate, or
Linguist still has the old file open.ui_*.h locations in .ts files: an in-source build left generated
headers in src/. Run make distclean, then qmake6 && make lupdate, and
stage only the localization/ changes you intended.tr(), locale not listed
in src/src.pro (so not embedded), or the entry is still empty. See
references/status-and-runtime.md.unfinished: the English source changed.
Check the new source text and placeholders before clearing the flag..ts files: prettier would treat them as
TypeScript.IJHack/QtPass
7b3f0e2
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.