mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
ensure that we default users with browser language code 'zh' to the supported 'zh_CN' language code (#16329)
This commit is contained in:
parent
08a4f93b53
commit
aa59f7f89c
@ -1,8 +1,10 @@
|
||||
import browser from 'webextension-polyfill';
|
||||
import allLocales from '../../_locales/index.json';
|
||||
|
||||
// ensure that we default users with browser language code 'zh' to the supported 'zh_CN' language code
|
||||
const existingLocaleCodes = { zh: 'zh_CN' };
|
||||
|
||||
// mapping some browsers return hyphen instead underscore in locale codes (e.g. zh_TW -> zh-tw)
|
||||
const existingLocaleCodes = {};
|
||||
allLocales.forEach((locale) => {
|
||||
if (locale && locale.code) {
|
||||
existingLocaleCodes[locale.code.toLowerCase().replace('_', '-')] =
|
||||
|
Loading…
Reference in New Issue
Block a user