{"record":{"id":"804fad624416ae87","repo":"Humanizr/Humanizer","slug":"unsupported-ordinal-date-engine-profile-engine","errorCode":null,"errorMessage":"Unsupported ordinal date engine '{profile.Engine}'.","messagePattern":"Unsupported ordinal date engine '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/OrdinalDateProfileCatalogInput.cs","lineNumber":179,"sourceCode":"            {\n                builder.AppendLine();\n                builder.AppendLine(\"#endif\");\n            }\n\n            context.AddSource(sourceName, SourceText.From(builder.ToString(), Encoding.UTF8));\n        }\n\n        static string CreateConverterExpression(OrdinalDateProfileDefinition profile, string converterTypeName) =>\n            profile.Engine switch\n            {\n                \"default\" => converterTypeName switch\n                {\n                    \"PatternDateToOrdinalWordsConverter\" => \"new DefaultDateToOrdinalWordConverter()\",\n                    \"PatternDateOnlyToOrdinalWordsConverter\" => \"new DefaultDateOnlyToOrdinalWordConverter()\",\n                    _ => throw new InvalidOperationException($\"Unsupported default ordinal-date converter '{converterTypeName}'.\")\n                },\n                \"pattern\" => CreatePatternExpression(profile, converterTypeName),\n                _ => throw new InvalidOperationException($\"Unsupported ordinal date engine '{profile.Engine}'.\")\n            };\n\n        static string CreatePatternExpression(OrdinalDateProfileDefinition profile, string converterTypeName)\n        {\n            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)","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/OrdinalDateProfileCatalogInput.cs#L161-L197","documentation":"Thrown during source generation by CreateConverterExpression when an ordinal-date profile's engine value is neither 'default' nor 'pattern'. The generator only supports these two engine identifiers for ordinal-date conversion; any other value causes the switch's default arm to fire.","triggerScenarios":"A locale YAML has an ordinal-date block with an engine value that is misspelled, uses different casing (the switch is case-sensitive), or names an engine that was never implemented for ordinal dates.","commonSituations":"A maintainer copies a locale YAML from another feature (e.g. numberToWords) that uses a different engine name and forgets to change it to 'default' or 'pattern'. Or a typo such as 'Default' (capital D) or 'patten' breaks the case-sensitive match.","solutions":["Open the locale YAML and set the ordinal-date engine to either 'default' or 'pattern' (lowercase, exact spelling).","If the engine key is omitted, note that the default is 'pattern' (see AddProfile at line 73) — so this error only fires when an explicit non-matching value is present.","Remove the engine key entirely if you want the default 'pattern' behavior."],"exampleFix":"# locale YAML — before\nordinalDate:\n  engine: Default\n  pattern: \"dddd, d MMMM yyyy\"\n\n# after\nordinalDate:\n  engine: pattern\n  pattern: \"dddd, d MMMM yyyy\"","handlingStrategy":"validation","validationCode":"// Before building, validate that the ordinal-date engine value in each\n// locale YAML is exactly 'default' or 'pattern' (lowercase, case-sensitive).\n// If the engine key is omitted, 'pattern' is the implicit default.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use exactly 'default' or 'pattern' for the ordinal-date engine value — the switch is case-sensitive.","Omit the engine key entirely if you want the default 'pattern' behavior.","Run dotnet build after any locale YAML change to catch typos early."],"tags":["source-generator","locale-yaml","ordinal-date","engine","build-time"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}