Translate app string files without breaking keys or placeholders
Translates localization files (.strings, JSON, XML, .po) while preserving keys, placeholders, comments, and syntax exactly.
The prompt
Translate my app's localization file into another language without breaking the code.
File format: [e.g. iOS .strings, Android strings.xml, JSON i18n, .po, .arb]
Target language and region: [e.g. "German (Germany)", "Spanish (Mexico)", "Brazilian Portuguese"]
App type and audience: [e.g. "budgeting app for young adults"]
Tone: [formal / informal - e.g. "du" vs. "Sie", "tu" vs. "usted"]
Glossary or terms not to translate: [brand names, feature names]
UI length limits: [e.g. "button labels must stay short"]
File content: [PASTE]
Rules:
- Keys, identifiers, and attribute names stay exactly as they are. Translate only the user-facing values.
- Placeholders must stay character-for-character identical: %@, %d, %1$s, {name}, {{count}}, \n, HTML tags, and escape sequences. You may move a placeholder within the sentence when the grammar requires it, and use positional placeholders if the format supports them.
- Keep comments, ordering, quotes, semicolons, and file syntax exactly as in the original.
- Handle plurals the way the target language and file format require; flag strings that need plural rules but don't have them.
- Keep button and label text concise; flag any translation likely to be much longer than the source.
Return:
1. The complete translated file in one code block, ready to save.
2. A short notes table: Key | Issue | Suggestion, covering ambiguous strings where you lacked context, likely truncation, and plural or gender problems.
Recommend a native-speaker review before release.
Highlighted [brackets] are blanks to replace with your own details.
Fill in the blanks and use this promptMore Software Development prompts
What to fill in
- e.g. iOS .strings, Android strings.xml, JSON i18n, .po, .arb
- e.g. "budgeting app for young adults"
- formal / informal - e.g. "du" vs. "Sie", "tu" vs. "usted"
- brand names, feature names
- e.g. "button labels must stay short"
- PASTE
- count
How this prompt is built
This prompt follows the Few-Shot structure (Few-shot prompting). A few-shot prompt includes one or more worked examples of the input and the output you want, so the model can copy the pattern instead of guessing it.
Related prompts
- Translate text so it sounds native, not translatedTranslates and localizes text for a specific audience while keeping meaning and tone.
- Learn exam vocabulary with context sentences and collocationsTurns each word you are studying into a compact card with meaning, a revealing example sentence, collocations, and look-alike traps.
- Analyze logs to find what went wrongReads logs to identify errors, patterns, and the likely root cause.
- Generate realistic test or mock dataRealistic synthetic datasets in CSV, JSON, or SQL for testing and demos.