audit-swiftui-localization

Audit macOS SwiftUI code for localization and internationalization defects.

2|1|Updated Jun 7, 2026
One-click install
npx skills add https://github.com/yigitkonur/plugin-swiftui --skill audit-swiftui-localization-yigitkonur
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audit-swiftui-localization
Source: https://github.com/yigitkonur/plugin-swiftui/tree/main/plugins/swiftui/skills/audit-swiftui-localization
Command: npx skills add https://github.com/yigitkonur/plugin-swiftui --skill audit-swiftui-localization-yigitkonur

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? SwiftUI code often escapes auto-localization in subtle ways: String variables passed to Text, verbatim: misuse, sentences built by interpolation that break pluralization, locale-unaware number and date formatting, and RTL-unsafe layout. This Skill systematically detects these defects in a macOS SwiftUI project and writes structured findings to disk. ## Core Features & Use Cases - Ten-rule defect index (loc-01 to loc-10): Detects hardcoded strings, verbatim misuse, missing String Catalogs, missing translator comments, interpolation-built sentences, locale-unaware formatting, and RTL-unsafe symbols and offsets. - Hybrid lint engine: Combines tier-1 grep tells with a tier-2 ast-grep structural rule that catches non-literal String arguments passed to Text, emitting unified JSON and SARIF output. - Evidence-grounded verification: Cross-checks uncertain findings against a corpus of 1,857 shipping macOS apps via swiftui-ctx and Apple documentation via Sosumi before reporting. - Use Case: Run it on an in-progress macOS SwiftUI app before release to find every string that will never reach a translator, then review flag-only findings organized by context folders like hardcoded-strings, plurals-and-grammar, and rtl-layout. ## Quick Start Audit the SwiftUI sources in this project for localization and internationalization problems and write the findings to swiftui-audits/localization.

Frequently Asked Questions about audit-swiftui-localization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find hardcoded strings in a SwiftUI macOS app?

Run the audit's lint runner over your SwiftUI sources; it locates String variables passed to Text, verbatim-wrapped UI copy, and literals missing translator comments. Each located file is then read in full before a finding is reported at 100% confidence.

How to detect localization problems in SwiftUI Text views?

The audit checks whether Text receives a string literal (auto-localized via LocalizedStringKey) or a String variable (not localized), using an ast-grep structural rule that grep alone cannot express. It also flags verbatim misuse in both directions.

Does SwiftUI Text automatically localize string literals?

Yes. A string literal passed to Text uses the LocalizedStringKey overload and is extracted into the String Catalog at build time. A String variable resolves to the StringProtocol overload and is never localized, which is the most common defect this audit catches.

Can this audit fix localization issues automatically?

No. Every localization rule is flag-only because corrections require judgment about key naming, comment wording, and whether text is translatable. Findings include the consensus correct shape from real shipping apps, and the developer applies the fix.

What happens if ast-grep is not installed during the audit?

The shared lint runner degrades to grep-only mode with a notice, so tier-1 tells still run. The tier-2 structural rule for non-literal Text arguments requires ast-grep, installable via npx or brew.