{"record":{"id":"8aae1d06c92c1bef","repo":"Humanizr/Humanizer","slug":"duration-case-phrases-use-unsupported-plural-rule","errorCode":null,"errorMessage":"Duration case phrases use unsupported plural rule '{pluralRule}'.","messagePattern":"Duration case phrases use unsupported plural rule '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":842,"sourceCode":"                null,\n                null,\n                RequireReason(mapping.GetScalar(\"unsupported\")!, $\"{path}.unsupported\"),\n                ParseProvenance(mapping, path, required: false));\n        }\n\n        static ImmutableArray<string> GetRequiredMultipleForms(string? pluralRule) =>\n            pluralRule switch\n            {\n                null or \"none\" => [],\n                \"singular-plural\" => [\"default\", \"plural\"],\n                \"arabic-like\" => [\"default\", \"dual\", \"plural\"],\n                \"arabic-cardinal\" => [\"default\", \"zero\", \"dual\", \"plural\", \"many\"],\n                \"between2-and4-paucal\" or \"polish\" => [\"default\", \"paucal\"],\n                \"south-slavic\" or \"russian\" =>\n                    [\"default\", \"singular\", \"paucal\"],\n                \"slovenian\" => [\"default\", \"dual\", \"paucal\"],\n                \"lithuanian\" => [\"default\", \"singular\", \"plural\"],\n                _ => throw new InvalidOperationException(\n                    $\"Duration case phrases use unsupported plural rule '{pluralRule}'.\")\n            };\n\n        static void ValidateReachableMultipleForms(\n            SimpleYamlValue phraseValue,\n            string path,\n            ImmutableArray<string> requiredMultipleForms)\n        {\n            var phrase = ExpectMapping(phraseValue, path);\n            if (!phrase.TryGetValue(\"multiple\", out var multipleValue))\n            {\n                throw new InvalidOperationException(\n                    $\"Case overlay '{path}' must explicitly define numeric multiple forms.\");\n            }\n\n            if (requiredMultipleForms.IsEmpty)\n            {\n                return;","sourceCodeStart":824,"sourceCodeEnd":860,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L824-L860","documentation":"Thrown by GetRequiredMultipleForms when the plural rule string passed to DurationCaseNormalization.Parse does not match any of the known plural-rule identifiers. The switch expression has a default arm that throws for any unrecognized value, because the generator needs the plural rule to compute which multiple forms each phrase must define.","triggerScenarios":"The locale YAML (or caller) supplies a pluralRule value that is not one of: null, 'none', 'singular-plural', 'arabic-like', 'arabic-cardinal', 'between2-and4-paucal', 'polish', 'south-slavic', 'russian', 'slovenian', or 'lithuanian'.","commonSituations":"A contributor introduces a new plural-rule family or renames an existing one in the locale metadata without updating the generator's switch table. Also occurs if a locale's plural rule is misspelled or uses a different casing/convention than expected.","solutions":["Check the locale's declared plural rule and compare it against the accepted values in GetRequiredMultipleForms: none, singular-plural, arabic-like, arabic-cardinal, between2-and4-paucal, polish, south-slavic, russian, slovenian, lithuanian.","Correct the plural rule to match one of the supported identifiers (or pass null/omit it for languages with no plural distinction).","If a genuinely new plural rule is needed, add a case to the switch in GetRequiredMultipleForms and specify the required forms array."],"exampleFix":"# before\npluralRule: one-many\n# after\npluralRule: singular-plural","handlingStrategy":"validation","validationCode":"# Check plural rule against the supported set before building\n$supported = @('none','singular-plural','arabic-like','arabic-cardinal','between2-and4-paucal','polish','south-slavic','russian','slovenian','lithuanian')\n# Read the locale's declared pluralRule and verify membership","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cross-reference the locale's pluralRule with the switch in GetRequiredMultipleForms before adding durationCases.","If the locale has no plural distinction, omit pluralRule or set it to 'none'.","When adding a new plural-rule family, update the generator switch and the locale schema simultaneously."],"tags":["humanizer","locale","yaml","source-generator","duration-cases","plural-rule","build-time"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}