aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-03-28 09:07:24 +0800
committerkumavis <aaron@kumavis.me>2018-03-28 09:07:24 +0800
commit165ae7d193ba2d5f29e0a6472bb26fa13efd1625 (patch)
treee5a979ed1d1ea73119596fb63fdaf99fbd3c3ac4 /app
parent5c521775f6426556664f114ecbc07e13b8272cb9 (diff)
downloadtangerine-wallet-browser-165ae7d193ba2d5f29e0a6472bb26fa13efd1625.tar
tangerine-wallet-browser-165ae7d193ba2d5f29e0a6472bb26fa13efd1625.tar.gz
tangerine-wallet-browser-165ae7d193ba2d5f29e0a6472bb26fa13efd1625.tar.bz2
tangerine-wallet-browser-165ae7d193ba2d5f29e0a6472bb26fa13efd1625.tar.lz
tangerine-wallet-browser-165ae7d193ba2d5f29e0a6472bb26fa13efd1625.tar.xz
tangerine-wallet-browser-165ae7d193ba2d5f29e0a6472bb26fa13efd1625.tar.zst
tangerine-wallet-browser-165ae7d193ba2d5f29e0a6472bb26fa13efd1625.zip
i18n - derrive locale codes from index
Diffstat (limited to 'app')
-rw-r--r--app/scripts/lib/get-first-preferred-lang-code.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/scripts/lib/get-first-preferred-lang-code.js b/app/scripts/lib/get-first-preferred-lang-code.js
index 849018f26..28612f763 100644
--- a/app/scripts/lib/get-first-preferred-lang-code.js
+++ b/app/scripts/lib/get-first-preferred-lang-code.js
@@ -1,9 +1,8 @@
-const fs = require('fs')
-const path = require('path')
const extension = require('extensionizer')
const promisify = require('pify')
+const allLocales = require('../../_locales/index.json')
-const existingLocaleCodes = fs.readdirSync(path.join(__dirname, '..', '..', '_locales'))
+const existingLocaleCodes = allLocales.map(locale => locale.code)
async function getFirstPreferredLangCode () {
const userPreferredLocaleCodes = await promisify(