{"record":{"id":"d764ba22cd420ee0","repo":"Humanizr/Humanizer","slug":"locale-localecode-surfaces-calendar-monthsgenit-d764ba","errorCode":null,"errorMessage":"Locale '{localeCode}.surfaces.calendar.monthsGenitive' must be a sequence of exactly 12 strings.","messagePattern":"Locale '(.+?)\\.surfaces\\.calendar\\.monthsGenitive' must be a sequence of exactly 12 strings\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs","lineNumber":483,"sourceCode":"\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            {\n                if (hijriMonthsValue is not SimpleYamlSequence hijriSeq || hijriSeq.Items.Length != 12)\n                {\n                    throw new InvalidOperationException(\n                        $\"Locale '{localeCode}.surfaces.calendar.hijriMonths' must be a sequence of exactly 12 strings.\");\n                }\n","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs#L465-L501","documentation":"Thrown by AddCalendarFeatures when surfaces.calendar.monthsGenitive is present and months is present, but the genitive list is not a YAML sequence of exactly 12 entries. Genitive months must mirror the nominative list one-to-one across all twelve months.","triggerScenarios":"A locale YAML defines monthsGenitive with fewer/more than 12 entries, as a mapping, or as a scalar. The guard at CanonicalLocaleAuthoring.cs:481-485 requires a SimpleYamlSequence of length 12.","commonSituations":"Translating only some genitive forms and deferring the rest; a locale that has genitive forms for only some months (the schema still requires all 12); copy-paste miscount.","solutions":["Provide exactly 12 genitive month strings in surfaces.calendar.monthsGenitive.","If a month has no distinct genitive form, repeat its nominative name for that slot rather than omitting it.","Rebuild to confirm the length guard passes."],"exampleFix":"# before\ncalendar:\n  months: [a, b, c, d, e, f, g, h, i, j, k, l]\n  monthsGenitive: [genA, genB]\n# after\ncalendar:\n  months: [a, b, c, d, e, f, g, h, i, j, k, l]\n  monthsGenitive: [genA, genB, genC, genD, genE, genF, genG, genH, genI, genJ, genK, genL]","handlingStrategy":"validation","validationCode":"# Ensure surfaces.calendar.monthsGenitive is a 12-element sequence.\n# Parse the YAML and assert: $gen -is [array] -and $gen.Count -eq 12.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provide exactly 12 genitive month strings to mirror 'months'.","Repeat the nominative name for months with no distinct genitive form rather than omitting.","Build after edits to catch length mismatches."],"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"}