{"record":{"id":"18e5d535c449d9d6","repo":"Humanizr/Humanizer","slug":"locale-localecode-surfaces-calendar-monthsgenit","errorCode":null,"errorMessage":"Locale '{localeCode}.surfaces.calendar.monthsGenitive' requires 'months' to also be present.","messagePattern":"Locale '(.+?)\\.surfaces\\.calendar\\.monthsGenitive' requires 'months' to also be present\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs","lineNumber":477,"sourceCode":"            {\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\n                if (monthsGenitiveValue is not SimpleYamlSequence genitiveSeq || genitiveSeq.Items.Length != 12)\n                {\n                    throw new InvalidOperationException(\n                        $\"Locale '{localeCode}.surfaces.calendar.monthsGenitive' must be a sequence of exactly 12 strings.\");\n                }\n\n                if (genitiveSeq.Items.Any(static item => item is not SimpleYamlScalar))\n                {\n                    throw new InvalidOperationException(\n                        $\"Locale '{localeCode}.surfaces.calendar.monthsGenitive' items must be scalar strings.\");\n                }\n            }\n\n            if (calendarSurface.TryGetValue(\"hijriMonths\", out var hijriMonthsValue))\n            {","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs#L459-L495","documentation":"Thrown by AddCalendarFeatures when surfaces.calendar.monthsGenitive is present but surfaces.calendar.months is not. Genitive month forms only make sense alongside nominative ones, so the schema enforces the pairing at build time.","triggerScenarios":"A locale YAML defines monthsGenitive but omits months. AddCalendarFeatures records hasMonths at CanonicalLocaleAuthoring.cs:458 and, when monthsGenitive is found without it, throws at lines 474-479.","commonSituations":"Adding only the genitive list because the locale reuses a parent's nominative months; deleting 'months' during cleanup while leaving 'monthsGenitive'; partial migration from a locale that combined both.","solutions":["Add a 'months' sequence of exactly 12 strings alongside 'monthsGenitive'.","Or remove 'monthsGenitive' if the locale has no distinct genitive forms.","Rebuild to confirm the pairing requirement is satisfied."],"exampleFix":"# before\ncalendar:\n  monthsGenitive: [..., ..., ...]\n# after\ncalendar:\n  months: [Styczeń, Luty, Marzec, Kwiecień, Maj, Czerwiec, Lipiec, Sierpień, Wrzesień, Październik, Listopad, Grudzień]\n  monthsGenitive: [Stycznia, Lutego, Marca, Kwietnia, Maja, Czerwca, Lipca, Sierpnia, Września, Października, Listopada, Grudnia]","handlingStrategy":"validation","validationCode":"# If monthsGenitive is present, months must also be present.\n# After parsing the calendar surface: if ($hasGenitive -and -not $hasMonths) { error }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always define 'months' whenever you define 'monthsGenitive'.","If the locale has no distinct genitive forms, omit monthsGenitive entirely.","Build after edits to catch the pairing violation."],"tags":["localization","yaml","source-generator","locale","build","calendar"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}