Skip to content

Commit

Permalink
User feedback adding recursive folders take 2 (#4399)
Browse files Browse the repository at this point in the history
* show how many files are added when loading

remake of #4388

* add french (cherry pick)

* add todo
  • Loading branch information
mifi authored Apr 15, 2023
1 parent cc5b015 commit 465dec7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/@uppy/core/src/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand Down
1 change: 1 addition & 0 deletions packages/@uppy/locales/src/en_US.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion packages/@uppy/locales/src/fr_FR.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 4 additions & 1 deletion packages/@uppy/provider-views/src/Loader.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { h } from 'preact'

export default ({ i18n }) => {
export default ({ i18n, loading }) => {
return (
<div className="uppy-Provider-loading">
<span>{i18n('loading')}</span>
{typeof loading === 'string' && ( // todo improve this, see discussion in https://github.com/transloadit/uppy/pull/4399#discussion_r1162564445
<span style={{ marginTop: '.7em' }}>{loading}</span>
)}
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -384,7 +385,7 @@ export default class ProviderView extends View {
if (loading) {
return (
<CloseWrapper onUnmount={this.clearSelection}>
<LoaderView i18n={this.plugin.uppy.i18n} />
<LoaderView i18n={this.plugin.uppy.i18n} loading={loading} />
</CloseWrapper>
)
}
Expand Down

0 comments on commit 465dec7

Please sign in to comment.