umijs / plugins

🍣 The one-stop shop for official Umi plugins and presets.
348 stars 238 forks source link

[plugin-locale] lang key should support standard intl language tag? #173

Open leftstick opened 4 years ago

leftstick commented 4 years ago

Copied from https://github.com/umijs/umi/issues/4520.

Right now, we only support {lang}-{country} format, but browser give us more via navigator.language, it might be zh-Hans-CN, or just zh

leftstick commented 4 years ago

We may use library like subtag to parse the language tag we retrieved via navigator.language