localization-setup
Skill915 starsChanged 22 days agoMITView on GitHub
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.
In this repository184 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- app-intentsSkill
- foundation-modelsSkill
- apple-intelligenceSkill
- visual-intelligenceSkill
- ad-attributionSkill
- app-description-writerSkill
- apple-search-adsSkill
- iap-finalizerSkill
- keyword-optimizerSkill
- marketing-strategySkill
- originality-checkSkill
- ratings-mechanicsSkill
- rejection-handlerSkill
- review-response-writerSkill
- screenshot-plannerSkill
- app-storeSkill
- web-presenceSkill
- core-mlSkill
- animation-patternsSkill
- design-systemSkill
- game-feelSkill
- liquid-glassSkill
- sf-symbolsSkill
- designSkill
- typographySkill
- ui-prototypingSkill
- ux-writingSkill
- attributed-stringSkill
- foundationSkill
- accessibility-generatorSkill
- account-deletionSkill
- analytics-setupSkill
- announcement-bannerSkill
- app-clipSkill
- app-extensionsSkill
- app-icon-generatorSkill
- app-store-assetsSkill
- auth-flowSkill
- background-processingSkill
- ci-cd-setupSkill
- cloudkit-syncSkill
- consent-flowSkill
- custom-product-pagesSkill
- data-exportSkill
- debug-menuSkill
- deep-linkingSkill
- error-monitoringSkill
- feature-flagsSkill
- featuring-nominationSkill
- feedback-formSkill
- force-updateSkill
- http-cacheSkill
- image-loadingSkill
- in-app-eventsSkill
- lapsed-userSkill
- live-activity-generatorSkill
- logging-setupSkill
- milestone-celebrationSkill
- networking-layerSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 140
Add to your app target
- Distinctive: line 150
If migrating from .strings files:
- Distinctive: line 232
Import translated .xliff files
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
- Existing Localization
# 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 - Deployment Target
# String Catalogs require iOS 16+ / macOS 13+ grep -r "IPHONEOS_DEPLOYMENT_TARGET\|MACOSX_DEPLOYMENT_TARGET" *.xcodeproj 2>/dev/null - Project Structure
# 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 translationsSupporting Code
Sources/Localization/
├── LocalizedStrings.swift # Type-safe string access
├── LocalizationManager.swift # Runtime language switching
└── LocalizedPreview.swift # SwiftUI preview helpersKey Features
Type-Safe String Access
// 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
// 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
// In String Catalog:
// key: "greeting"
// value: "Hello, %@!"
let name = "Alice"
Text(String(localized: "greeting \(name)"))Runtime Language Switching
// 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
- In Xcode: File > New > File
- Choose "String Catalog"
- Name it "Localizable.xcstrings"
- Add to your app target
2. Add Supported Languages
- Select project in navigator
- Info tab > Localizations
- Click + to add languages
3. Migrate Existing Strings
If migrating from .strings files:
- Right-click .strings file
- "Migrate to String Catalog..."
4. Use in SwiftUI
// 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
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
String(localized: "delete_confirmation",
comment: "Alert message asking user to confirm deletion")Formatting
// 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
// Automatic with SwiftUI
// For manual layout adjustments:
.environment(\.layoutDirection, .rightToLeft)Testing Localization
In Xcode
- Edit Scheme > Run > Options
- Set "App Language" to test language
- Set "App Region" for number/date formatting
In SwiftUI Previews
#Preview {
ContentView()
.environment(\.locale, Locale(identifier: "ja"))
}Export for Translation
- Product > Export Localizations...
- Share .xliff files with translators
- Import translated .xliff files
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

