XCSValidator performs read-only semantic analysis on a parsed catalog and returns structured findings. It never mutates the Catalog it receives.
infowarningerror
missingLocalizationsmissingSourceLocalizationincompleteLocalizationuntranslatedValueneedsReviewplaceholderMismatch
Each finding includes:
severitycategorymessagepathentryKeylocale
public static func validate(_ catalog: Catalog) -> [ValidationFinding]import XCSParser
import XCSValidator
let catalog = try XCSParser.parse(fileURL: catalogURL)
let findings = XCSValidator.validate(catalog)
for finding in findings {
print("\(finding.severity.rawValue): \(finding.path): \(finding.message)")
}Current validation covers:
- entries with no localizations at all
- entries missing a source-language localization
- localizations that contain neither a direct leaf nor any variation leaf
- non-source leaves marked
needs_review - non-source leaves that exist but are not
translated - placeholder mismatches between source leaves and matching target leaves
- Findings are sorted deterministically by path, category, and locale.
- Placeholder checking applies to direct leaves and matching variant leaves.
- The validator does not infer fixes, rewrite the catalog, or call external services.
If you want to act on translation gaps after validation, pair this module with XCSTranslator and XCSWriter.