Parcourir la source

Merge branch 'master' of github.com:transloadit/uppy

ifedapoolarewaju il y a 5 ans
Parent
commit
3f89cee4f0
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      bin/locale-packs.js

+ 6 - 1
bin/locale-packs.js

@@ -220,7 +220,7 @@ function test () {
 
     // Builds array with items like: 'uploadingXFiles'
     // We do not check nested items because different languages may have different amounts of plural forms.
-    followerValues[localeName] = Object.keys(require(localePath).strings)
+    followerValues[localeName] = require(localePath).strings
     followerLocales[localeName] = Object.keys(followerValues[localeName])
   })
 
@@ -240,6 +240,11 @@ function test () {
     missing.forEach((key) => {
       // Items missing are a non-fatal warning because we don't want CI to bum out over all languages
       // as soon as we add some English
+      let value = leadingValues[key]
+      if (typeof value === 'object') {
+        // For values with plural forms, just take the first one right now
+        value = value[Object.keys(value)[0]]
+      }
       warnings.push(`${chalk.cyan(followerName)} locale has missing string: '${chalk.red(key)}' that is present in ${chalk.cyan(leadingLocaleName)} with value: ${chalk.yellow(leadingValues[key])}`)
     })
     excess.forEach((key) => {