{"record":{"id":"e098f96217f25150","repo":"Humanizr/Humanizer","slug":"locale-localecode-surfaces-calendar-hijrimonths-e098f9","errorCode":null,"errorMessage":"Locale '{localeCode}.surfaces.calendar.hijriMonths' items must be scalar strings.","messagePattern":"Locale '(.+?)\\.surfaces\\.calendar\\.hijriMonths' items must be scalar strings\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs","lineNumber":506,"sourceCode":"                {\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            }\n\n            features[\"calendar\"] = calendarSurface;\n        }\n\n        static string NormalizeCanonicalText(string value)\n        {\n            var normalized = value.Replace(\"\\r\\n\", \"\\n\");\n            normalized = normalized.TrimEnd('\\n') + \"\\n\";","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs#L488-L524","documentation":"Thrown by AddCalendarFeatures when surfaces.calendar.hijriMonths is a 12-element sequence but an item is not a YAML scalar string (e.g. a nested mapping or sequence). Hijri month names must be plain strings, and this check runs before the directionality-control check so structured items are caught first.","triggerScenarios":"A Hijri month entry is a nested object or sub-list. The loop at CanonicalLocaleAuthoring.cs:502-507 checks each item with 'item is not SimpleYamlScalar' and throws.","commonSituations":"Pasting CLDR objects that wrap names in metadata; mis-indenting list items into mappings; converting from a structured calendar source.","solutions":["Flatten every Hijri month entry to a plain scalar string.","Confirm each item is inline like '- Muharram' or an inline '[...]' list, not a nested block.","Rebuild to confirm the scalar-items check passes."],"exampleFix":"# before\ncalendar:\n  hijriMonths:\n    - name: Muharram\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 every hijriMonths item is a scalar string, not a nested object.\n# After parsing: $hijri | ForEach-Object { $_ -is [string] }.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Flatten Hijri month entries to plain strings; do not wrap names in objects.","Use inline sequence form to avoid indentation-induced mappings.","Build after edits to surface the offending item before the directionality check runs."],"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-14T00:17:13.853Z"}