Don't hardcode locales

This commit is contained in:
CherryKitten 2022-11-28 23:43:24 +01:00
parent 95ce4151e4
commit 31af36e57e
No known key found for this signature in database
GPG Key ID: 0B696A86A853E955
1 changed files with 8 additions and 27 deletions

View File

@ -13,33 +13,14 @@ const merge = (...args) => args.reduce((a, c) => ({
.reduce((a, [k, v]) => (a[k] = merge(v, c[k]), a), {}) .reduce((a, [k, v]) => (a[k] = merge(v, c[k]), a), {})
}), {}); }), {});
const languages = [ languages = []
'ar-SA',
'cs-CZ', fs.readdirSync(__dirname).forEach((file) => {
'da-DK', if (file.includes('.yml')){
'de-DE', file = file.slice(0, file.indexOf('.'))
'en-US', languages.push(file)
'es-ES', }
'fr-FR', })
'id-ID',
'it-IT',
'ja-JP',
'ja-KS',
'kab-KAB',
'kn-IN',
'ko-KR',
'nl-NL',
'no-NO',
'pl-PL',
'pt-PT',
'ru-RU',
'sk-SK',
'ug-CN',
'uk-UA',
'vi-VN',
'zh-CN',
'zh-TW',
];
const primaries = { const primaries = {
'en': 'US', 'en': 'US',