From 4cbf85494c710d526ae064bfc732ffa0ae222924 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 18 Jun 2025 10:20:36 +0200 Subject: [PATCH] fix(files): add plural form for selected nodes Reported at Transifex: > This string needs pluralization feature, because in some languages translation of "selected" differs between singular and plural. Signed-off-by: Ferdinand Thiessen --- apps/files/src/components/FilesListVirtual.vue | 9 ++++++--- cypress/e2e/files/files-selection.cy.ts | 6 +++--- cypress/e2e/files_trashbin/files.cy.ts | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/files/src/components/FilesListVirtual.vue b/apps/files/src/components/FilesListVirtual.vue index 64fee698853..590ceb1c58f 100644 --- a/apps/files/src/components/FilesListVirtual.vue +++ b/apps/files/src/components/FilesListVirtual.vue @@ -20,7 +20,9 @@ @@ -65,8 +67,8 @@ import type { Location } from 'vue-router' import { showError } from '@nextcloud/dialogs' import { subscribe, unsubscribe } from '@nextcloud/event-bus' import { Folder, Permission, View, getFileActions, FileType } from '@nextcloud/files' -import { t } from '@nextcloud/l10n' -import { useHotKey } from '@nextcloud/vue/dist/Composables/useHotKey.js' +import { n, t } from '@nextcloud/l10n' +import { useHotKey } from '@nextcloud/vue/composables/useHotKey' import { defineComponent } from 'vue' import { action as sidebarAction } from '../actions/sidebarAction.ts' @@ -134,6 +136,7 @@ export default defineComponent({ selectionStore, userConfigStore, + n, t, } }, diff --git a/cypress/e2e/files/files-selection.cy.ts b/cypress/e2e/files/files-selection.cy.ts index d21d5cfd17c..c50543a8c7c 100644 --- a/cypress/e2e/files/files-selection.cy.ts +++ b/cypress/e2e/files/files-selection.cy.ts @@ -40,7 +40,7 @@ describe('files: Select all files', { testIsolation: true }, () => { selectAllFiles() - cy.get('.files-list__selected').should('have.text', '7 selected') + cy.get('.files-list__selected').should('contain.text', '7 selected') cy.get('[data-cy-files-list-row-checkbox]').findByRole('checkbox').should('be.checked') deselectAllFiles() @@ -59,7 +59,7 @@ describe('files: Select all files', { testIsolation: true }, () => { randomFiles.forEach(name => selectRowForFile(name)) - cy.get('.files-list__selected').should('have.text', `${randomFiles.length} selected`) + cy.get('.files-list__selected').should('contain.text', `${randomFiles.length} selected`) cy.get('[data-cy-files-list-row-checkbox] input[type="checkbox"]:checked').should('have.length', randomFiles.length) }) @@ -70,7 +70,7 @@ describe('files: Select all files', { testIsolation: true }, () => { selectRowForFile('readme.md') cy.window().trigger('keyup', { key: 'ShiftLeft', shiftKey: true }) - cy.get('.files-list__selected').should('have.text', '4 selected') + cy.get('.files-list__selected').should('contain.text', '4 selected') cy.get('[data-cy-files-list-row-checkbox] input[type="checkbox"]:checked').should('have.length', 4) }) diff --git a/cypress/e2e/files_trashbin/files.cy.ts b/cypress/e2e/files_trashbin/files.cy.ts index c3e33d1647d..4c2bce7df7a 100644 --- a/cypress/e2e/files_trashbin/files.cy.ts +++ b/cypress/e2e/files_trashbin/files.cy.ts @@ -63,7 +63,7 @@ describe('files_trashbin: download files', { testIsolation: true }, () => { it('does not offer bulk download', () => { cy.get('[data-cy-files-list-row-checkbox]').should('have.length', 2) selectAllFiles() - cy.get('.files-list__selected').should('have.text', '2 selected') + cy.get('.files-list__selected').should('contain.text', '2 selected') cy.get('[data-cy-files-list-selection-action="restore"]').should('be.visible') cy.get('[data-cy-files-list-selection-action="download"]').should('not.exist') })