diff options
development - genStates - simplify locale importing
-rw-r--r-- | development/genStates.js | 4 | ||||
-rw-r--r-- | development/get-locale-messages.js | 12 |
2 files changed, 2 insertions, 14 deletions
diff --git a/development/genStates.js b/development/genStates.js index 1b21a42e5..0ac1059be 100644 --- a/development/genStates.js +++ b/development/genStates.js @@ -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') diff --git a/development/get-locale-messages.js b/development/get-locale-messages.js deleted file mode 100644 index 3b76a851d..000000000 --- a/development/get-locale-messages.js +++ /dev/null @@ -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 |