diff --git a/packages/@uppy/core/src/locale.js b/packages/@uppy/core/src/locale.js index 25783f26f9..34d229541e 100644 --- a/packages/@uppy/core/src/locale.js +++ b/packages/@uppy/core/src/locale.js @@ -51,6 +51,7 @@ export default { search: 'Search', resetSearch: 'Reset search', emptyFolderAdded: 'No files were added from empty folder', + addedNumFiles: 'Added %{numFiles} file(s)', folderAlreadyAdded: 'The folder "%{folder}" was already added', folderAdded: { 0: 'Added %{smart_count} file from %{folder}', diff --git a/packages/@uppy/locales/src/en_US.js b/packages/@uppy/locales/src/en_US.js index c29bbadfba..01decba47d 100644 --- a/packages/@uppy/locales/src/en_US.js +++ b/packages/@uppy/locales/src/en_US.js @@ -12,6 +12,7 @@ en_US.strings = { '0': 'Failed to add %{smart_count} file due to an internal error', '1': 'Failed to add %{smart_count} files due to internal errors', }, + addedNumFiles: 'Added %{numFiles} file(s)', addingMoreFiles: 'Adding more files', addMore: 'Add more', addMoreFiles: 'Add more files', diff --git a/packages/@uppy/locales/src/fr_FR.js b/packages/@uppy/locales/src/fr_FR.js index 748e2934d2..2781de60fd 100644 --- a/packages/@uppy/locales/src/fr_FR.js +++ b/packages/@uppy/locales/src/fr_FR.js @@ -12,9 +12,10 @@ fr_FR.strings = { '0': 'L\'ajout de %{smart_count} fichier a échoué', '1': 'L\'ajout de %{smart_count} fichiers a échoué', }, + addedNumFiles: '%{numFiles} fichier(s) ajouté(s)', + addingMoreFiles: 'En train d\'ajouter des fichiers', addMore: 'Ajouter d\'autres', addMoreFiles: 'Ajouter d\'autres fichiers', - addingMoreFiles: 'En train d\'ajouter des fichiers', allFilesFromFolderNamed: 'Tous les fichiers du dossier %{name}', allowAccessDescription: 'Pour prendre des photos ou enregistrer une vidéo avec votre caméra, veuillez autoriser l\'accès à votre caméra pour ce site.', allowAccessTitle: 'Veuillez autoriser l\'accès à votre caméra', diff --git a/packages/@uppy/provider-views/src/Loader.jsx b/packages/@uppy/provider-views/src/Loader.jsx index 0572ad2aae..c849edf742 100644 --- a/packages/@uppy/provider-views/src/Loader.jsx +++ b/packages/@uppy/provider-views/src/Loader.jsx @@ -1,9 +1,12 @@ import { h } from 'preact' -export default ({ i18n }) => { +export default ({ i18n, loading }) => { return (
{i18n('loading')} + {typeof loading === 'string' && ( // todo improve this, see discussion in https://github.com/transloadit/uppy/pull/4399#discussion_r1162564445 + {loading} + )}
) } diff --git a/packages/@uppy/provider-views/src/ProviderView/ProviderView.jsx b/packages/@uppy/provider-views/src/ProviderView/ProviderView.jsx index 3690cf6348..9b6a28fbff 100644 --- a/packages/@uppy/provider-views/src/ProviderView/ProviderView.jsx +++ b/packages/@uppy/provider-views/src/ProviderView/ProviderView.jsx @@ -280,6 +280,7 @@ export default class ProviderView extends View { if (!this.plugin.uppy.checkIfFileAlreadyExists(id)) { newFiles.push(fileInFolder) numNewFiles++ + this.setLoading(this.plugin.uppy.i18n('addedNumFiles', { numFiles: numNewFiles })) } isEmpty = false } @@ -384,7 +385,7 @@ export default class ProviderView extends View { if (loading) { return ( - + ) }