Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow general language codes in the Metadata API #52920

Expand Up @@ -412,7 +412,15 @@ type LangCode =
| 'zh-MO'
| 'zh-SG'
| 'zh-TW'
| 'zh-Hans'
| 'zh-Hant'
| 'zu-ZA'
// We can't have all valid combinations of language-region-script listed here
// as the list is too long and breaks the TypeScript compiler. So instead we
// only add the most common ones with a general string pattern for the rest.
// This way autocompletion still works and it is still possible to add custom
// lang codes.
| `${Lowercase<string>}-${string}`

type UnmatchedLang = 'x-default'

Expand Down