
The Complete Guide to iOS App Localization
From Localizable.strings to App Store metadata: localize your iOS app with Xcode, SwiftUI, Fastlane, and automated AI translation.
Enable Localization in Xcode
Open your Xcode project settings, go to Info > Localizations, and add the languages you want to support. Xcode creates .lproj directories for each language automatically.
// In Xcode:
// 1. Select your project in the navigator
// 2. Go to Info tab > Localizations
// 3. Click + to add languages (e.g., German, Japanese)
// 4. Select which files to localize
//
// Xcode creates .lproj directories automatically:
// en.lproj/Localizable.strings
// de.lproj/Localizable.strings
// ja.lproj/Localizable.stringsCreate Localizable.strings
The standard iOS localization file uses key-value pairs separated by equals signs, with each line ending in a semicolon. Place it in your Base.lproj folder for the source language.
// Base.lproj/Localizable.strings
"welcome_title" = "Welcome to MyApp";
"login_button" = "Sign In";
"settings_label" = "Settings";
"greeting" = "Hello, %@!"; // %@ = string placeholder
"item_count" = "%d items"; // %d = integer placeholder// ❌ Common mistakes in .strings files:
// Missing semicolon — file loads but translations are empty
"welcome_title" = "Welcome"
// Unescaped quotes — causes parse error
"message" = "Click "here" to continue";
// ✅ Correct versions:
"welcome_title" = "Welcome";
"message" = "Click \"here\" to continue";Migrate to String Catalogs (Xcode 15+)
String Catalogs (.xcstrings) are Apple's modern replacement for .strings files. They offer a visual editor in Xcode, automatic string extraction from your SwiftUI views, and built-in plural support.
// Xcode 15+ String Catalog (Localizable.xcstrings)
// Xcode automatically extracts strings from your code
// and manages translations in a visual editor.
// In SwiftUI, strings are automatically localizable:
Text("Welcome to MyApp")
Text("Hello, \(userName)!")
// Mark strings explicitly:
let title = String(localized: "welcome_title")Use Localized Strings in SwiftUI and UIKit
SwiftUI's Text view auto-localizes string literals. UIKit uses NSLocalizedString. For iOS 16+, the modern String(localized:comment:) API provides a cleaner syntax with built-in compiler support.
import SwiftUI
struct ContentView: View {
let userName: String
var body: some View {
VStack {
// ✅ SwiftUI auto-localizes string literals
Text("welcome_title")
// ⚠️ This does NOT localize (String interpolation)
// Text("Hello, \(userName)")
// ✅ Use String(localized:) for dynamic strings
Text(String(localized: "greeting \(userName)"))
// ✅ UIKit style (works everywhere)
let title = NSLocalizedString(
"settings_label",
comment: "Settings screen title"
)
// ✅ Modern API (iOS 16+)
let modern = String(
localized: "welcome_title",
comment: "Main screen title"
)
}
}
}Handle Plurals
iOS uses .stringsdict files for plural rules, supporting all CLDR plural categories: zero, one, two, few, many, other. String Catalogs handle plurals with a visual editor in Xcode — much simpler than writing stringsdict XML by hand.
<!-- Localizable.stringsdict -->
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>items_count</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@count@</string>
<key>count</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>d</string>
<key>zero</key>
<string>No items</string>
<key>one</key>
<string>%d item</string>
<key>other</key>
<string>%d items</string>
</dict>
</dict>
</dict>
</plist>
// Usage in Swift:
String(format: NSLocalizedString("items_count", comment: ""),
itemCount)Localize App Store Metadata with Fastlane
Use Fastlane's deliver tool to keep App Store metadata — app name, subtitle, description, keywords, release notes — version-controlled in your repository as plain text files organized by locale.
# Install Fastlane
$ gem install fastlane
# Initialize deliver for App Store metadata
$ fastlane deliver init
# Directory structure created:
# fastlane/metadata/
# ├── en-US/
# │ ├── name.txt # App name (30 chars)
# │ ├── subtitle.txt # Subtitle (30 chars)
# │ ├── description.txt # Full description
# │ ├── keywords.txt # Search keywords (100 chars)
# │ ├── release_notes.txt # What's New
# │ └── promotional_text.txt
# ├── de-DE/
# │ └── ...
# └── ja/
# └── ...
# Push metadata to App Store Connect:
$ fastlane deliverTest Your Localization
Test localized content without changing your device language. Use Xcode scheme overrides to run the app in any language, SwiftUI previews with locale environment, and XCUITest with launch arguments for automated testing.
// 1. Xcode Scheme Override:
// Edit Scheme > Run > Options > App Language > Choose language
// 2. SwiftUI Preview with locale:
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
.environment(\.locale, Locale(identifier: "de"))
ContentView()
.environment(\.locale, Locale(identifier: "ja"))
ContentView()
.environment(\.locale, Locale(identifier: "ar"))
}
}
// 3. XCUITest with language override:
let app = XCUIApplication()
app.launchArguments += ["-AppleLanguages", "(de)"]
app.launchArguments += ["-AppleLocale", "de_DE"]
app.launch()Automate Translation Quality
Automate Translations
Translate your .strings, .xcstrings, and Fastlane metadata files using AI. Automate translation of both in-app strings and App Store metadata for a fully localized presence.
# Translate .strings files
> Translate Base.lproj/Localizable.strings
to Japanese, German, and Spanish
# Translate App Store metadata too
> Translate fastlane/metadata/en-US/
to de-DE, ja, es-MX
✓ 6 files translated in 3.2sBonus: Smart Locale Fallback with LocaleChain
By default, iOS falls back to your development language when a user's exact locale isn't available. A pt-BR user with only pt-PT translations sees English instead of Portuguese. LocaleChain fixes this with configurable fallback chains.
LocaleChain is an open-source Swift package. View on GitHub
// Swift Package Manager
// File > Add Package Dependencies >
// https://github.com/i18n-agent/ios-localechain.gitimport LocaleChain
// In your App init or AppDelegate:
LocaleChain.configure() // Activates all default chains
// pt-BR user with only pt-PT translations?
// → Shows Portuguese instead of falling back to English
// Custom overrides for your specific locales:
LocaleChain.configure(
overrides: ["es-MX": ["es-419", "es"]]
)Common Pitfalls
.strings File Syntax Errors
SwiftUI Text Interpolation Not Localizing
Widgets/Extensions Show Raw Keys
Missing Translations Show Keys in Production
Recommended File Structure
MyApp/
├── MyApp.xcodeproj
├── MyApp/
│ ├── Base.lproj/
│ │ ├── Localizable.strings # Source strings
│ │ └── Localizable.stringsdict # Plural rules
│ ├── en.lproj/
│ │ └── Localizable.strings
│ ├── de.lproj/
│ │ └── Localizable.strings
│ ├── ja.lproj/
│ │ └── Localizable.strings
│ ├── Localizable.xcstrings # OR String Catalog
│ └── Info.plist
├── MyAppTests/
├── fastlane/
│ ├── Fastfile
│ └── metadata/
│ ├── en-US/
│ │ ├── name.txt
│ │ ├── description.txt
│ │ └── keywords.txt
│ ├── de-DE/
│ └── ja/
└── Package.swiftTry i18n Agent Now
Drop your translation file here
JSON, YAML, PO, XML, CSV, Markdown, Properties
or click to browse
Target languages
Locale Fallback with ios-localechain
When a translation key is missing in a regional locale like de-AT, iOS jumps straight to the development language instead of checking the parent locale de first.
// Swift Package Manager
// https://github.com/i18n-agent/ios-localechainimport LocaleChain
LocaleChain.configure(overrides: [
"de": ["en-GB", "en"],
"pt-BR": ["pt", "en"],
"zh-Hant-HK": ["zh-Hant", "zh", "en"],
])See our Locale Fallback Guide for the full list of supported frameworks and 75 built-in chains. Learn more →