OpenParable
Skip to content
← Back to skills

Ha IOS Localization

Development
ha-ios-localization

Ha 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.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
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

  1. Add strings to the English .strings file: Sources/App/Resources/en.lproj/Localizable.strings
  2. SwiftGen auto-generates type-safe accessors in Sources/Shared/Resources/Swiftgen/Strings.swift when building the app
  3. Use generated accessors via the L10n enum:
// 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 → 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.