{"record":{"id":"a5554ce8457ed4f2","repo":"Humanizr/Humanizer","slug":"locale-localecode-surfaces-calendar-months-mus","errorCode":null,"errorMessage":"Locale '{localeCode}.surfaces.calendar.months' must be a sequence of exactly 12 strings.","messagePattern":"Locale '(.+?)\\.surfaces\\.calendar\\.months' must be a sequence of exactly 12 strings\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs","lineNumber":462,"sourceCode":"        }\n\n        static void AddCalendarFeatures(\n            string localeCode,\n            SimpleYamlMapping calendarSurface,\n            ImmutableDictionary<string, SimpleYamlValue>.Builder features)\n        {\n            foreach (var property in calendarSurface.Values.Keys.Where(static property => property is not (\"months\" or \"monthsGenitive\" or \"hijriMonths\")))\n            {\n                throw new InvalidOperationException(\n                    $\"Locale '{localeCode}.surfaces.calendar' defines unsupported property '{property}'. Supported properties: months, monthsGenitive, hijriMonths.\");\n            }\n\n            var hasMonths = calendarSurface.TryGetValue(\"months\", out var monthsValue);\n            if (hasMonths)\n            {\n                if (monthsValue is not SimpleYamlSequence monthsSeq || monthsSeq.Items.Length != 12)\n                {\n                    throw new InvalidOperationException(\n                        $\"Locale '{localeCode}.surfaces.calendar.months' must be a sequence of exactly 12 strings.\");\n                }\n\n                if (monthsSeq.Items.Any(static item => item is not SimpleYamlScalar))\n                {\n                    throw new InvalidOperationException(\n                        $\"Locale '{localeCode}.surfaces.calendar.months' items must be scalar strings.\");\n                }\n            }\n\n            if (calendarSurface.TryGetValue(\"monthsGenitive\", out var monthsGenitiveValue))\n            {\n                if (!hasMonths)\n                {\n                    throw new InvalidOperationException(\n                        $\"Locale '{localeCode}.surfaces.calendar.monthsGenitive' requires 'months' to also be present.\");\n                }\n","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs#L444-L480","documentation":"Thrown by AddCalendarFeatures when surfaces.calendar.months is present but is not a YAML sequence of exactly 12 entries. Month tables must cover all twelve Gregorian months with no gaps, so a shorter/longer list, a mapping, or a scalar fails the build.","triggerScenarios":"A locale YAML defines 'months: [Jan, Feb]' (too few), a mapping form, or a single string. The guard at CanonicalLocaleAuthoring.cs:460-464 requires a SimpleYamlSequence with Items.Length == 12.","commonSituations":"Translating only the months you had handy and deferring the rest; pasting from a source that used abbreviated forms and dropped entries; converting a mapping (month-name -> value) into the canonical sequence.","solutions":["Provide exactly 12 string entries in surfaces.calendar.months, one per month January..December.","If a month name is unknown, copy the reference locale's list as a placeholder and translate fully before commit.","Rebuild to confirm the length guard passes."],"exampleFix":"# before\ncalendar:\n  months: [Janvier, Février]\n# after\ncalendar:\n  months: [Janvier, Février, Mars, Avril, Mai, Juin, Juillet, Août, Septembre, Octobre, Novembre, Décembre]","handlingStrategy":"validation","validationCode":"# Ensure surfaces.calendar.months is a 12-element sequence.\n# Parse the YAML and assert: $months -is [array] -and $months.Count -eq 12.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always supply exactly 12 month strings; never leave gaps.","Use a reference locale's months list as a structural template.","Build after edits to catch length mismatches early."],"tags":["localization","yaml","source-generator","locale","build","calendar"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}