The Deska blog
Filling Translation Files With an Agent
Learn how to optimize localization workflows by filling translation files with an agent using side-by-side LLM panels and local-first automation.
· 9 min read
Localizing a modern web or mobile application often feels like a secondary task that quickly becomes a bottleneck. The process of filling translation files with an agent provides a high-leverage way to handle i18n strings without manually jumping between Google Translate and your IDE. When you integrate an autonomous agent into this workflow, you move from manual data entry to a system of supervised generation. This approach ensures that your JSON, YAML, or PO files remain populated with contextually accurate translations while you focus on core feature development.
The Problem With Manual Internationalization
Traditional i18n workflows are fragmented. A developer typically identifies a hardcoded string, moves it to a key-value store, and then has to provide equivalents for every supported locale. This results in several friction points:
- Context loss occurs when strings are sent to external translation services without the surrounding code structure.
- Syntax errors are frequent when manually editing large nested JSON objects.
- Consistency is difficult to maintain across different pages of the same application.
- Version control becomes messy when developers and translators work on the same files simultaneously.
By automating the process of filling translation files with an agent, you can maintain the technical integrity of the file format while leveraging the linguistic capabilities of large language models.
Approaches to Automated Translation
Different tools handle localization in varied ways. Traditional translation management systems (TMS) focus on collaboration between humans and machines. These are excellent for large enterprises with dedicated localization teams. However, for individual developers or small teams, these can feel overly complex.
Command-line utilities that hit translation APIs offer a faster alternative. They are great for bulk operations but often lack the ability to understand the specific UI context. For example, the word "Book" could be a noun (a physical object) or a verb (to make a reservation). A simple script might pick the wrong one.
AI coding agents represent a third path. Because they can read your source code, they understand how a string is used. They see the button, the header, or the tooltip where the text lives. This context allows the agent to produce translations that actually fit the user interface.
Setting Up Your Translation Environment
To effectively fill translation files with an agent, you need an environment that allows for rapid iteration and visibility. Working in a constrained IDE window can make it hard to track changes across multiple language files.
Deska offers an infinite canvas where you can layout your workspace to suit this specific task. You can place your English source file on one side, your target language files in the center, and your AI agent panel on the right. This layout helps you see exactly what the agent is modifying in real time.
When using Deska, you are working in a local-first environment. Your translation keys and proprietary application strings never leave your machine except when sent to the specific AI provider you have chosen via your own API keys. This is a significant privacy advantage over cloud-based translation platforms that ingest your entire codebase.
Choosing Your Agent
Within the Deska workspace, you can run multiple coding agents side by side. Each has different strengths for localization:
- Claude Code is often praised for its nuanced understanding of tone and regional dialects.
- Codex CLI is highly efficient for structured data formats like JSON and YAML.
- OpenCode provides a flexible interface for custom prompts.
You can compare their outputs by opening multiple agent threads on the same canvas. This allows you to verify which model provides the most idiomatic translation for a specific language pair.
Workflow Strategy for Localization
The best way to use an agent for translation is to treat it as a pair programmer. Instead of asking it to translate the whole project at once, follow a structured process.
- Prepare the source: Ensure your primary language file is updated and correctly formatted.
- Define the context: Tell the agent about your application. Is it a professional B2B tool or a casual mobile game?
- Execute the fill: Use a command to have the agent identify missing keys in the target files and populate them based on the source.
- Review: Use the integrated code editor to scan the changes.
If you are away from your desk, you can use the mobile app to monitor the progress of long-running translation tasks. Since the mobile app pairs directly with your desktop, you can check if the agent has finished filling a large set of files without needing to be at your computer.
Comparing Tools for Translation Tasks
| Tool Category | Context Awareness | Speed | Privacy | Best For |
|---|---|---|---|---|
| Manual Copy-Paste | High | Very Low | High | Small fixes |
| Traditional TMS | Medium | Medium | Variable | Enterprise teams |
| CLI Scripts | Low | High | Medium | Bulk technical data |
| Deska + Agents | High | High | High | Active development |
Integrating With Your Development Cycle
Localization should not be a final step performed once a year. It should be continuous. By using terminals directly next to your code editor in your workspace, you can run your test suite to ensure that the new translation keys haven't broken the UI.
If you encounter an issue where a translated string is too long for a button, you can use Ask Deska to quickly find the relevant CSS file or component. You can speak to the assistant and ask it to "find the button component where the German text is overflowing," and it will navigate the workspace for you.
Frequently Asked Questions
How to fill translation files with an agent automatically?
You can achieve this by using an AI agent that has access to your file system. Point the agent to your primary locale file (e.g., en.json) and your target file (e.g., es.json). Ask the agent to find keys present in the source but missing in the target, translate the values while maintaining the key structure, and write the result back to the file.
What is the best AI for translating JSON files?
Models with high reasoning capabilities, such as Claude 3.5 Sonnet or GPT-4o, are generally best. They are less likely to break the JSON syntax and better at preserving placeholders like {{username}} or {count} within the strings. Running these through a coding agent ensures the file integrity remains intact.
Is it safe to use AI for app localization?
It is safe if you use a local-first approach where the code stays on your machine. Using your own API keys via a BYOK (Bring Your Own Key) model gives you control over your data. Always review the agent's output, as LLMs can occasionally hallucinate or use overly formal language where a casual tone is expected.
Getting Started With Automated Localization
Streamlining your i18n process reduces the friction of reaching a global audience. By utilizing an infinite canvas to organize your language files and employing specialized agents to handle the heavy lifting, you can ensure your application speaks to everyone.
To try this workflow yourself, you can download the Deska desktop app for Mac, Windows, or Linux. Setup your workspace, connect your preferred agent, and start filling translation files with an agent today.