Skip to main content
Ship globally from day one with a production-ready localization system featuring type-safe string keys and automatic pluralization support.
Package location: Packages/Localization/

What’s new

  • v2.2 — Localized error surface: AppError.localizedUserMessage (en + es) lives here in Localization, now linked by the app target, FeatureSettings, and FeatureChat. All UI error call sites resolve user-facing copy through it.
  • v2.0L10n.swift is a root enum L10n plus one L10n+<Namespace>.swift per nested enum (L10n+Auth.swift, L10n+Chat.swift, L10n+Settings.swift, and so on). The public API is identical: L10n.Auth.tagline, L10n.Chat.placeholder, and every other call site compile unchanged.

Overview

The Localization module provides compile-time safe string access, eliminating missing translation errors before they reach users.

Type-Safe Strings

Compile-time safety catches missing translations

Pluralization

Automatic plural rules for every language

2 Languages Included

English and Spanish out of the box

100+ Strings

Pre-localized Auth, Chat, Settings, Payments, Errors

Quick Start

Basic Usage

Pluralization

Plural forms are driven by Localizable.stringsdict, so each language can define its own rules (English ships with zero/one/other; languages like Russian or Arabic can add their full form sets in their own .stringsdict):

File Structure

Adding New Languages

Adding a new language takes just minutes:
1

Copy existing language folder

2

Translate strings

Edit de.lproj/Localizable.strings with German translations. Adapt the copied Localizable.stringsdict if the language needs different plural rules.
3

Build and test

Rebuild — the app automatically picks up new languages.

Adding Custom Strings

1. Add to Localizable.strings

Add the same keys to every .strings file in Resources/ (e.g. es.lproj/).

2. Add Type-Safe Key

Create a new L10n+MyFeature.swift extension (one namespace per file, matching the v2.0 layout):

3. Use in Your Views

Pre-Localized Strings

The module includes 100+ pre-localized strings covering common app needs:
  • Sign in / Sign up labels
  • Password fields
  • Error messages
  • Social login buttons
  • Email confirmation
  • Message placeholders
  • Send button
  • Typing indicators
  • Message status (sent, delivered, read)
  • Error states
  • Section headers
  • Theme options
  • Account settings
  • Privacy options
  • About section
  • Subscription labels
  • Price formatting
  • Purchase buttons
  • Restore purchases
  • Error messages
  • Network errors
  • Authentication errors
  • Permission errors
  • Generic errors
  • Retry prompts

Best Practices

Always use L10n

Never hardcode user-facing strings

Test with pseudolocalization

Catch layout issues early

Keep strings short

Some languages expand 30%+

Avoid string concatenation

Use string interpolation instead

Testing

Quick Start

Run the app before adding more languages

Architecture

Understand module boundaries

Accessibility Module

VoiceOver and Dynamic Type support

Design System

UI tokens and components