# Make Your Coding Agent Localize Your App Without Breaking It

> Coding agents add i18n fast but miss files and wrap strings that aren't UI: system prompts, camera values, font names. Here's how agent skills split the work between a CLI and the agent, the review checklist that catches what breaks, and how the agent can translate without an API key.
- **Author**: Mohit Sapat
- **Published**: 2026-11-23
- **URL**: https://www.babelize.co/blogs/agent-skills-localize-app

---

<p class="lead">Ask Cursor, Claude Code or Codex to &quot;add i18n to this app&quot; and you&#39;ll get something that runs. Look closer and two things are usually off: the agent only wrapped the strings in the files it happened to open, and it wrapped some strings it never should have touched.</p>
<p>The second one is the dangerous one. While localizing an open-source AI chat app (an Expo app with a few hundred strings), the first automated pass also wrapped:</p>
<ul>
<li>the <strong>system prompt</strong> sent to the model (<code>&#39;Reply in one word.&#39;</code>), so in German the model would get German instructions;</li>
<li>the <strong>camera values</strong> <code>&#39;front&#39;</code>, <code>&#39;back&#39;</code> and <code>&#39;off&#39;</code>, which <code>expo-camera</code> compares as exact strings, so the camera breaks in any other language;</li>
<li>a <strong>font name</strong> (<code>Platform.select({ ios: &#39;Menlo&#39; })</code>) and a React <code>key</code>;</li>
<li>the <strong>search-query builder and language detector</strong>, which would have queried the web in the user&#39;s UI language.</li>
</ul>
<p>None of that is UI text. All of it looks like UI text to a pattern-based extractor, and to an agent working fast.</p>
<p>So I wrote the process down as <a href="https://github.com/babelize/skills">agent skills</a>: instructions any <code>SKILL.md</code>-aware agent follows (Claude Code, Codex, Cursor, Gemini CLI, Copilot and others). This post walks through how they work, including the checklist, which is useful even if you never install anything.</p>
<h2>The split: a tool for coverage, the agent for judgement</h2>
<p>An agent is good at translating and at judging context. It is not good at being exhaustive across 200 files, or at keeping keys stable from one run to the next. So the skills split the work:</p>
<ol>
<li><strong>The CLI does the mechanical part.</strong> <code>npx babelize scan .</code> lists every hardcoded string by file and line. <code>npx babelize translate</code> wraps them, adds the i18n setup your framework expects (next-intl, react-i18next, vue-i18n, Django gettext, Expo) and writes the locale files, with a lockfile so re-runs only touch new or changed strings.</li>
<li><strong>The agent translates.</strong> No API key needed: the CLI fills every new string with pseudo text (<code>⟦Sávé çháñgés⟧</code>), <code>npx babelize check --json</code> lists exactly which keys are left, and the agent writes the real translations into the locale files.</li>
<li><strong>The agent reviews.</strong> This is the step a tool can&#39;t do, and the one the skill spends the most words on.</li>
<li><strong>The CLI validates.</strong> <code>npx babelize check</code> fails on missing keys, renamed <code>{placeholders}</code> and plural messages missing a form the language needs.</li>
</ol>
<p>Here&#39;s a real before/after from a small Next.js sample app:</p>
<pre><code class="language-diff">- &lt;button type=&quot;submit&quot;&gt;Create my list&lt;/button&gt;
+ &lt;button type=&quot;submit&quot;&gt;{t(&quot;signup-form.createMyList&quot;)}&lt;/button&gt;
- &lt;p role=&quot;status&quot;&gt;Thanks! We sent a link to {email}.&lt;/p&gt;
+ &lt;p role=&quot;status&quot;&gt;{t(&quot;signup-form.thanksWeSentALink&quot;, { email })}&lt;/p&gt;
</code></pre>
<pre><code class="language-json">{ &quot;signup-form&quot;: { &quot;thanksWeSentALink&quot;: &quot;Merci ! Nous avons envoyé un lien à {email}.&quot; } }
</code></pre>
<h2>The review checklist</h2>
<p>This is the part I&#39;d copy into any i18n prompt. Revert any wrap of:</p>
<ul>
<li><strong>Prompts and model input:</strong> system prompts, <code>{ role: &#39;system&#39;, content: ... }</code>, language names or word lists used to build prompts or detect a language.</li>
<li><strong>Values the code compares or passes on:</strong> state and enum values, API parameters, query strings, event names, storage keys, <code>testID</code>s, CSS values and font names, URLs, regexes.</li>
<li><strong>Language-keyed data:</strong> maps like <code>{ pl: &#39;...&#39;, en: &#39;...&#39; }</code> that already hold one string per language.</li>
<li><strong>Non-UI modules:</strong> server code, parsers, query builders, log and analytics messages. Better: exclude those folders up front in <code>.babelize/config.json</code> so no run ever touches them.</li>
</ul>
<p>And check the code itself:</p>
<ul>
<li>Hooks (<code>useTranslation</code>, <code>useTranslations</code>) at the top of the component, never inside a render callback. One pass I reviewed put <code>useTranslation()</code> inside a bottom sheet&#39;s render prop, which breaks the rules of hooks.</li>
<li>Strings at module scope are evaluated once and won&#39;t follow a language switch.</li>
<li><code>n === 1 ? &#39;1 task&#39; : `${n} tasks` </code> becomes two keys, which is wrong for French (<code>one</code>, <code>many</code>, <code>other</code>) or Russian (<code>one</code>, <code>few</code>, <code>many</code>, <code>other</code>). Rewrite it as one ICU plural.</li>
<li>Things extraction doesn&#39;t cover: <code>&lt;title&gt;</code> and page metadata, <code>&lt;html lang&gt;</code>, text in images and emails.</li>
</ul>
<p>Then run the project&#39;s own typecheck, linter and tests. On that AI chat app, 24 test files failed until the test setup loaded the i18n config, an easy thing to miss and an easy thing to fix.</p>
<h2>Translating it yourself, in the right order</h2>
<p>Letting the agent translate is the default when there&#39;s no key, but the order matters, because each CLI run records keys in a lockfile and a key it has never seen is treated as new:</p>
<ol>
<li>Finish every code edit first (reverts, plural rewrites).</li>
<li>Run the CLI once more so every key exists.</li>
<li>Translate everything <code>check --json</code> lists, keeping placeholders, tags and every plural form the target language needs.</li>
<li>Run the CLI one last time. It records your translations as external, so later runs keep them and only new strings get pseudo text.</li>
</ol>
<p>Done in a different order, the next run overwrote the agent&#39;s work. That came out of testing the skill with a fresh agent that only had the <code>SKILL.md</code> to go on, which I&#39;d recommend for any skill you write: hand it to an agent with no context and see what it trips over.</p>
<h2>Try it</h2>
<pre><code class="language-bash">npx skills add babelize/skills
</code></pre>
<p>Then ask your agent <em>&quot;translate this app into French and German&quot;</em>, or <em>&quot;show me what localizing this app would look like, offline&quot;</em> for a pseudo-localized preview with nothing leaving your machine.</p>
<p>There are seven skills in the pack: localizing an app, filling missing translations and adding languages, finding hardcoded strings, pseudo-localization, translating Markdown/MDX docs, a CI check that fails on missing keys, and translating on every push. They&#39;re open source: <a href="https://github.com/babelize/skills">github.com/babelize/skills</a>. Issues and pull requests are very welcome, especially from people whose framework I haven&#39;t covered well.</p>
---
- [All articles](https://www.babelize.co/blogs)