{"record":{"id":"15c9f749dfd9bf99","repo":"Humanizr/Humanizer","slug":"prefixed-tens-prefix-property-name-must-map-to","errorCode":null,"errorMessage":"Prefixed tens prefix '{property.Name}' must map to an integer base value.","messagePattern":"Prefixed tens prefix '(.+?)' must map to an integer base value\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/GenerationHelpers.cs","lineNumber":1393,"sourceCode":"    }\n\n    static string CreatePrefixedTensRuleArrayExpression(JsonElement arrayElement)\n    {\n        if (arrayElement.ValueKind is not (JsonValueKind.Array or JsonValueKind.Object))\n        {\n            throw new InvalidOperationException(\"Expected JSON array or mapping.\");\n        }\n\n        var builder = new StringBuilder(\"new PrefixedTensRule[] { \");\n        var first = true;\n\n        if (arrayElement.ValueKind == JsonValueKind.Object)\n        {\n            foreach (var (Name, Value) in arrayElement.EnumerateObject()\n                         .Select(static property =>\n                         {\n                             return property.Value.ValueKind != JsonValueKind.Number || !property.Value.TryGetInt64(out var value)\n                                 ? throw new InvalidOperationException($\"Prefixed tens prefix '{property.Name}' must map to an integer base value.\")\n                                 : (property.Name, Value: value);\n                         })\n                         .OrderByDescending(static entry => entry.Name.Length)\n                         .ThenBy(static entry => entry.Name, StringComparer.Ordinal))\n            {\n                if (!first)\n                {\n                    builder.Append(\", \");\n                }\n\n                builder.Append(\"new(\");\n                builder.Append(QuoteLiteral(Name));\n                builder.Append(\", \");\n                builder.Append(Value.ToString(CultureInfo.InvariantCulture));\n                builder.Append(')');\n                first = false;\n            }\n        }","sourceCodeStart":1375,"sourceCodeEnd":1411,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/GenerationHelpers.cs#L1375-L1411","documentation":"Thrown while building a PrefixedTensRule[] when the YAML node is a mapping but one of its values is not an integer. The builder maps each tens prefix to an integer base value; a non-numeric value cannot become the rule's base.","triggerScenarios":"A locale YAML defines the prefixed-tens section as a mapping where at least one entry's value is a string, boolean, or non-integer number. The Select lambda checks ValueKind and TryGetInt64 and throws, naming the offending prefix.","commonSituations":"A contributor adds a tens prefix but supplies a word as the value instead of the integer base (e.g. zwanzig: 'twenty'). The build error names the specific prefix that is wrong.","solutions":["Set each prefixed-tens prefix's value to an unquoted integer: zwanzig: 20.","Remove any string, boolean, or decimal values from the mapping.","Rebuild; the generator names the first remaining offending prefix."],"exampleFix":"# before\nprefixedTens:\n  zwanzig: 'twenty'\n# after\nprefixedTens:\n  zwanzig: 20","handlingStrategy":"validation","validationCode":"# Every prefixed-tens prefix must map to an unquoted integer base:\n#   rg -A10 \"prefixedTens\" src/Humanizer/Locales/<code>.yml\n# No value should be a quoted string or boolean.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use unquoted integer base values for every prefixed-tens prefix.","Do not reuse the prefix word as the value.","Build locally so the generator names the first offending prefix."],"tags":["source-generator","locale-yaml","configuration","build-time","humanizer"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}