diff --git a/bin/locale-packs.js b/bin/locale-packs.js index e8d115b9b..ff58b27c7 100644 --- a/bin/locale-packs.js +++ b/bin/locale-packs.js @@ -128,6 +128,7 @@ function addLocaleToPack (localePack, plugin, pluginName) { console.error(` Value in plugin: ${chalk.cyan(valueInPlugin)}`) console.error(` Value in pack : ${chalk.yellow(valueInPack)}`) console.error() + throw new Error(`Duplicate locale key: '${key}'`) } localePack[key] = localeStrings[key] // eslint-disable-line no-param-reassign } @@ -139,6 +140,7 @@ function checkForUnused (fileContents, pluginName, localePack) { const regPat = new RegExp(`(i18n|i18nArray)\\([^\\)]*['\`"]${key}['\`"]`, 'g') if (!buff.match(regPat)) { console.error(`⚠ defaultLocale key: ${chalk.magenta(key)} not used in plugin: ${chalk.cyan(pluginName)}`) + throw new Error(`Unused locale key: '${key}'`) } } } diff --git a/packages/@uppy/dashboard/src/components/AddFiles.js b/packages/@uppy/dashboard/src/components/AddFiles.js index af7e4ac12..47907f792 100644 --- a/packages/@uppy/dashboard/src/components/AddFiles.js +++ b/packages/@uppy/dashboard/src/components/AddFiles.js @@ -174,6 +174,16 @@ class AddFiles extends Component { ) } + [Symbol.for('uppy test: disable unused locale key warning')] () { + // Those are actually used in `renderDropPasteBrowseTagline` method. + this.props.i18nArray('dropPasteBoth') + this.props.i18nArray('dropPasteFiles') + this.props.i18nArray('dropPasteFolders') + this.props.i18nArray('dropPasteImportBoth') + this.props.i18nArray('dropPasteImportFiles') + this.props.i18nArray('dropPasteImportFolders') + } + renderAcquirer = (acquirer) => { return (