{"record":{"id":"d4f9c7519db2b022","repo":"Humanizr/Humanizer","slug":"locale-localecode-surfaces-calendar-months-ite","errorCode":null,"errorMessage":"Locale '{localeCode}.surfaces.calendar.months' items must be scalar strings.","messagePattern":"Locale '(.+?)\\.surfaces\\.calendar\\.months' items must be scalar strings\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs","lineNumber":468,"sourceCode":"        {\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\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","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs#L450-L486","documentation":"Thrown by AddCalendarFeatures when surfaces.calendar.months is a 12-element sequence but one or more items is not a YAML scalar string (e.g. a nested mapping or sequence). Month names must be plain strings so they can be emitted directly into the generated calendar table.","triggerScenarios":"A month entry is written as a nested object (e.g. '- {name: Janvier}') or a sub-list. The check monthsSeq.Items.Any(item => item is not SimpleYamlScalar) at CanonicalLocaleAuthoring.cs:466-470 fires.","commonSituations":"Pasting CLDR month objects that wrap the name in metadata; mis-indenting list items so they become mappings; converting from a structured calendar format.","solutions":["Flatten every month entry to a plain scalar string in the sequence.","Verify each list item is '- Janvier' style (or inline '[Janvier, ...]'), not a nested block.","Rebuild to confirm the scalar-items check passes."],"exampleFix":"# before\ncalendar:\n  months:\n    - name: Janvier\n    - name: 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 every months item is a scalar string, not a nested object.\n# After parsing, assert: $months | ForEach-Object { $_ -is [string] }.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Flatten month entries to plain strings; do not wrap names in objects.","Prefer inline sequence form '[A, B, ...]' to avoid indentation-induced mappings.","Build after edits to surface the offending item."],"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"}