Tips for Better AI Translations
Get the most out of AI-powered translations with these practical tips for providing context and reviewing results.
AI translation is good. AI translation with context is great. The difference between "acceptable" and "feels native" often comes down to how much the model knows about your app.
Here's how to get translations that don't sound like they came from a machine.
Text("Feed")Text("Feed", comment: "news feed button")The Context Problem#
Without context, AI translators guess. And they often guess wrong.
Take the word "Post." Is it a blog post, a fence post, or the post office? A social media app means something different than a carpentry app. The AI doesn't know unless you tell it.
Same with "Share"—social sharing or stock shares? "Feed"—news feed or animal feed? "Check"—verify or bank check?
These aren't edge cases. They're common words that appear in countless apps. And they get mistranslated constantly.
Tip 1: Use Descriptive String Keys#
Bad:
"share" = "Share";
"post" = "Post";Better:
"button_share_photo" = "Share";
"create_blog_post" = "Post";The AI sees your string keys. Descriptive keys give it hints about context. feed_item_like_button tells the model way more than like.
This also helps future you (or your teammates) understand what each string is for.
Tip 2: Add Translator Comments in Xcode#
Xcode lets you add comments to any string in your .xcstrings file. These comments get passed to the AI during translation.
{
"share": {
"comment": "Button to share a photo on social media",
"localizations": { ... }
}
}Use comments to clarify:
- What UI element this is (button, label, title)
- What screen or feature it appears in
- Any specific meaning that isn't obvious
XCStrings Translator sends these comments directly to the AI. It's like having a translator's notes built into your source code.
Tip 3: Write a Custom Prompt#
The biggest improvement comes from a project-wide custom prompt. This tells the AI about your app, your audience, and your tone.
This is a meditation app for busy professionals.
Use a calm, reassuring tone. Keep sentences short.
Avoid technical jargon.Three sentences. Every translation from that point forward understands it's translating for a meditation app, not a productivity tool or a game.
See Writing Custom Prompts for a deep dive.
Tip 4: Review in Context#
Translations that look fine in a spreadsheet can feel wrong in your actual UI. A perfectly accurate translation might be too long for a button. A formal translation might clash with an otherwise casual interface.
Review translations in your running app, not just in the translation tool. XCStrings Translator marks strings as "Needs Review" so you can track which ones you've verified.
Tip 5: Handle Placeholders Correctly#
Format specifiers like %@ and %lld need to survive translation intact. If they get mangled, your app crashes.
// This becomes: "Hello, %@!"
Text("Hello, \(name)!")XCStrings Translator validates that placeholders match between source and translation. If they don't, you'll see a warning before saving.
For strings with multiple placeholders, use positional arguments (%1$@, %2$@) so translators can reorder them. German and Japanese often need different word order than English.
See Handling Format Specifiers for the full breakdown.
Tip 6: Pick the Right Provider#
Different AI models have different strengths:
| Provider | Good For |
|---|---|
| GPT-4o | Broad language coverage, technical content |
| Claude | Nuanced tone, creative writing, longer context |
Try both on a sample of your strings. You might find one handles your app's specific domain better than the other.
XCStrings Translator lets you set different providers per project, so your meditation app can use Claude while your developer tools use GPT-4o.
The Payoff#
A few minutes of setup—descriptive keys, translator comments, a custom prompt—and your AI translations go from "technically correct" to "sounds like a native speaker wrote it."
Your German users won't know the translation came from an AI. That's the goal.
Related#
- Writing Custom Prompts — Interactive prompt builder
- Handling Format Specifiers — Keep your %@ and %lld intact
- Choosing a Provider — Compare OpenAI vs Claude
Ready to translate your app?
Download XCStrings Translator and start localizing your iOS and macOS apps with AI-powered translations.
Download for macOS