Reviewing submissions
polyglots review reads a .po export of the strings waiting for approval,
checks every one, repairs what it can, and writes out only the entries that
still matter. Everything it leaves out is approvable as it stands.
polyglots review wp-plugins-example-stable-de.po
Several files at once
Name several files, or a glob, and they are reviewed as one batch:
polyglots review *-de.po --parallel 3
--parallel runs up to that many files at once, 1 to 8 (default 1). A batch
prints one line per file as it starts and ends, and one each time a file
finishes a batch: the file, the batch, the file’s time, and how many files are
done, running and queued, with the estimate and any failed batches beneath it
when they change. Then it prints a table of how each one ended, the message for
each file’s contributor, and a tally. With a reply template, each file’s reply
is printed instead of its message. --template and --requester apply to every
file. One file failing does not stop the others. p pauses, r resumes and q
stops after the batches in flight, as for one file.
With --locale or a configured locale, every file is reviewed in it. With
neither, each file is reviewed in the locale its own Language header names,
so one batch can mix languages. A file whose header names none, or names one
that could be more than one locale, refuses the whole command before anything
runs, and the message says which file.
Earlier review outputs (-repaired.po, -problems.po) that a glob matches
are left out, with a line naming them, so a folder reviewed once can be
reviewed again with the same glob. If two files would write the same output,
as two folders’ foo-de.po would with --out-dir, the command refuses before
anything runs and names both.
With one file, the output is the single review’s summary, as before. A review output named on its own is still reviewed.
Getting the right file
A .po file carries no review status. GlotPress only marks entries as fuzzy;
“waiting” is a fact about the server, not the file. So the export has to be
made with the filter set: in GlotPress, filter by Waiting or Fuzzy and export
“only matching the filter”. polyglots fetch --get waiting <project> does this
for you, and takes the fuzzy strings with the waiting ones, since both need a
reviewer’s decision.
Entries with no translation are skipped and counted as “not submitted”.
What happens to each entry
- The rules. Deterministic checks run first, and decide the hard failures on their own: a dropped placeholder, broken HTML, the wrong number of plural forms. Whitespace that differs from the source is put back before anything else looks at the entry.
- The memory. An entry your translation memory holds word for word is settled there and never sent to the model.
- The model. Everything else goes to the reviewer in batches, with the rule findings as hints and the glossary, your memory and translate.wordpress.org’s consistency data available as lookups. It decides each entry and writes a fix for the ones it rejects.
- The fix is checked. Every proposed fix is run through the rules again.
One that introduces an error is rejected, and the rejection is written into
the file instead of the fix. One that passes is kept, and any softer finding
it has that the submitted text did not is noted beside it as
fix-suspect.
What the checks look for
| Rule | Catches |
|---|---|
placeholder |
a %s, %1$d or {name} the translation drops or invents |
html |
tags that differ from the source |
plural-count |
the wrong number of plural forms for the locale |
whitespace |
leading or trailing spaces that differ from the source (repaired) |
untranslated |
a translation identical to the English |
escaping |
an escaped quote the source does not escape, or the reverse |
punctuation |
sentence-ending punctuation that does not match the source |
line-breaks |
a different number of line breaks |
glossary |
a glossary term the translation does not use, in any of the wordings its row lists |
inconsistent |
one source translated several ways in the same file |
tm-conflict |
a wording that differs from the one your memory approved |
control |
a setting the code reads, such as on or ltr, that was translated |
date-format |
a PHP date format such as F j, Y that prints a wrong date: a letter PHP does not know (J for Y), a lost year, month, day, hour or minute, 12-hour time without am/pm, or a space after a time colon. A lost second or weekday is a hint. With a dateTime in the rules file, it also points out 12-hour time, the wrong date order and copied English formats |
name-order |
a full name such as %1$s %2$s kept in the English order where the rules file’s names says the language writes the family name first. Only when a translator comment or the context says which placeholder is which name. A hint |
fix-suspect |
a finding in the model’s own fix that the submitted text did not have |
fix-suspect checks the model, not the contributor. The fix stays in the file,
and the note names the rule and what it found there, such as a glossary term
the fix dropped. The message to the requester does not count it.
Those run for every language. Some checks only make sense for some languages, and run only where a locale’s rules turn them on:
| Rule | Catches |
|---|---|
title-case |
English Title Case copied into a language that capitalises only the first word |
apostrophe |
a suffix on a proper noun without the apostrophe (WordPressi) |
ampersand |
an & kept where the language writes the conjunction as a word |
number-format |
a percent sign set apart from its number (% 25) |
Turkish has all four. See Locale rules to turn them on for
yours, and to add your team’s own common mistakes and patterns. The Turkish
rules file ships two grammar patterns to turn on, a suffix glued to a
placeholder (%s'de) and a plural noun after a count (%d dosyalar):
Suffixes and plurals.
The output
A run that reaches the end writes <name>-repaired.po beside the input
(--out-dir puts it elsewhere). It holds the flagged entries only, each with
a note saying what was wrong and what was changed. Open it in your .po
editor, read the repairs, and approve the rest of the submission in GlotPress.
The summary counts what happened:
- reviewed: entries looked at.
- flagged: entries that needed work.
- approvable: entries nothing was found in.
- repaired: flagged entries that now carry a fix, and how many are left for you to write.
- unreviewed: entries in a batch that failed twice. They are flagged, so nothing unread can look approvable.
It also prints a message for the requester, a sentence summarising what was fixed, ready to post on the contributor’s submission. Set your translate.wordpress.org username and the message links straight to their strings:
polyglots config set wporgUsername your-name
To post a whole reply rather than the sentence alone, with a greeting, the PTE
verdict and your team’s links around it, write a reply
template. The review then prints the filled reply instead
of the message, which the reply already holds. --requester <username> fills in
who it is addressed to, and --template declined picks a template other than
approved. When entries are left for you to judge, a line above the reply says
how many, so you can check the verdict before you post it.
Rules only
--no-ai runs the deterministic checks and nothing else: no agent, no model, no
cost. It writes <name>-problems.po with the entries the rules found, and the
soft findings no one has judged are counted as “guesses”. It is a quick first
pass, and the honest way to see what the rules alone catch. To work this way all
the time, choose No AI in setup; see Using polyglots without
AI.
Batches, time and cost
Entries go to the reviewer 25 at a time (--batch-size, or
config set batchSize). A batch is one agent call of half a minute or more,
so a three-hundred-entry submission takes a few minutes. Every verdict is
cached: run the same command again after a stop and only the entries not yet
judged are sent. Editing three strings in a file and reviewing it again sends
three.
What a review costs depends on the agent’s account. polyglots makes one call per batch and nothing else. On a plan with usage limits, a large file uses a noticeable part of them. When the agent reports a quota or rate limit, the run stops cleanly and exits with code 3; run it again later to carry on.
Verdicts are cached per reviewer and per model, so switching reviewers reviews again rather than serving one’s opinions as another’s.
Run logs and debug mode
Every review and translate run writes a run log, so a failed batch can be explained after the screen is gone:
~/.local/share/polyglots/logs/<start time>-run<id>.jsonl
With POLYGLOTS_HOME set, the folder is $POLYGLOTS_HOME/data/logs. Each
line is one JSON event: how the run started (command, file, locale, provider,
model, batch size, versions), each batch and the reason it failed, every agent
call (its process id, how long it took, its exit code or signal, whether
polyglots ended it on the time limit, how much it printed), the provider
check that runs before the first batch (antigravity’s
sign-in and quota, codex’s
sign-in and model), and how the run
ended. It holds counts and reasons, not the entries. A reason can quote the
first few hundred characters of what the agent printed, though, and when the
answer was malformed, that can include entries.
Beside it, one file a day, mcp-<date>.jsonl, gets a line for each lookup the
agent made through the polyglots tools: which tool, the size of the question,
how long it took, how many results, and any error. Never the question or the
answer.
At the start of each run, logs and debug folders older than 14 days are deleted. Only names polyglots writes are touched, so a note of your own in the folder stays. A log that cannot be written, on a full disk or a folder without permission, never fails a run: one line says so and the run goes on without it.
Debug mode
When the log says a batch failed but not why, turn on debug mode and run again. It is off by default. Any of these turns it on:
--debugonreviewortranslate, for that run;POLYGLOTS_DEBUG=1in the environment, for every run while it is set;polyglots config set debug on, untilpolyglots config set debug off;- in the app,
don Configuration › Check AI agents.
The environment variable and the setting also apply to fetch. A run in debug
mode says so once at the start, with the folder, so it is not left on by
accident. The folder sits beside the run log, with the same name without
.jsonl, and holds for each agent call:
batch-<NNN>-attempt-<k>.prompt.txt: the whole prompt sent;batch-<NNN>-attempt-<k>.stdout.txtand.stderr.txt: everything the agent printed, kept also when the call ran out of time or the run was stopped;- with antigravity, a copy of agy’s own log for the time of the call
(
.agy-cli-<time>.log), which is never put in a problem report;
and for the run, entries.jsonl with the entries as the screen showed them,
and warnings.jsonl with the draft engines’ warnings in full.
The prompts hold the entries, and so does the agent’s output. A debug folder holds the run’s entries in full, and it is the one part of a problem report that can be large.
This page is docs/review.md in the repository.