{"record":{"id":"6b5e448c13752d18","repo":"Humanizr/Humanizer","slug":"locale-coverage-requires-at-least-one-canonical-lo","errorCode":null,"errorMessage":"Locale coverage requires at least one canonical locale.","messagePattern":"Locale coverage requires at least one canonical locale\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/LocaleCoverageInput.cs","lineNumber":53,"sourceCode":"        ];\n\n        public ImmutableArray<LocaleCoverageCapability> Capabilities { get; } = capabilities;\n        public ImmutableArray<LocaleCoverageRow> Locales { get; } = locales;\n\n        public static LocaleCoverageInput Create(LocaleCatalogInput catalog)\n        {\n            if (!catalog.Diagnostics.IsEmpty)\n            {\n                throw new InvalidOperationException(\n                    string.Join(\n                        \"\\n\",\n                        catalog.Diagnostics\n                            .Select(static diagnostic => diagnostic.GetMessage())\n                            .OrderBy(static message => message, StringComparer.Ordinal)));\n            }\n            if (catalog.Locales.IsEmpty)\n            {\n                throw new InvalidOperationException(\"Locale coverage requires at least one canonical locale.\");\n            }\n\n            var rows = ImmutableArray.CreateBuilder<LocaleCoverageRow>(catalog.Locales.Length);\n            foreach (var locale in catalog.Locales.OrderBy(static locale => locale.LocaleCode, StringComparer.Ordinal))\n            {\n                var coverage = ImmutableDictionary.CreateBuilder<string, LocaleCoverageStatus>(StringComparer.Ordinal);\n                foreach (var definition in Definitions)\n                {\n                    var resolved = definition.IsResolved(locale);\n                    if (!resolved && !definition.Optional)\n                    {\n                        throw new InvalidOperationException(\n                            $\"Locale '{locale.LocaleCode}' does not resolve required capability '{definition.Key}' from checked-in YAML.\");\n                    }\n\n                    var contributes = definition.AuthoredFeatureNames.Any(locale.AuthoredFeatureNames.Contains);\n                    LocaleCoverageStatus status;\n                    if (contributes)","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/LocaleCoverageInput.cs#L35-L71","documentation":"Thrown by LocaleCoverageInput.Create when the resolved locale catalog contains zero canonical locales. The coverage table needs at least one locale row to be meaningful, so an empty catalog is treated as a configuration failure rather than emitting an empty report.","triggerScenarios":"The locale catalog resolved to no canonical locale entries. This happens when no locale YAML files are present, all were filtered out as non-canonical, or the catalog construction mis-scanned the Locales directory.","commonSituations":"The src/Humanizer/Locales directory is empty or all .yml files were removed/mis-named, or a directory restructuring broke the glob the generator uses to discover locales. Surfaces as a build-time generator failure.","solutions":["Confirm src/Humanizer/Locales contains the expected canonical locale .yml files (e.g. en.yml, fr.yml).","If files were moved, restore them or update the discovery path the catalog uses.","Ensure at least one locale file is recognized as canonical (correct filename and locale code)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Confirm the Locales directory is populated:\n#   ls src/Humanizer/Locales/*.yml | wc -l\n# Must be >= 1 canonical locale file (e.g. en.yml).","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never empty or relocate src/Humanizer/Locales without updating the catalog discovery path.","Ensure at least one locale file uses a canonical locale code in its filename.","Run a catalog test after directory restructuring."],"tags":["source-generator","locale-yaml","configuration","build-time","locale-coverage","humanizer"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}