| name | ha-ios-localization |
| description | Localization via SwiftGen-generated L10n accessors and the en.lproj .strings files. Use when adding or changing user-facing strings, working with the L10n/CoreStrings/FrontendStrings tables, or dealing with Lokalise-managed translations. |
Localization
How Strings Work
- Add strings to the English
.strings file: Sources/App/Resources/en.lproj/Localizable.strings
- SwiftGen auto-generates type-safe accessors in
Sources/Shared/Resources/Swiftgen/Strings.swift when building the app
- Use generated accessors via the
L10n enum:
"settings.title" = "Settings";
"sensor.name_%@" = "Sensor: %@";
let title = L10n.Settings.title
let name = L10n.Sensor.name("Temperature")
There are multiple string tables:
Localizable.strings → L10n enum
Core.strings → CoreStrings enum
Frontend.strings → FrontendStrings enum
All string lookup flows through Current.localized.string which handles locale fallback.
Important: Translations for other languages are managed externally via Lokalise. Only add/modify strings in the en.lproj files.