localization-setup
Generate internationalization (i18n) infrastructure for multi-language support in iOS/macOS apps. Use when localizing for multiple languages, adopting String Catalogs (xcstrings), or supporting RTL languages.
Best use case
localization-setup is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Generate internationalization (i18n) infrastructure for multi-language support in iOS/macOS apps. Use when localizing for multiple languages, adopting String Catalogs (xcstrings), or supporting RTL languages.
Teams using localization-setup should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/localization-setup/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How localization-setup Compares
| Feature / Agent | localization-setup | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Generate internationalization (i18n) infrastructure for multi-language support in iOS/macOS apps. Use when localizing for multiple languages, adopting String Catalogs (xcstrings), or supporting RTL languages.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Localization Setup Generator
Generate internationalization (i18n) infrastructure for multi-language support in iOS/macOS apps.
## When This Skill Activates
- User wants to localize their app for multiple languages
- User mentions i18n, internationalization, or localization
- User asks about String Catalogs or .strings files
- User wants to support RTL (right-to-left) languages
## Pre-Generation Checks
Before generating, verify:
1. **Existing Localization**
```bash
# Check for existing localization files
find . -name "*.xcstrings" -o -name "Localizable.strings" 2>/dev/null | head -5
find . -name "*.lproj" -type d 2>/dev/null | head -5
```
2. **Deployment Target**
```bash
# String Catalogs require iOS 16+ / macOS 13+
grep -r "IPHONEOS_DEPLOYMENT_TARGET\|MACOSX_DEPLOYMENT_TARGET" *.xcodeproj 2>/dev/null
```
3. **Project Structure**
```bash
# Find project for adding localization
find . -name "*.xcodeproj" | head -1
```
## Configuration Questions
### 1. Localization Approach
- **String Catalogs** (Recommended, iOS 16+) - Modern, visual editor in Xcode
- **Legacy .strings** - Traditional approach, all iOS versions
### 2. Initial Languages
- English (en) - default
- Which additional languages? (e.g., es, de, fr, ja, zh-Hans)
### 3. Features
- **Pluralization** - Handle "1 item" vs "2 items"
- **Device-specific** - Different strings for iPhone/iPad/Mac
- **SwiftUI Preview** - Preview in different locales
## Generated Files
### String Catalogs (Recommended)
```
Resources/
└── Localizable.xcstrings # String catalog with all translations
```
### Supporting Code
```
Sources/Localization/
├── LocalizedStrings.swift # Type-safe string access
├── LocalizationManager.swift # Runtime language switching
└── LocalizedPreview.swift # SwiftUI preview helpers
```
## Key Features
### Type-Safe String Access
```swift
// Generated enum for type-safe access
enum L10n {
static let appName = String(localized: "app_name")
static let welcomeMessage = String(localized: "welcome_message")
enum Settings {
static let title = String(localized: "settings_title")
static let language = String(localized: "settings_language")
}
}
// Usage
Text(L10n.appName)
Text(L10n.Settings.title)
```
### Pluralization
```swift
// In String Catalog, define plural rules
// key: "items_count"
// variations:
// - zero: "No items"
// - one: "1 item"
// - other: "%lld items"
Text(String(localized: "items_count \(count)",
defaultValue: "\(count) items"))
```
### String Interpolation
```swift
// In String Catalog:
// key: "greeting"
// value: "Hello, %@!"
let name = "Alice"
Text(String(localized: "greeting \(name)"))
```
### Runtime Language Switching
```swift
// Preview in different locale
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
.environment(\.locale, Locale(identifier: "es"))
}
}
```
## Integration Steps
### 1. Add String Catalog
1. In Xcode: File > New > File
2. Choose "String Catalog"
3. Name it "Localizable.xcstrings"
4. Add to your app target
### 2. Add Supported Languages
1. Select project in navigator
2. Info tab > Localizations
3. Click + to add languages
### 3. Migrate Existing Strings
If migrating from .strings files:
1. Right-click .strings file
2. "Migrate to String Catalog..."
### 4. Use in SwiftUI
```swift
// Automatic localization
Text("Hello, World!") // Uses String Catalog automatically
// Explicit localized string
Text(String(localized: "custom_key"))
// With type-safe enum (generated)
Text(L10n.welcomeMessage)
```
### 5. Use in UIKit
```swift
label.text = String(localized: "hello_world")
// or
label.text = NSLocalizedString("hello_world", comment: "Greeting")
```
## Best Practices
### Key Naming Conventions
```
// Good: Descriptive, hierarchical
"settings.appearance.theme"
"onboarding.step1.title"
"error.network.connection_failed"
// Avoid: Vague or hardcoded text as key
"button1"
"Hello, World!"
```
### Comments for Translators
```swift
String(localized: "delete_confirmation",
comment: "Alert message asking user to confirm deletion")
```
### Formatting
```swift
// Numbers - Use FormatStyle
Text(price, format: .currency(code: "USD"))
// Dates - Use FormatStyle
Text(date, format: .dateTime.month().day())
// Lists - Use ListFormatStyle
Text(items, format: .list(type: .and))
```
### RTL Support
```swift
// Automatic with SwiftUI
// For manual layout adjustments:
.environment(\.layoutDirection, .rightToLeft)
```
## Testing Localization
### In Xcode
1. Edit Scheme > Run > Options
2. Set "App Language" to test language
3. Set "App Region" for number/date formatting
### In SwiftUI Previews
```swift
#Preview {
ContentView()
.environment(\.locale, Locale(identifier: "ja"))
}
```
### Export for Translation
1. Product > Export Localizations...
2. Share .xliff files with translators
3. Import translated .xliff files
## References
- [String Catalogs](https://developer.apple.com/documentation/xcode/localizing-and-varying-text-with-a-string-catalog)
- [Localization Guide](https://developer.apple.com/localization/)
- [Formatting Numbers and Dates](https://developer.apple.com/documentation/foundation/formatstyle)Related Skills
snapshot-test-setup
Set up SwiftUI visual regression testing with swift-snapshot-testing. Generates snapshot test boilerplate and CI configuration. Use for UI regression prevention.
localization-strategy
Localization and internationalization strategy for iOS/macOS apps. Covers market prioritization, language tier recommendations, minimum viable localization levels, translation workflows, cultural adaptation, localized ASO, and testing. Use when planning localization, expanding to new markets, deciding which languages to support, or planning translation workflow.
persistence-setup
Generates SwiftData or CoreData persistence layer with optional iCloud sync. Use when user wants to add local storage, data persistence, or cloud sync.
offer-codes-setup
Generates offer code distribution strategies and configuration guides for subscription and IAP promotions — including partner campaigns, influencer programs, and email re-engagement. Use when setting up offer codes for distribution.
logging-setup
Generates structured logging infrastructure using os.log/Logger to replace print() statements. Use when user wants to add proper logging, replace print statements, or set up app logging.
ci-cd-setup
Generate CI/CD configuration for automated builds, tests, and distribution of iOS/macOS apps. Use when setting up GitHub Actions, Xcode Cloud, or fastlane for continuous integration, TestFlight, or App Store deployment.
analytics-setup
Generates protocol-based analytics infrastructure with swappable providers (TelemetryDeck, Firebase, Mixpanel). Use when user wants to add analytics, track events, or set up telemetry.
watchOS
watchOS development guidance including SwiftUI for Watch, Watch Connectivity, complications, and watch-specific UI patterns. Use for watchOS code review, best practices, or Watch app development.
visionos-widgets
visionOS widget patterns including mounting styles, glass/paper textures, proximity-aware layouts, and spatial widget families. Use when creating or adapting widgets for visionOS.
test-data-factory
Generate test fixture factories for your models. Builder pattern and static factories for zero-boilerplate test data. Use when tests need sample data setup.
test-contract
Generate protocol/interface test suites that any implementation must pass. Define the contract once, test every implementation. Use when designing protocols or swapping implementations.
tdd-refactor-guard
Pre-refactor safety checklist. Verifies test coverage exists before AI modifies existing code. Use before asking AI to refactor anything.