aboutsummaryrefslogtreecommitdiffstats
path: root/development/verify-locale-strings.js
diff options
context:
space:
mode:
authorTrejGun <trejgun@gmail.com>2018-07-05 11:34:13 +0800
committerTrejGun <trejgun@gmail.com>2018-07-05 11:34:13 +0800
commit94d1d846fb57932fd1e959f53dbf6444f0789e91 (patch)
tree369276cd66bdcae85cac77b2c9b2458de5b08dd7 /development/verify-locale-strings.js
parentc94f639de55a867ebe8d3599d337a1f7341b1979 (diff)
parentfd218142acb6dab0b2f921b9729f17ff90cffc2d (diff)
downloadtangerine-wallet-browser-94d1d846fb57932fd1e959f53dbf6444f0789e91.tar
tangerine-wallet-browser-94d1d846fb57932fd1e959f53dbf6444f0789e91.tar.gz
tangerine-wallet-browser-94d1d846fb57932fd1e959f53dbf6444f0789e91.tar.bz2
tangerine-wallet-browser-94d1d846fb57932fd1e959f53dbf6444f0789e91.tar.lz
tangerine-wallet-browser-94d1d846fb57932fd1e959f53dbf6444f0789e91.tar.xz
tangerine-wallet-browser-94d1d846fb57932fd1e959f53dbf6444f0789e91.tar.zst
tangerine-wallet-browser-94d1d846fb57932fd1e959f53dbf6444f0789e91.zip
Merge branch 'develop' into contextTypes
# Conflicts: # ui/app/components/send_/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js
Diffstat (limited to 'development/verify-locale-strings.js')
-rw-r--r--development/verify-locale-strings.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/development/verify-locale-strings.js b/development/verify-locale-strings.js
index 8dc0a30f1..0eef2b35d 100644
--- a/development/verify-locale-strings.js
+++ b/development/verify-locale-strings.js
@@ -1,4 +1,4 @@
-////////////////////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////////////////
//
// Locale verification script
//
@@ -8,7 +8,7 @@
//
// will check the given locale against the strings in english
//
-////////////////////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////////////////
const fs = require('fs')
const path = require('path')
@@ -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 => {
@@ -30,16 +30,16 @@ if (specifiedLocale) {
}
-
-function verifyLocale({ localeMeta }) {
+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'));
+ 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)
@@ -49,9 +49,9 @@ function verifyLocale({ localeMeta }) {
try {
const englishFilePath = path.join(process.cwd(), 'app', '_locales', 'en', 'messages.json')
- englishLocale = JSON.parse(fs.readFileSync(englishFilePath, 'utf8'));
+ 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)
@@ -71,7 +71,7 @@ function verifyLocale({ localeMeta }) {
if (extraItems.length) {
console.log('\nMissing from english locale:')
- extraItems.forEach(function(key) {
+ extraItems.forEach(function (key) {
console.log(` - [ ] ${key}`)
})
} else {
@@ -80,7 +80,7 @@ function verifyLocale({ localeMeta }) {
if (missingItems.length) {
console.log(`\nMissing:`)
- missingItems.forEach(function(key) {
+ missingItems.forEach(function (key) {
console.log(` - [ ] ${key}`)
})
} else {
@@ -92,6 +92,6 @@ function verifyLocale({ localeMeta }) {
}
}
-function compareLocalesForMissingItems({ base, subject }) {
+function compareLocalesForMissingItems ({ base, subject }) {
return Object.keys(base).filter((key) => !subject[key])
}