Localization
How Strings Work
- Add strings to the English
.stringsfile:Sources/App/Resources/en.lproj/Localizable.strings - SwiftGen auto-generates type-safe accessors in
Sources/Shared/Resources/Swiftgen/Strings.swiftwhen building the app - Use generated accessors via the
L10nenum:
// In Localizable.strings:
"settings.title" = "Settings";
"sensor.name_%@" = "Sensor: %@";
// In Swift code (auto-generated):
let title = L10n.Settings.title
let name = L10n.Sensor.name("Temperature")
There are multiple string tables:
Localizable.strings→L10nenumCore.strings→CoreStringsenumFrontend.strings→FrontendStringsenum
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.lprojfiles.