Localizing Strings & String Catalogs
Translate UI with String Catalogs.
Localizing Strings & String Catalogs is a free SwiftUI Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the SwiftUI Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Why Localize?
Localization translates your app's text so people read it in their own language. It widens your audience around the world. 🌍
Strings Are Already Keys
In SwiftUI, a Text("Hello") literal is automatically treated as a localizable key. You often get translation for free.
Text("Welcome back")Meet the String Catalog
A modern String Catalog (.xcstrings) gathers every key in one editable table with a column per language.
Adding a Catalog
Add a String Catalog via File, New File, then build once. Xcode auto-collects the strings used across your app.
Adding Languages
In project settings, add a language under Localizations. A new column appears in the catalog, ready for translations.
Interpolating Values
Insert dynamic values right inside Text. Swift turns them into a format key so each language can place them correctly.
Text("Hi, \(name)!")Giving Translators Context
Add a comment so translators know what a string means. The same word can be a noun or a verb.
Text("Open", comment: "Verb on a button that opens a file")Handling Plurals
Languages pluralize differently. A String Catalog supports plural variations so "1 item" and "5 items" both read naturally.
Text("^[\(count) item](inflect: true)")Localizing in Code
Outside a Text view, wrap user-facing strings in String(localized:) so they still get translated.
let msg = String(localized: "Saved")Don't Hardcode Layout
Translations can be much longer than English. Let views resize instead of using fixed widths so text never gets clipped.
Test with a Pseudolanguage
Run the scheme in a pseudolanguage to expand and accent text. It surfaces clipped labels before real translation begins.
Quick Check
Which file type is the modern, recommended way to manage translations in Xcode?
Recap
You can reach a global audience: Text literals are keys, a String Catalog holds translations, and comments plus plurals keep them accurate. 🌟
Frequently asked questions
Is the “Localizing Strings & String Catalogs” lesson free?
Yes — the full text of “Localizing Strings & String Catalogs” is free to read here on the web, and the SwiftUI Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the SwiftUI Academy course, upgrade to CoddyKit PRO.
What will I learn in “Localizing Strings & String Catalogs”?
Translate UI with String Catalogs. You practise SwiftUI Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start SwiftUI Academy?
No prior experience is required. SwiftUI Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Localizing Strings & String Catalogs” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this SwiftUI Academy lesson?
Yes. Every SwiftUI Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- VoiceOver & Accessibility Labels
- Dynamic Type & Scaled Fonts
- Localizing Strings & String Catalogs
- Adapting to Light & Dark Mode