{"record":{"id":"0971373f05c0a3b6","repo":"Humanizr/Humanizer","slug":"case-aware-citation-phrases-for-catalog-localeco-097137","errorCode":null,"errorMessage":"Case-aware citation phrases for '{catalog.LocaleCode}' require '{path}.{unitName}'.","messagePattern":"Case-aware citation phrases for '(.+?)' require '(.+?)\\.(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":917,"sourceCode":"            }\n\n            var path = $\"{catalog.LocaleCode}.phrases.duration\";\n            var phrases = phrasesValue is null\n                ? throw new InvalidOperationException(\n                    $\"Case-aware citation phrases for '{catalog.LocaleCode}' require the duration phrase surface.\")\n                : ExpectMapping(phrasesValue, $\"{catalog.LocaleCode}.phrases\");\n            if (!phrases.TryGetValue(\"duration\", out var durationValue))\n            {\n                throw new InvalidOperationException(\n                    $\"Case-aware citation phrases for '{catalog.LocaleCode}' require '{path}'.\");\n            }\n\n            var duration = ExpectMapping(durationValue, path);\n            foreach (var unitName in TimeUnits)\n            {\n                if (!duration.TryGetValue(unitName, out var phraseValue))\n                {\n                    throw new InvalidOperationException(\n                        $\"Case-aware citation phrases for '{catalog.LocaleCode}' require '{path}.{unitName}'.\");\n                }\n\n                ValidateReachableMultipleForms(\n                    phraseValue,\n                    $\"{path}.{unitName}\",\n                    requiredMultipleForms);\n            }\n        }\n\n        static ImmutableDictionary<string, DurationCaseOverlay> ResolveCases(\n            ImmutableArray<string> inventory,\n            ImmutableDictionary<string, DurationCaseRealization> realizations,\n            string path)\n        {\n            var cases = ImmutableDictionary.CreateBuilder<string, DurationCaseOverlay>(StringComparer.Ordinal);\n            foreach (var caseName in inventory)\n            {","sourceCodeStart":899,"sourceCodeEnd":935,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L899-L935","documentation":"Thrown by ValidateCitationBaseDurationForms during iteration over TimeUnits when the phrases.duration mapping is missing one of the eight required time units (millisecond, second, minute, hour, day, week, month, year). The validator checks each unit name with TryGetValue and throws on the first absence.","triggerScenarios":"The phrases.duration mapping exists but omits one or more of the eight standard time units required by the TimeUnits array.","commonSituations":"A contributor adds phrases.duration for the common units (second, minute, hour, day) but forgets the less frequently used ones (millisecond, week, month, year), or removes a unit thinking it is optional.","solutions":["Compare the keys in phrases.duration against the full TimeUnits list: millisecond, second, minute, hour, day, week, month, year.","Add the missing unit(s) with appropriate singular/multiple forms for the locale.","Rebuild to confirm all eight units are present."],"exampleFix":"# before (missing 'week', 'month', 'year')\nduration:\n  millisecond: ...\n  second: ...\n  minute: ...\n  hour: ...\n  day: ...\n# after\nduration:\n  millisecond: ...\n  second: ...\n  minute: ...\n  hour: ...\n  day: ...\n  week: ...\n  month: ...\n  year: ...","handlingStrategy":"validation","validationCode":"# Verify all 8 time units exist in phrases.duration\n$required = @('millisecond','second','minute','hour','day','week','month','year')\n# python: for u in required: assert u in yaml['phrases']['duration'], f'missing {u}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the TimeUnits array (millisecond through year) as a checklist when authoring phrases.duration.","Copy a complete phrases.duration block from an existing locale and translate each unit.","Add a localization test that enumerates all units to catch missing entries at test time."],"tags":["humanizer","locale","yaml","source-generator","duration-cases","citation","time-units","build-time"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}