How I Turned AI from a "Mindless Translation Machine" into a Reliable Localization Pipeline
Let me start with the time I screwed it up
When I added multi-language support to a browser extension, my first thought was: isn't this just translation? Just throw it at AI. So I pasted the entire zh-CN.json file directly into the chat, added "translate into English, Japanese, German, Spanish", hit enter, done.
The day after launch, user feedback came in:
- In the German version, the "Delete" button text was so long it burst out of its container, breaking the layout;
- The Japanese version had chaotic honorifics—within the same settings page it switched between です-form and imperative form, as if written by two different people;
- Most embarrassingly, in the English version a placeholder
{count} tabs closedgot "helpfully" rewritten by the AI into a different sentence pattern. The placeholder name changed, the code couldn't retrieve the value, and it threw a runtime error; - And a context trap: for the "Pin" feature in the extension, the Spanish word the AI gave meant "pin" as in a pushpin—nothing like "pin tab" in a browser context.
I rolled back that release and sat down for an honest retrospective. The problem wasn't AI capability—it was that I'd treated it as a "mindless translation machine". Here are the three typical pitfalls I hit, and the correct path I eventually found.
Three common ways to fail
Pattern one: dump the whole file at once. Stuffing hundreds of key-value pairs in one go makes the AI "fatigued"—diligent at first, sloppy later, and the formatting tends to fall apart (lost quotes, keys casually renamed). You think you're saving time, but you're actually laying landmines for debugging.
Pattern two: no context. UI copy is not ordinary text. Words like "Pin", "Block", "Session" have specific meanings in a browser extension context. If you don't tell the AI what the product is and where a word appears, it can only translate by the most generic definition—failure is guaranteed.
Pattern three: letting the AI freelance. With no length limits, no style constraints, and no placeholder protection, the AI produces "literary" translations—while UI copy needs to be short, precise, and consistent. Long-word languages like German and Finnish especially need length constraints.
The right path: structured feeding + batching + validation
Later I redesigned the process. The core idea: transform "a translation task" into "a constrained batch rewriting task":
Step one: build a glossary. I first had the AI list the key feature terms in the extension (tab, pin, group, session restore, etc.), then manually confirmed the standard translation for each term in each language, producing a terminology reference table. This is the foundation—once terminology is unified, the batch translation won't talk past itself.
Step two: translate in batches. Feed only 20–30 strings at a time, along with the glossary, UI scenario descriptions, and hard constraints (placeholder protection, length limits, JSON format requirements). With small batches, the AI's attention and output quality stay stable.
Step three: cross-validation. Have the AI play the role of a "native reviewer" and re-check its own output, focusing on: whether placeholders are intact, whether button text exceeds length limits, whether honorifics/tone are consistent. Finally, I manually spot-check critical paths (settings page, error messages).
Step four: script-based format safety net. I wrote a dozen-line script that verifies each language file's key set exactly matches the Chinese source file, and that placeholder variable names match entry by entry. Machines check format, AI handles semantics, humans review what matters.
The prompt template I actually use
你是一名资深软件本地化工程师。我正在为一个浏览器插件
(功能:标签页管理,支持标签分组、固定、会话恢复)批量生成界面文案。
请将下面的 JSON 翻译为【目标语言,如:德语】,遵守以下规则:
1. 仅翻译 value,不得改动任何 key;
2. 所有 {占位符} 必须原样保留,位置可调整以符合目标语言语序;
3. 按钮文案不超过 N 个字符,菜单项不超过 M 个字符(N/M 按界面实际宽度给出);
4. 语气统一:使用目标语言界面文案的惯用风格
(如日语用です・ます体,德语对用户用敬称Sie);
5. 严格遵循下方术语表,术语表中的词不得另行翻译;
6. 只输出 JSON,不要任何解释。
术语表:
- pin: 固定 (DE: Anheften)
- session: 会话 (DE: Sitzung)
- ...
待翻译文案:
{
"btn_delete": "删除",
"msg_tabs_closed": "已关闭 {count} 个标签页"
}The key to this template: constraints locked down, terminology first, clean output. When the target language changes, the template barely needs to change—I later ran eight languages with the same template.
Before and after: not just about saving time
Before using AI (my first brute-force attempt + manual patching): the copy for six languages took about three working days, and after launch I still had to roll back once due to broken formatting and placeholder errors, plus another day of rework. Users saw an interface with an obvious "machine translation feel".
After the structured workflow: the same six languages—half a day to build the glossary, half a day for batch translation plus validation, plus spot-checking, all within one working day total. And the output quality changed qualitatively—consistent terminology, controlled lengths, zero format errors (100% script validation pass rate). The marginal cost of adding a new language dropped from "a day at minimum" to "about half an hour".
More importantly, the process became reusable. Each time the extension iterates with new copy, I just run the new entries through the template again, and the glossary has become a team asset that accumulates over time. This is probably my biggest takeaway: AI's value isn't in "translating for you once", but in turning localization into a repeatable mini-pipeline.
A few additional tips
- The glossary is worth the time to manually confirm—it's the only human step in the whole process you can't skip;
- For long-word languages (German, Finnish, Greek), always set length caps, or your CSS will get blown out;
- For high-risk copy like error messages and confirmation dialogs, have a native speaker or at least a bilingual colleague give it a final look;
- If you have large volumes of copy and many languages, you can script the whole workflow via API—call in batches, validate automatically. For costs, refer to the official pricing page; usage for minor languages is usually tiny.
After setting up this workflow, when I build a new extension I now default to "multi-language from day one", instead of treating localization as homework to cram before launch like I used to. If you also want to script this batch translation workflow and reliably call large models via API, you can register an account at https://api.thistoken.ai/register and give it a try—the barrier to entry is low, well suited for indie developers and small teams to get their small pipelines running first.
---
Tired of juggling provider integrations? Register at https://api.thistoken.ai/register and call every model through one base_url.
Bạn muốn thử Token.AI?
Tạo API Key cấp dự án, bật kênh trong bảng điều khiển và định cấu hình định tuyến, ngân sách và nhật ký kiểm tra.
注册 ThisToken.AI 并获取 API Key