{"record":{"id":"fe984e350fb79227","repo":"Humanizr/Humanizer","slug":"locale-localecode-surfaces-defines-unsupported","errorCode":null,"errorMessage":"Locale '{localeCode}.surfaces' defines unsupported surface '{surface.Key}'. Supported surfaces: {string.Join(\", \", SupportedSurfaceNames)}.","messagePattern":"Locale '(.+?)\\.surfaces' defines unsupported surface '(.+?)'\\. Supported surfaces: (.+?)\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs","lineNumber":112,"sourceCode":"                    throw new InvalidOperationException(\n                        $\"Locale '{localeCode}' must define required top-level property 'surfaces'.\");\n                }\n\n                surfaces = new SimpleYamlMapping(\n                    ImmutableDictionary<string, SimpleYamlValue>.Empty.WithComparers(StringComparer.Ordinal));\n            }\n            else\n            {\n                surfaces = surfacesValue is SimpleYamlMapping surfacesMapping\n                    ? surfacesMapping\n                    : throw new InvalidOperationException($\"Locale '{localeCode}.surfaces' must be a mapping.\");\n            }\n\n            foreach (var surface in surfaces.Values)\n            {\n                if (!SupportedSurfaceNames.Contains(surface.Key, StringComparer.Ordinal))\n                {\n                    throw new InvalidOperationException(\n                        $\"Locale '{localeCode}.surfaces' defines unsupported surface '{surface.Key}'. \" +\n                        $\"Supported surfaces: {string.Join(\", \", SupportedSurfaceNames)}.\");\n                }\n\n                if (surface.Value is not SimpleYamlMapping)\n                {\n                    throw new InvalidOperationException(\n                        $\"Locale '{localeCode}.surfaces.{surface.Key}' must be a mapping.\");\n                }\n\n                RejectExplicitDefaultEngines(localeCode, $\"surfaces.{surface.Key}\", surface.Value);\n            }\n\n            return new CanonicalLocaleDocument(\n                localeCode,\n                variantOf,\n                surfaces,\n                NormalizeCanonicalText(fileText));","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/CanonicalLocaleAuthoring.cs#L94-L130","documentation":"Each key under `surfaces:` must be one of the supported surface names: list, formatter, durationCases, phrases, number, ordinal, clock, compass, calendar, inflection (CanonicalLocaleAuthoring.cs:108-115). Unknown surface keys are rejected so contributors don't add content the generator ignores.","triggerScenarios":"A surface key typo (cloc, calender), or a legacy flat name placed under surfaces (e.g. surfaces.numberToWords instead of surfaces.number.words).","commonSituations":"Renaming/migrating a locale and putting the old property name under surfaces; spelling mistakes.","solutions":["Rename the key to a supported surface name from the list in the message.","For number content use surfaces.number.words / .parse / .formatting rather than a top-level numberToWords.","Remove the surface if it was added by mistake."],"exampleFix":"# before\nsurfaces:\n  cloc: {}\n# after\nsurfaces:\n  clock: {}","handlingStrategy":"validation","validationCode":"import yaml, sys\nALLOWED = {'list','formatter','durationCases','phrases','number','ordinal','clock','compass','calendar','inflection'}\ndoc = yaml.safe_load(open(sys.argv[1], encoding='utf-8'))\nif isinstance(doc.get('surfaces'), dict):\n    bad = [k for k in doc['surfaces'] if k not in ALLOWED]\n    assert not bad, f'unsupported surfaces: {bad}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Author locales against the canonical schema; the error message lists the exact allowed names.","Run `dotnet build src/Humanizer/Humanizer.csproj` locally so the generator reports locale errors before push.","Copy an existing compliant locale file as your template rather than writing YAML from scratch."],"tags":["locale-authoring","yaml","source-generator","build","localization","schema"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}