{"record":{"id":"c235daf47490a760","repo":"Humanizr/Humanizer","slug":"phrase-path-countplacement-uses-unsupported-co","errorCode":null,"errorMessage":"Phrase '{path}.countPlacement' uses unsupported count placement '{value}'.","messagePattern":"Phrase '(.+?)\\.countPlacement' uses unsupported count placement '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/LocalePhraseNormalization.cs","lineNumber":417,"sourceCode":"\n            defaultValue ??= zero ?? singular ?? dual ?? paucal ?? plural ?? many;\n            if (defaultValue is null)\n            {\n                forms = null!;\n                return false;\n            }\n\n            forms = new PhraseForms(defaultValue, zero, singular, dual, paucal, plural, many);\n            return true;\n        }\n\n        static CountPlacement ParseCountPlacement(SimpleYamlMapping mapping, string path) =>\n            GetOptionalLiteral(mapping, \"countPlacement\", $\"{path}.countPlacement\") switch\n            {\n                null or \"\" or \"before-form\" or \"before\" => CountPlacement.BeforeForm,\n                \"after-form\" or \"after\" => CountPlacement.AfterForm,\n                \"none\" => CountPlacement.None,\n                var value => throw new InvalidOperationException($\"Phrase '{path}.countPlacement' uses unsupported count placement '{value}'.\")\n            };\n\n        static NamedTemplatePhrase ParseNamedTemplate(SimpleYamlValue value, string path, params string[] allowedPlaceholders)\n        {\n            if (value is SimpleYamlScalar scalar)\n            {\n                return CreateNamedTemplatePhrase(null, scalar.Value, path, allowedPlaceholders);\n            }\n\n            var mapping = ExpectMapping(value, path);\n            RejectUnknownKeys(mapping, path, [\"name\", \"value\"]);\n            var name = GetOptionalLiteral(mapping, \"name\", $\"{path}.name\");\n            if (!mapping.TryGetValue(\"value\", out var templateValue) || templateValue is not SimpleYamlScalar templateScalar)\n            {\n                throw new InvalidOperationException($\"Template '{path}' must define a scalar 'value'.\");\n            }\n\n            return CreateNamedTemplatePhrase(name, templateScalar.Value, path, allowedPlaceholders);","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/LocalePhraseNormalization.cs#L399-L435","documentation":"Thrown by ParseCountPlacement when the 'countPlacement' value on a counted phrase is not one of the supported strings. Allowed values are: empty/before-form/before (BeforeForm), after-form/after (AfterForm), none (None). Surfaced as compiler diagnostic HSG003 (severity Error).","triggerScenarios":"Setting countPlacement to an unrecognized string such as 'pre', 'post', 'middle', 'before_count', or a locale-translated word.","commonSituations":"Author guesses a placement name instead of consulting the schema; copy-paste from a different library's convention; leftover experimental value.","solutions":["Set countPlacement to one of: 'before-form'/'before', 'after-form'/'after', or 'none'.","Omit countPlacement entirely to accept the default (BeforeForm).","Rebuild to confirm the diagnostic clears."],"exampleFix":"# before\nmultiple:\n  countPlacement: pre\n  forms:\n    singular: hour\n# after\nmultiple:\n  countPlacement: before\n  forms:\n    singular: hour","handlingStrategy":"validation","validationCode":"# countPlacement must be one of the allowed literals (or absent).\nallowed=[\"before-form\",\"before\",\"after-form\",\"after\",\"none\"]\nyq -o=json '.. | select(has(\"countPlacement\")) | .countPlacement | select(. != null and ([.] | index($$allowed) | not))' src/Humanizer/Locales/<code>.yml","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Memorize the three intents: before, after, none (or omit for the default 'before').","Do not invent placement names.","Build to confirm."],"tags":["humanizer","source-generator","locale","yaml","localization","phrases","count-placement"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}