skillfed

localization

Master modern iOS localization with Xcode String Catalogs (.xcstrings) for managing translations, plural forms, and locale-aware content. Learn SwiftUI integration patterns, pseudo-localization testing, and semantic direction handling for right-to-left languages. Avoid common pitfalls like hardcoded strings and untested RTL layouts.

Localization helps you set up and manage app translations using Xcode String Catalogs for modern iOS development.

AI-generated summary based on this skill's SKILL.md

223 20 MIT updated by johnrogers

Install

johnrogers/claude-swift-engineering/localization · repository language: Python

CLI (skillfed)coming soon
git clone https://github.com/johnrogers/claude-swift-engineering
cp -r claude-swift-engineering/plugins/swift-engineering/skills/localization ~/.claude/skills/localization

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I set up localization in Xcode using String Catalogs?

localization uses Xcode String Catalogs (.xcstrings) as the modern approach to managing translations. Create a new String Catalog in your project, add your app target as a localization resource, and enable the languages you want to support. Xcode automatically scans your code for LocalizedStringResource and String(localized:) calls, extracting them into the catalog. Configure build phases to ensure the catalog is included in your target's resources, then export translations for each language you support.

What is the difference between String Catalogs and the older stringsdict format?

localization's String Catalogs (.xcstrings) replace the legacy stringsdict workflow with a unified, JSON-based format that handles plurals, device contexts, and locale variations in one file. String Catalogs provide a cleaner UI in Xcode, automatic code scanning, and better support for modern SwiftUI patterns. To migrate from stringsdict to String Catalogs, create a new catalog, manually transfer your plural rules and translations, and update code to use LocalizedStringResource instead of NSLocalizedString.

How do I implement right-to-left layout support for Arabic and Hebrew?

localization supports RTL languages through semantic layout direction in SwiftUI. Use .environment(\.layoutDirection, .rightToLeft) on views that need RTL rendering, or let the system detect it automatically based on the active locale. Test RTL layouts with pseudo-localization before translating—enable pseudo-locale testing in your String Catalog to verify that text expansion and layout mirroring work correctly. Avoid hardcoded frame values and use relative positioning (leading/trailing instead of left/right) throughout your UI.

How can I test localization with pseudo-locales before translation?

localization includes pseudo-localization testing to validate your app's readiness for translation without waiting for real translations. In Xcode, enable pseudo-locale variants like Accented English or Double-Length English in your String Catalog settings. These variants expand text, add diacritical marks, or repeat characters to reveal layout issues, truncation problems, and hardcoded strings. Run your app with a pseudo-locale active to catch UI breaks early and ensure all user-facing text is properly localized.

How do I handle plural forms and locale-specific formatting in localization?

localization's String Catalogs handle plurals declaratively within the catalog editor—no need for complex stringsdict rules. Define plural variations (zero, one, other) for each string, and Xcode generates the correct form based on the count at runtime. For locale-aware formatting, use Formatter types (DateFormatter, NumberFormatter, MeasurementFormatter) configured with the current Locale, or leverage SwiftUI's formatted() modifier to automatically adapt dates, numbers, and currency to the user's locale settings.

What should I do if my String Catalog is not working during the build?

localization build issues often stem from missing build phase configuration or incorrect target membership. Verify that your .xcstrings file is added to your app target's Copy Bundle Resources build phase. Ensure LocalizedStringResource and String(localized:) calls use string literals (not variables) so Xcode can scan and extract them. Check that your target's Localization settings include the languages you've added to the catalog. If strings still don't appear, clean build folder and rebuild to force a full rescan.

SKILL.md

rendered from the published skill — quoted content, verbatim

Localization

Modern iOS localization using String Catalogs (.xcstrings) for managing translations, plural forms, and locale-aware content. Supports SwiftUI's LocalizedStringKey and String(localized:) APIs.

Reference Loading Guide

ALWAYS load reference files if there is even a small chance the content may be required. It's better to have the context than to miss a pattern or make a mistake.

Reference Load When
String Catalogs Setting up or using Xcode 15+ String Catalogs
Pluralization Handling plural forms, stringsdict migration
Formatting Date, number, currency locale-aware formatting
RTL Support Right-to-left layouts, semantic directions

Core Workflow

  1. Create String Catalog in Xcode (File > New > String Catalog)
  2. Mark

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 5 files
plugins/swift-engineering/skills/localization/SKILL.md
plugins/swift-engineering/skills/localization/references/formatting.md
plugins/swift-engineering/skills/localization/references/pluralization.md
plugins/swift-engineering/skills/localization/references/rtl-support.md
plugins/swift-engineering/skills/localization/references/string-catalogs.md

Related skills

Tags

multi-language-support translation-workflow locale-formatting bidirectional-text string-extraction pseudo-testing internationalization-setup catalog-management