{"record":{"id":"d5232398a3e7949c","repo":"Humanizr/Humanizer","slug":"locale-localecode-surfaces-calendar-hijrimonths","errorCode":null,"errorMessage":"Locale '{localeCode}.surfaces.calendar.hijriMonths' must be a sequence of exactly 12 strings.","messagePattern":"Locale '(.+?)\\.surfaces\\.calendar\\.hijriMonths' must be a sequence of exactly 12 strings\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs","lineNumber":498,"sourceCode":"\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\n                foreach (var item in hijriSeq.Items)\n                {\n                    if (item is not SimpleYamlScalar scalar)\n                    {\n                        throw new InvalidOperationException(\n                            $\"Locale '{localeCode}.surfaces.calendar.hijriMonths' items must be scalar strings.\");\n                    }\n\n                    if (scalar.Value.IndexOfAny(['\\u200E', '\\u200F', '\\u061C']) >= 0)\n                    {\n                        throw new InvalidOperationException(\n                            $\"Locale '{localeCode}.surfaces.calendar.hijriMonths' must not contain directionality controls (U+200E, U+200F, U+061C).\");\n                    }\n                }\n            }","sourceCodeStart":480,"sourceCodeEnd":516,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs#L480-L516","documentation":"Thrown by AddCalendarFeatures when surfaces.calendar.hijriMonths is present but is not a YAML sequence of exactly 12 entries. The Hijri calendar has twelve months (Muharram..Dhu al-Hijjah), so the build enforces the exact length.","triggerScenarios":"A locale YAML defines hijriMonths with fewer/more than 12 entries, as a mapping, or as a scalar. The guard at CanonicalLocaleAuthoring.cs:496-500 requires a SimpleYamlSequence of length 12.","commonSituations":"Translating only some Hijri month names; pasting from a source that abbreviated or merged months; miscounting when porting CLDR islamic-month data.","solutions":["Provide exactly 12 Hijri month strings in surfaces.calendar.hijriMonths.","Cross-check against a reference Arabic/Islamic locale to confirm month order and count.","Rebuild to confirm the length guard passes."],"exampleFix":"# before\ncalendar:\n  hijriMonths: [Muharram, Safar]\n# after\ncalendar:\n  hijriMonths: [Muharram, Safar, Rabi al-Awwal, Rabi al-Thani, Jumada al-Awwal, Jumada al-Thani, Rajab, Shaban, Ramadan, Shawwal, Dhu al-Qidah, Dhu al-Hijjah]","handlingStrategy":"validation","validationCode":"# Ensure surfaces.calendar.hijriMonths is a 12-element sequence.\n# Parse the YAML and assert: $hijri -is [array] -and $hijri.Count -eq 12.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Supply exactly 12 Hijri month strings (Muharram..Dhu al-Hijjah).","Cross-check order and count against a reference Islamic locale.","Build after edits to catch length mismatches."],"tags":["localization","yaml","source-generator","locale","build","calendar","hijri"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}