1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Fix verification of single locale (#10262)

The `verify-locale-strings.js` script would blow up if you tried to
verify a single locale. It now works.
This commit is contained in:
Mark Stacey 2021-01-26 13:29:14 -03:30 committed by GitHub
parent 7ebab83e40
commit 5b1da2cd4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,13 +54,17 @@ main().catch((error) => {
async function main() {
if (specifiedLocale) {
log.info(`Verifying selected locale "${specifiedLocale}":\n`)
const locale = localeIndex.find(
const localeEntry = localeIndex.find(
(localeMeta) => localeMeta.code === specifiedLocale,
)
if (!localeEntry) {
throw new Error(`No localize entry found for ${specifiedLocale}`)
}
const failed =
locale.code === 'en'
specifiedLocale === 'en'
? await verifyEnglishLocale()
: await verifyLocale(locale)
: await verifyLocale(specifiedLocale)
if (failed) {
process.exit(1)
}