Skip to content

Commit 4bb14dd

Browse files
authored
Merge pull request #53589 from nextcloud/backport/53567/stable31
[stable31] fix(files): add plural form for selected nodes
2 parents 5aca754 + e272377 commit 4bb14dd

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

apps/files/src/components/FilesListVirtual.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
</template>
2121

2222
<template v-if="!isNoneSelected" #header-overlay>
23-
<span class="files-list__selected">{{ t('files', '{count} selected', { count: selectedNodes.length }) }}</span>
23+
<span class="files-list__selected">
24+
{{ n('files', '{count} selected', '{count} selected', selectedNodes.length, { count: selectedNodes.length }) }}
25+
</span>
2426
<FilesListTableHeaderActions :current-view="currentView"
2527
:selected-nodes="selectedNodes" />
2628
</template>
@@ -65,8 +67,8 @@ import type { Location } from 'vue-router'
6567
import { showError } from '@nextcloud/dialogs'
6668
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
6769
import { Folder, Permission, View, getFileActions, FileType } from '@nextcloud/files'
68-
import { t } from '@nextcloud/l10n'
69-
import { useHotKey } from '@nextcloud/vue/dist/Composables/useHotKey.js'
70+
import { n, t } from '@nextcloud/l10n'
71+
import { useHotKey } from '@nextcloud/vue/composables/useHotKey'
7072
import { defineComponent } from 'vue'
7173
7274
import { action as sidebarAction } from '../actions/sidebarAction.ts'
@@ -134,6 +136,7 @@ export default defineComponent({
134136
selectionStore,
135137
userConfigStore,
136138
139+
n,
137140
t,
138141
}
139142
},

cypress/e2e/files/files-selection.cy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('files: Select all files', { testIsolation: true }, () => {
4040

4141
selectAllFiles()
4242

43-
cy.get('.files-list__selected').should('have.text', '7 selected')
43+
cy.get('.files-list__selected').should('contain.text', '7 selected')
4444
cy.get('[data-cy-files-list-row-checkbox]').findByRole('checkbox').should('be.checked')
4545

4646
deselectAllFiles()
@@ -59,7 +59,7 @@ describe('files: Select all files', { testIsolation: true }, () => {
5959

6060
randomFiles.forEach(name => selectRowForFile(name))
6161

62-
cy.get('.files-list__selected').should('have.text', `${randomFiles.length} selected`)
62+
cy.get('.files-list__selected').should('contain.text', `${randomFiles.length} selected`)
6363
cy.get('[data-cy-files-list-row-checkbox] input[type="checkbox"]:checked').should('have.length', randomFiles.length)
6464
})
6565

@@ -70,7 +70,7 @@ describe('files: Select all files', { testIsolation: true }, () => {
7070
selectRowForFile('readme.md')
7171
cy.window().trigger('keyup', { key: 'ShiftLeft', shiftKey: true })
7272

73-
cy.get('.files-list__selected').should('have.text', '4 selected')
73+
cy.get('.files-list__selected').should('contain.text', '4 selected')
7474
cy.get('[data-cy-files-list-row-checkbox] input[type="checkbox"]:checked').should('have.length', 4)
7575

7676
})

cypress/e2e/files_trashbin/files.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('files_trashbin: download files', { testIsolation: true }, () => {
6363
it('does not offer bulk download', () => {
6464
cy.get('[data-cy-files-list-row-checkbox]').should('have.length', 2)
6565
selectAllFiles()
66-
cy.get('.files-list__selected').should('have.text', '2 selected')
66+
cy.get('.files-list__selected').should('contain.text', '2 selected')
6767
cy.get('[data-cy-files-list-selection-action="restore"]').should('be.visible')
6868
cy.get('[data-cy-files-list-selection-action="download"]').should('not.exist')
6969
})

dist/files-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)