Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

localization-setup

/localization-setup

Generuje infrastrukturę internacjonalizacji (i18n) dla aplikacji iOS i macOS: wielojęzyczność, String Catalogs (xcstrings) i języki pisane od prawej do lewej.

Licencja
MIT
Ostatnia zmiana repozytorium
24.07.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
5
Skrypty
3
Komentarze HTML
0
Adresy URL w SKILL.md
3
Przestarzałość

Brak sygnałów. Repozytorium zmienione 24.07.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 3 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: templates/LocalizationManager.swift, templates/LocalizedPreview.swift, templates/LocalizedStrings.swift

Co robi i kiedy

Generuje infrastrukturę internacjonalizacji (i18n) dla aplikacji iOS i macOS: wielojęzyczność, String Catalogs (xcstrings) i języki pisane od prawej do lewej.

Oryginalny opis (EN)

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.

Jak działa

  1. When This Skill Activates
  2. Pre-Generation Checks
  3. Configuration Questions
  4. Generated Files
  5. Key Features
  6. Integration Steps
  7. Best Practices
  8. Testing Localization
  9. References
Sekcje z nagłówków SKILL.md, w oryginale · 231 linii, 661 słów
Podgląd SKILL.md
---
name: localization-setup
description: 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.
allowed-tools: [Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion]
last_verified: 2026-07-16
review_by: 2027-06-22
os_version: iOS 27 / macOS 27
---

# 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)
Pliki w paczce (5)
  • SKILL.md 6 KB
  • localization-patterns.md 10 KB
  • templates/LocalizationManager.swift 6 KB
  • templates/LocalizedPreview.swift 6 KB
  • templates/LocalizedStrings.swift 7 KB

Wersje

W bazie nie ma innych skilli o nazwie localization-setup.

Migawka bazy z 28.10.2026 · wersja paczki cd66dc7d243b (skrót SHA-256 całej paczki)

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95ios-localization
    Wdraża lokalizację i internacjonalizację w aplikacjach iOS i macOS: String Catalogs, liczba mnoga, FormatStyle dla liczb i dat, układ od prawej do lewej i formatowanie zależne od ustawień regionalnych.
  • 100ios-localization
    Wdraża String Catalogs, procesy L10n i zarządzanie zasobami do obsługi wielu języków w aplikacjach iOS.
  • 87ios-localization
    Obsługuje lokalizację aplikacji iOS: katalogi .xcstrings, odmianę liczebników CLDR, układ RTL oraz formaty dat i walut.
  • 100qe-localization-testing
    Testuje internacjonalizację i lokalizację produktów globalnych: tłumaczenia, formaty regionalne, języki pisane od prawej do lewej i dopasowanie kulturowe.
  • 87skip-localization
    Przygotowuje tłumaczenia aplikacji Skip na inne języki, w tym ciągi w String Catalogs i metadane App Store oraz Google Play.
  • 90xcode-localization-workflow
    Planuje, wdraża i waliduje lokalizację na platformach Apple z Xcode String Catalogs: .xcstrings, tabele stringów, liczba mnoga i warianty urządzeń, przekazanie XLIFF.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.