String Catalogs and Localized Strings
Localize text with the modern String Catalog.
Why Localize at All
Localization (l10n) means presenting your app's text in the user's language; internationalization (i18n) means structuring code so that localization is possible. The first step is to stop hardcoding user-facing strings and instead pull them from a resource catalog.
// Hardcoded — bad for localization
// let title = "Welcome"
// Localized — looked up by key
let title = String(localized: "Welcome")String Catalogs
Modern Xcode projects use a String Catalog (.xcstrings file). It is a single JSON-backed file that lists every localizable key, its translations per language, and metadata like comments and pluralization. Xcode can auto-extract keys from your code.
// Localizable.xcstrings holds entries like:
// key: "Welcome"
// en: "Welcome"
// tr: "Hos geldiniz"
// ja: "Yokoso"All lessons in this course
- String Catalogs and Localized Strings
- Pluralization and Stringsdict
- Locale-Aware Formatting
- Right-to-Left and Layout Direction