Skip to content

Commit

Permalink
Merge pull request #44553 from nextcloud/backport/44526/stable29
Browse files Browse the repository at this point in the history
[stable29] fix(files): Fix translation of "Delete file"
  • Loading branch information
nickvergessen authored Apr 2, 2024
2 parents c0245f5 + 16140bd commit 991ee6f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
20 changes: 16 additions & 4 deletions apps/files/src/actions/deleteAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,41 @@ const displayName = (nodes: Node[], view: View) => {
* share, we can only unshare them.
*/
if (canUnshareOnly(nodes)) {
return n('files', 'Leave this share', 'Leave these shares', nodes.length)
if (nodes.length === 1) {
return t('files', 'Leave this share')
}
return t('files', 'Leave these shares')
}

/**
* If those nodes are all the root node of an
* external storage, we can only disconnect it.
*/
if (canDisconnectOnly(nodes)) {
return n('files', 'Disconnect storage', 'Disconnect storages', nodes.length)
if (nodes.length === 1) {
return t('files', 'Disconnect storage')
}
return t('files', 'Disconnect storages')
}

/**
* If we're only selecting files, use proper wording
*/
if (isAllFiles(nodes)) {
return n('files', 'Delete file', 'Delete files', nodes.length)
if (nodes.length === 1) {
return t('files', 'Delete file')
}
return t('files', 'Delete files')
}

/**
* If we're only selecting folders, use proper wording
*/
if (isAllFolders(nodes)) {
return n('files', 'Delete folder', 'Delete folders', nodes.length)
if (nodes.length === 1) {
return t('files', 'Delete folder')
}
return t('files', 'Delete folders')
}

return t('files', 'Delete')
Expand Down
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-init.js.map

Large diffs are not rendered by default.

0 comments on commit 991ee6f

Please sign in to comment.