mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
development - genStates - simplify locale importing
This commit is contained in:
parent
9482af6157
commit
5c521775f6
@ -1,7 +1,8 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const promisify = require('pify')
|
||||
const getLocaleMessages = require('./get-locale-messages')
|
||||
const enLocaleMessages = require('../app/_locales/en/messages.json')
|
||||
|
||||
|
||||
start().catch(console.error)
|
||||
|
||||
@ -14,7 +15,6 @@ async function start () {
|
||||
const stateFileContent = await promisify(fs.readFile)(stateFilePath, 'utf8')
|
||||
const state = JSON.parse(stateFileContent)
|
||||
|
||||
const enLocaleMessages = await getLocaleMessages()
|
||||
state.localeMessages = { en: enLocaleMessages, current: {} }
|
||||
|
||||
const stateName = stateFileName.split('.')[0].replace(/-/g, ' ', 'g')
|
||||
|
@ -1,12 +0,0 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const promisify = require('pify')
|
||||
|
||||
async function getLocaleMessages () {
|
||||
const localeMessagesPath = path.join(process.cwd(), 'app', '_locales', 'en', 'messages.json')
|
||||
const enLocaleMessagesJSON = await promisify(fs.readFile)(localeMessagesPath)
|
||||
const enLocaleMessages = JSON.parse(enLocaleMessagesJSON)
|
||||
return enLocaleMessages
|
||||
}
|
||||
|
||||
module.exports = getLocaleMessages
|
Loading…
Reference in New Issue
Block a user