i18n - derrive locale codes from index
This commit is contained in:
parent
5c521775f6
commit
165ae7d193
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue