翻篇收录说明
翻篇网页快照

How OpenRouter Built a Self-Correcting Localization System

https://openrouter.ai/blog/announcements/openrouter-in-8-languages/

最近抓取:2026-12-04 12:43:08(北京时间)

最近内容变化:2026-12-01 20:00:11(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

OpenRouter now shows in 8 languages. Here is the LLM translation pipeline behind it, the options we dropped, and what a full run costs.

正文摘录

How We Built a Self-Correcting Localization System for OpenRouterRobert Sun ·11/12/2026Translations live in Git next to the codeTranslations live in Git next to the codeThe pipelineHow we measureWhat we tried and threw awayWhat the pipeline adds over the bare modelThe feedback loopWhat it costsWhat you can reuseSend us your feedbackFrequently asked questions OpenRouter now speaks 简体中文, Español, Português (Brasil), Deutsch, Français, 日本語, and 한국어, alongside English. Localization is in beta, starting today. To switch, pick a language from the account menu, or go straight to an address like openrouter.ai/ja or openrouter.ai/ko/models. Translating a website and keeping that translation up-to-date is hard, especially true for us. OpenRouter’s site has 16,918 English strings, and we change some of them every day, so a one-time translation would be out of date within a week. We built a loop to help us do this at scale. Every day, it finds the strings that changed, translates them, checks them in code, and has a second model verify the meaning against the English. When a translation fails a check, or the verifier rejects it, the loop sends it back with the reason attached and tries again. That retry loop is the part of the system that corrects itself. Some mistakes still get past it, and people catch those. When reviewers and readers report a mistake, we turn it into a glossary rule, a style note, or an override, and mistakes the daily review catches also become test cases that every future model has to pass. The whole pipeline runs on OpenRouter. Translations live in Git next to the code Before any model gets involved, the translations need a home. We use the open-source General Translation runtime to wrap strings in our React code. We commit translations as JSON catalogs next to the code and load them locally at runtime, so no translation service sits in the request path. A string gets picked up for translation within a day of it merging. Until then, the page shows the English source. Each translated entry also stores a fingerprint of the English it came from. When someone edits the English, the fingerprint stops matching, and the entry goes back in the queue. This rule lets the daily run find every stale entry without retranslating the whole catalog. The pipeline Every string in that queue goes through five stages before it reaches the site. 1. Extract A script scans the frontend and writes every wrapped English string to a source catalog. Each entry records its file and its UI role, such as button, heading, or table header. The role matters because the same English word can need a different translation in a different place. “Queue” on a button is an instruction, and one of the defects later in this post is a model translating it as a noun. 2. Translate We send new and changed strings to GPT-6.1 Sol in batches of up to 40, and use Structured Outputs to hold the reply to a strict JSON schema. Each request carries our global and per-language style notes, the glossary rules for any product term in the batch, and the UI role of each string. Here is a simplified example of a translator request for one Japanese batch, with the style notes and glossary rules cut short. { "model": "openai/gpt-6.1-sol", "messages": [ { "role": "system", "content": "Translate OpenRouter UI strings into Japanese. ..." }, { "role": "user", "content": "[{\"id\":\"q1\",\"role\":\"button\",\"text\":\"Queue\"}]" } ], "response_format": { "type": "json_schema", "json_schema": { "name": "translations", "strict": true, "schema": { "type": "object", "properties": { "translations": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "text": { "type": "string" } }, "required": ["id", "text"], "additionalProperties": false } } }, "required": ["translations"], "additionalProperties": false } } } } Because every model on OpenRouter takes the same request, trying a different translator means changing only the model slug. That is how we ran the model comparison later in this post. 3. Check Code rejects a reply that breaks an ICU placeholder, a plural branch, a rich-text tag, or leading or trailing whitespace, or that renders a product term in a form the glossary forbids. We resend a rejected batch in smaller pieces, naming the failure, for up to 4 passes by default. The limit is a setting that goes up to 20. A string that still fails after the last pass stays in English and is flagged in the pull request. 4. Verify A second call to the same model, acting as verifier, reads each translation against the English and lists errors by severity. Any critical or major error, such as a dropped clause or a reversed meaning, sends the string back to the translator with every objection so far attached. The translator gets up to 3 retries after its first attempt, and the last retry uses more reasoning effort. Spend per string has no separate cap, because the retry limits already bound it. Counting the check resends, a string can take up to four translation attempts with up to four check passes each, plus a verifier call after each attempt. That puts the worst case at about 20 model calls per string per language. If the verifier is down, the pipeline writes nothing and the string stays in English. A reader who sees English for a day is better off than one who sees an unchecked translation. 5. Review Each daily batch lands as a pull request. An AI reviewer reads the diff and posts findings, and a person merges the pull request. How we measure The rest of this post leans on three eval suites, so it helps to know what each one tests before the numbers start. The model comparison (254 cases) runs the pipeline with different translator models and scores each reply with the production verifier. We used it to choose the translator. The pipeline comparison (454 cases) runs one model twice, once through the full pipeline and once with a bare two-line prompt. Code checks, the verifier, judges from three other model families, and a back-translation check all score it. The defects suite (22 cases) holds real mistakes the daily review caught after the verifier passed them. Each case forbids the mistake that shipped. What we tried and threw away The pipeline looks simple now because we removed three parts of the first design once the evals measured them. A cheaper translator We first tested a smaller, cheaper model, GPT-6 Luna (openai/gpt-6-luna). In the model comparison, it passed 91.7% of cases on the first try, against 99.2% for GPT-6.1 Sol. Its weakest languages were Korean and Japanese. Its hardest failures were replies that General Translation, our translation framework, couldn’t compile, such as its translation of “Legacy alias of {value}”. Those failures persisted through every retry. The heavier model cost about 3.4 times as much, $1.94 against $0.57 for those 254 cases. We pay the difference because a wrong string that never converges takes more time and effort to fix than just getting it right off the bat. A separate judge model Before the verifier existed, a separate judge model scored every translation, and we retranslated anything it flagged or marked uncertain. To see how well it worked, we labeled a benchmark with three kinds of strings: known errors, corrected translations (hand-fixed versions of earlier errors, which should pass), and a clean sample. The judge did catch real problems. In one benchmark run, it marked 91% of that run’s real defects as uncertain. It also flagged 11 of the 14 corrected translations and 42 of the 150 clean ones, so it sent a lot of good work back for retranslation. With the verifier in place, turning the judge off lowered first-pass accuracy from 99.2% to 98.8% and left the final result unchanged. The judge had been sending about 45% of first drafts back for retranslation. We now leave it off by default. Leaving hard strings for a person At first, a string the verifier rejected on every retry stayed untranslated until someone fixed it by hand. A full retranslation of the catalog, 16,274 strings into 7 languages, left 97 such strings (0.09%). Now the pipeline ranks the rejected drafts by the verifier’s findings, commits the least-wrong one, and flags it in the pull request for review. The loop always ends in a translation, even when that translation still carries a flagged error, and the flag puts it in front of the person who merges the pull request. What the pipeline adds over the bare model Most of what the pipeline adds is fewer outright mistakes. To measure it, our eval runs the same model over 454 cases twice, once through the full pipeline and once with a two-line prompt and no style notes, glossary, or retries. The bare model returned one malformed reply, which leaves 453 pairs to compare. MeasureBare modelFull pipelineFailed a glossary or authored check147 of 4534 of 454Accepted by the verifier on the first pass263 of the 306 that passed checks (85.9%)448 of all 454 (98.7%)Critical errors, summed across three judges from other model families203109Pairs each side won on overall preference117139Meaning survived back-translation90.8%89.3% An authored check is a handwritten rule on one eval case. For example, “Queue” in Chinese must not be translated as 队列, the noun form that shipped. The check failures fell from 147 to 4, which is the glossary and the retries doing their job. The verifier’s first-pass figures use different bases. For the bare model it’s the 306 strings that passed the code checks, and for the pipeline it’s all 454. The verifier comes from the same model family as the translator, so its pass rate tells us how often the model agrees with itself. We use GPT-6.1 Sol for both jobs because it was the more accurate of the two translators we tested. For an outside view, the eval also sends each pair of translations, unlabeled, to three judges from other model families, Claude Opus 5.5, Gemini 4 Argon, and DeepSeek V4 Pro. Across the three judges, they found 109 critical errors in the p