A Swift build tool plug-in that finds localization gaps and reports them as clickable Xcode warnings.
LocalizationGuard compares user-facing strings in Swift source files with the keys in your String Catalogs. It consists of a small command-line scanner and a build tool plug-in that runs the scanner during builds.
- Swift 6.1 or later
- macOS 13 or later
In Xcode, select File → Add Package Dependencies and enter:
https://github.com/dudwntjs/LocalizationGuard
Add LocalizationGuardPlugin to your app target, then confirm that it appears under Build Phases → Run Build Tool Plug-ins.
LG01: UI-facing literal missing from a String CatalogLG02: Interpolated string requiring localization reviewLG03: Unknown explicit localization keyLG00: Scan completion summary
Suppress an intentional finding with:
// localization-guard:disable-next-line
Text(verbatim: "HTTP")Add .localizationguard.json to the root of the project being scanned. If catalogs is empty or omitted, LocalizationGuard discovers all .xcstrings files automatically.
{
"catalogs": ["Sources/Resources/Localizable.xcstrings"],
"excludedPaths": ["Tests", "Generated", "PreviewContent", ".build"],
"ignoredFunctions": ["print", "debugPrint", "fatalError", "os_log"]
}swift run LocalizationGuardCLI /path/to/your/projectWhen attached to an Xcode target, the plug-in runs automatically when its inputs change. It prints an LG00 completion summary so you can verify that the scan ran.
LocalizationGuard currently focuses on projects that use Korean source strings.
General string detection targets strings containing Korean characters. Explicitly supported SwiftUI APIs may be checked regardless of language.
The current version checks whether a key exists in a String Catalog, but does not verify that every locale has a translated value.
LocalizationGuard is available under the MIT License.