Ha IOS Localization
Developmentha-ios-localizationHa IOS Localization is an Agent Skill for development published in the home-assistant/iOS repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
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.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/home-assistant/iOS/blob/HEAD/.agents/skills/ha-ios-localization/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/ha-ios-localization, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
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.