diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-07-03 06:58:31 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-07-03 06:58:31 +0800 |
commit | 26e4f87ce4b256a8fd879d2c57a63124315d798e (patch) | |
tree | 24598fac8b12abeb6d97a8b1031a029e1cd48982 /development | |
parent | 3c1471d6c6d1daf7cae3f0ede18b3fb536e9da10 (diff) | |
download | tangerine-wallet-browser-26e4f87ce4b256a8fd879d2c57a63124315d798e.tar.gz tangerine-wallet-browser-26e4f87ce4b256a8fd879d2c57a63124315d798e.tar.zst tangerine-wallet-browser-26e4f87ce4b256a8fd879d2c57a63124315d798e.zip |
fix verify-locale-strings.js
Diffstat (limited to 'development')
-rw-r--r-- | development/verify-locale-strings.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/development/verify-locale-strings.js b/development/verify-locale-strings.js index 5edd35989..0eef2b35d 100644 --- a/development/verify-locale-strings.js +++ b/development/verify-locale-strings.js @@ -20,7 +20,7 @@ const specifiedLocale = process.argv[2] if (specifiedLocale) { console.log(`Verifying selected locale "${specifiedLocale}":\n\n`) const locale = localeIndex.find(localeMeta => localeMeta.code === specifiedLocale) - verifyLocale({ localeMeta }) + verifyLocale({ locale }) } else { console.log('Verifying all locales:\n\n') localeIndex.forEach(localeMeta => { @@ -33,12 +33,13 @@ if (specifiedLocale) { function verifyLocale ({ localeMeta }) { const localeCode = localeMeta.code const localeName = localeMeta.name + let targetLocale, englishLocale try { const localeFilePath = path.join(process.cwd(), 'app', '_locales', localeCode, 'messages.json') targetLocale = JSON.parse(fs.readFileSync(localeFilePath, 'utf8')) } catch (e) { - if (e.code == 'ENOENT') { + if (e.code === 'ENOENT') { console.log('Locale file not found') } else { console.log(`Error opening your locale ("${localeCode}") file: `, e) @@ -50,7 +51,7 @@ function verifyLocale ({ localeMeta }) { const englishFilePath = path.join(process.cwd(), 'app', '_locales', 'en', 'messages.json') englishLocale = JSON.parse(fs.readFileSync(englishFilePath, 'utf8')) } catch (e) { - if (e.code == 'ENOENT') { + if (e.code === 'ENOENT') { console.log('English File not found') } else { console.log('Error opening english locale file: ', e) |