home / skills / willsigmon / sigstack / localization-helper

localization-helper skill

/plugins/app-dev/skills/localization-helper

This skill identifies hardcoded UI strings, inserts I18n.str calls, and creates localized keys for six languages in the Leavn app.

npx playbooks add skill willsigmon/sigstack --skill localization-helper

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
616 B
---
name: Localization Helper
description: Find hardcoded strings in Leavn app, add I18n.str() calls, create localization keys for all 6 supported languages (en, es, de, zh-Hans, ar, he)
allowed-tools: Read, Edit, Grep, Glob
---

# Localization Helper

Replace hardcoded Text() strings with I18n pattern for 6 languages.

Pattern:
```swift
// BEFORE
Text("Verse of the Day")

// AFTER
Text(I18n.str("widget.verseOfDay", default: "Verse of the Day"))
```

Add keys to: `LeavnApp/Sources/Resources/{lang}.lproj/Localizable.strings`

Use when: Hardcoded strings found, adding UI text, widget/ChatterboxKit localization

Overview

This skill automates converting hardcoded UI strings into I18n.str() calls and generates localization keys for six supported languages (en, es, de, zh-Hans, ar, he). It scans TypeScript/Swift sources in the Leavn app, replaces Text() literals with the I18n pattern, and inserts keys into Localizable.strings files. The result is consistent, ready-to-translate resource files and minimal manual editing for UI text and widgets.

How this skill works

The tool searches source files for hardcoded Text() or similar UI string instances and proposes or applies replacements to the I18n.str("namespace.key", default: "Original text") pattern. It creates or updates entries in LeavnApp/Sources/Resources/{lang}.lproj/Localizable.strings for all six languages, populating the English value and placeholders for others. Changes are confined to localization calls and .strings files to keep code logic untouched.

When to use it

  • Before release to ensure UI text is localizable across supported languages
  • When adding or editing widget text, ChatterboxKit entries, or other UI strings
  • During code reviews to catch new hardcoded literals
  • When preparing the app for translators or a localization pass

Best practices

  • Run the scan incrementally and review each suggested key to avoid semantic collisions
  • Use a clear, hierarchical key namespace (e.g., widget.verseOfDay, chatter.login.prompt)
  • Keep default English text concise and user-facing; translators use the key context
  • Avoid duplicating identical strings—reuse keys when the same text and context apply
  • Validate RTL layout for Arabic and Hebrew after localization changes

Example use cases

  • Convert hardcoded "Verse of the Day" in a widget to I18n.str("widget.verseOfDay", default: "Verse of the Day") and add entries for en, es, de, zh-Hans, ar, he
  • Localize new onboarding screens by scanning files and generating Localizable.strings entries automatically
  • Detect and replace literals inside ChatterboxKit components to ensure chat UI is translatable
  • Prepare a branch for translators by creating complete .lproj files with English defaults and empty placeholders for other languages

FAQ

Will the skill change logic or variable names?

No. It only replaces string literals used in UI text with I18n.str() calls and updates Localizable.strings files; code flow and variable names remain unchanged.

How are duplicate strings handled?

The tool suggests a key for each occurrence but you should consolidate duplicates manually by choosing a single key to reuse when context and meaning match.