{"record":{"id":"97ced1cd9a45f297","repo":"Humanizr/Humanizer","slug":"locale-localecode-path-key-must-be-a-non-e","errorCode":null,"errorMessage":"Locale '{localeCode}.{path}.{key}' must be a non-empty string. Omit unused sparse slots instead.","messagePattern":"Locale '(.+?)\\.(.+?)\\.(.+?)' must be a non-empty string\\. Omit unused sparse slots instead\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs","lineNumber":357,"sourceCode":"            return new SimpleYamlMapping(normalizedValues.ToImmutable());\n        }\n\n        static void ValidateMinuteWordValue(\n            string localeCode,\n            string path,\n            string key,\n            SimpleYamlValue value,\n            bool allowEmpty)\n        {\n            if (value is not SimpleYamlScalar scalar || !scalar.IsString)\n            {\n                throw new InvalidOperationException(\n                    $\"Locale '{localeCode}.{path}.{key}' must be a string.\");\n            }\n\n            if (!allowEmpty && string.IsNullOrEmpty(scalar.Value))\n            {\n                throw new InvalidOperationException(\n                    $\"Locale '{localeCode}.{path}.{key}' must be a non-empty string. Omit unused sparse slots instead.\");\n            }\n        }\n\n        static void ValidateNumberFormattingBlock(string localeCode, SimpleYamlMapping formatting)\n        {\n            foreach (var property in formatting.Values.Keys.Where(static property => property is not (\"decimalSeparator\" or \"negativeSign\" or \"groupSeparator\")))\n            {\n                throw new InvalidOperationException(\n                    $\"Locale '{localeCode}.surfaces.number.formatting' defines unsupported property '{property}'. Supported properties: decimalSeparator, negativeSign, groupSeparator.\");\n            }\n\n            ValidateOptionalFormattingProperty(localeCode, formatting, \"decimalSeparator\");\n            ValidateOptionalFormattingProperty(localeCode, formatting, \"negativeSign\");\n            ValidateOptionalFormattingProperty(localeCode, formatting, \"groupSeparator\");\n\n            if (formatting.Values.Count == 0)\n            {","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs#L339-L375","documentation":"Thrown by ValidateMinuteWordValue when a clock minute slot value is a string but empty, with allowEmpty:false. The canonical schema expects unused sparse slots to be omitted entirely rather than present-but-empty, so that minute tables stay dense and unambiguous.","triggerScenarios":"A locale YAML minute entry is written as '5:' or '5: \"\"' (empty value). NormalizeMinuteWordsMapping calls ValidateMinuteWordValue with allowEmpty:false for clock minutes, hitting CanonicalLocaleAuthoring.cs:355-359.","commonSituations":"Clearing a value while editing instead of deleting the key; copying a template that left placeholder empty strings; a merge tool留下ing blank lines for removed translations.","solutions":["Delete the empty minute entry entirely from surfaces.clock.minutes (the table is sparse by design).","If the minute genuinely needs a word, fill in a non-empty localized string.","Rebuild to confirm the locale compiles."],"exampleFix":"# before\nminutes:\n  5:\n  6: six minutes\n# after\nminutes:\n  6: six minutes","handlingStrategy":"validation","validationCode":"# Detect empty minute values before building:\n# (YAML lint) ensure no 'minutes:' child is blank.\n# Quick PowerShell over the locale file:\nSelect-String -Path src/Humanizer/Locales/<code>.yml -Pattern '^\\s*\\d+:\\s*$'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Delete unused minute slots rather than leaving them empty.","Treat the minutes table as sparse: only include slots that have a real translation.","Run 'dotnet build' after edits to surface the offending {key}."],"tags":["localization","yaml","source-generator","locale","build"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}