{"record":{"id":"62fc06727408b86e","repo":"Humanizr/Humanizer","slug":"ordinal-date-profile-profile-profilename-has-c","errorCode":null,"errorMessage":"Ordinal date profile '{profile.ProfileName}' has calendar month overrides but pattern does not contain an unescaped MMMM specifier.","messagePattern":"Ordinal date profile '(.+?)' has calendar month overrides but pattern does not contain an unescaped MMMM specifier\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/OrdinalDateProfileCatalogInput.cs","lineNumber":202,"sourceCode":"            var pattern = GetRequiredString(profile.Root, \"pattern\");\n            var hasGregorianMonths = profile.Months.Length > 0;\n            var hasHijriMonths = profile.HijriMonths.Length > 0;\n            var hasAnyMonthOverride = hasGregorianMonths || hasHijriMonths;\n\n            if (hasAnyMonthOverride && ContainsAbbreviatedMonth(pattern))\n            {\n                throw new InvalidOperationException(\n                    $\"Ordinal date profile '{profile.ProfileName}' uses MMM (abbreviated month) \" +\n                    \"which is not supported when calendar month overrides are active. \" +\n                    \"Only MMMM (full month name) substitution is supported.\");\n            }\n\n            if (hasAnyMonthOverride)\n            {\n                var mmmmCount = CountUnescapedFullMonth(pattern);\n                if (mmmmCount == 0)\n                {\n                    throw new InvalidOperationException(\n                        $\"Ordinal date profile '{profile.ProfileName}' has calendar month overrides \" +\n                        \"but pattern does not contain an unescaped MMMM specifier.\");\n                }\n\n                if (mmmmCount > 1)\n                {\n                    throw new InvalidOperationException(\n                        $\"Ordinal date profile '{profile.ProfileName}' has calendar month overrides \" +\n                        \"but pattern contains multiple unescaped MMMM specifiers. Only one is supported.\");\n                }\n            }\n\n            var calendarMode = GetOptionalString(profile.Root, \"calendarMode\");\n            var hasCalendarMode = calendarMode is not null && !string.Equals(calendarMode, \"Gregorian\", StringComparison.OrdinalIgnoreCase);\n\n            var expr = \"new \" + converterTypeName + \"(new OrdinalDatePattern(\" +\n                       QuoteLiteral(pattern) +\n                       \", OrdinalDateDayMode.\" +","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/OrdinalDateProfileCatalogInput.cs#L184-L220","documentation":"Thrown during source generation by CreatePatternExpression when an ordinal-date profile has calendar month overrides (months or hijriMonths defined) but the pattern string contains zero unescaped MMMM specifiers. The generator needs exactly one MMMM token to inject the overridden month name; without it, the overrides are useless and the generator rejects the configuration.","triggerScenarios":"A locale YAML defines calendar.months or calendar.hijriMonths but the ordinal-date pattern has no MMMM token — for example the pattern is 'dd yyyy' (day and year only) or all month references are escaped inside string literals.","commonSituations":"A maintainer adds month overrides but the pattern was designed for a locale that doesn't display month names, or the MMMM was accidentally removed or escaped during pattern editing.","solutions":["Add an unescaped MMMM specifier to the pattern string so the generator can inject the overridden month name.","Remove the calendar.months and calendar.hijriMonths overrides if the pattern intentionally does not display month names.","Check for accidentally escaped MMMM — ensure it is not inside single quotes in the .NET format string."],"exampleFix":"# locale YAML — before (month overrides but no MMMM in pattern)\nordinalDate:\n  engine: pattern\n  pattern: \"dd yyyy\"\ncalendar:\n  months:\n    - January\n    - February\n\n# after — add MMMM to pattern\nordinalDate:\n  engine: pattern\n  pattern: \"dd MMMM yyyy\"\ncalendar:\n  months:\n    - January\n    - February","handlingStrategy":"validation","validationCode":"// Before building, if a locale YAML has calendar month overrides for\n// ordinal dates, verify the pattern contains exactly one unescaped MMMM.\n// An escaped MMMM (inside single quotes) does not count.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When adding calendar month overrides, ensure the ordinal-date pattern includes at least one unescaped MMMM.","Remove month overrides if the pattern intentionally does not display month names.","Check for accidentally escaped MMMM tokens inside single-quote literal sections."],"tags":["source-generator","locale-yaml","ordinal-date","calendar","date-format","build-time"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}