Accurate Translation Comments in String Catalogs with Xcode 26
Discover how Xcode 26’s AI-powered Generate Comment feature can auto-create precise context notes in your .xcstrings files, improving translation accuracy and speeding up your localization workflow.
Xcode 26 brings AI right into your IDE, including a handy Generate Comment option for your localization catalogs. Instead of guessing what a string means, you can now let Xcode’s built-in language model craft clear context notes for translators.
What’s New in Xcode 26
- AI assistance for code, tests and documentation
- Smart error fixes and refactors
- Inline comment generation in string catalog files
How to Get Started
- Open Xcode > Preferences > Accounts
- Click “+” and choose ChatGPT
- Sign in or paste your API key to unlock up to 20 free requests per day
- (Optional) Run a local model on Apple silicon for on-device inference
Using Generate Comment
- Open your string catalog file in Xcode’s sidebar
- Select a string entry
- Right-click and pick Generate Comment
Xcode will insert a concise note that explains context, placeholders, tone and more.
Why This Helps
Good translation comments:
- Give LLMs and translators the full picture (is “Add” a button label or math operation)
- Define what content goes in placeholders like %@ and $ld
- Cut down on review cycles
- Boost translation quality and consistency across supported languages
This will greatly increase the accuracy of all your localizations generated here at StringCatalog.com. We're really excited about this improvemnt!
Example
// import SwiftUI
// Before
Text("Show Badges")
// After Generate Comment
Text("Show Badges",
comment: "Toggle the badges list in the landmarks collection view")
Automatic string comment generation
To enable this automatically, go to Xcode > Settings > Editing, turn on Automatically Generate String Catalog Comments, and Xcode will insert a context-aware comment every time you add a new localized string. Pretty cool!
Get Xcode 26
Download Xcode 26 from the Mac App Store or the Apple Developer site. If you’re in the Apple Developer Program you’ll already see the update waiting.
⸻
Start letting AI handle your localization comments and ship better translations in seconds.