Ship globally from day one with a production-ready localization system featuring type-safe string keys and automatic pluralization support.Documentation Index
Fetch the complete documentation index at: https://docs.swiftaiboilerplate.com/llms.txt
Use this file to discover all available pages before exploring further.
Package location:
Packages/Localization/What’s new in v2.0
L10n.swiftis now a rootenum L10nplus oneL10n+<Namespace>.swiftper nested enum (L10n+Auth.swift,L10n+Chat.swift,L10n+Settings.swift, and so on).- Public API is identical:
L10n.Auth.tagline,L10n.Chat.placeholder, and every other call site compile unchanged. - Same ≤ 400-line refactor rule as the rest of v2.0.
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
The module handles complex plural rules for every language automatically:File Structure
Adding New Languages
Adding a new language takes just minutes:Adding Custom Strings
1. Add to Localizable.strings
2. Add Type-Safe Key
3. Use in Your Views
Pre-Localized Strings
The module includes 100+ pre-localized strings covering common app needs:Authentication
Authentication
- Sign in / Sign up labels
- Password fields
- Error messages
- Social login buttons
- Email confirmation
Chat
Chat
- Message placeholders
- Send button
- Typing indicators
- Message status (sent, delivered, read)
- Error states
Settings
Settings
- Section headers
- Theme options
- Account settings
- Privacy options
- About section
Payments
Payments
- Subscription labels
- Price formatting
- Purchase buttons
- Restore purchases
- Error messages
Errors
Errors
- 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
Related
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
