0Pricing
Swift Academy · Lesson

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

  1. String Catalogs and Localized Strings
  2. Pluralization and Stringsdict
  3. Locale-Aware Formatting
  4. Right-to-Left and Layout Direction
← Back to Swift Academy