From dcb7fc6b28e46ec0196917552bf29ea5cf309a2d Mon Sep 17 00:00:00 2001 From: rakekniven <2069590+rakekniven@users.noreply.github.com> Date: Wed, 18 Nov 2026 21:58:22 +0100 Subject: [PATCH] fix(overview): pluralise the screen-reader result count Backport of f95247a8dcdfc3f66f5e74204cd7eb948152faca to stable35. Signed-off-by: rakekniven <2069590+rakekniven@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- src/views/OfficeOverview.spec.ts | 9 +++++++++ src/views/OfficeOverview.vue | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/views/OfficeOverview.spec.ts b/src/views/OfficeOverview.spec.ts index 731bfaea..31c2c853 100644 --- a/src/views/OfficeOverview.spec.ts +++ b/src/views/OfficeOverview.spec.ts @@ -200,6 +200,15 @@ describe('OfficeOverview > rendering states', () => { expect(wrapper.findComponent({ name: 'NcEmptyContent' }).props('name')).toBe('No office suite installed') }) + it('announces the pluralised number of files found', async () => { + getTemplatesMock.mockResolvedValue([makeCreator()]) + getAllOfficeFilesMock.mockResolvedValue(officeFilesResult([makeNode({ owner: 'alice' }), makeNode({ owner: 'alice' })])) + + const wrapper = await mountOverview() + + expect(wrapper.find('[role="status"]').text()).toBe('2 files found in Documents') + }) + it('shows "No {category} found" with a switch-to-All hint when the mine filter has no matches', async () => { getTemplatesMock.mockResolvedValue([makeCreator()]) getAllOfficeFilesMock.mockResolvedValue(officeFilesResult([])) // nothing matches "mine" (the default filter) diff --git a/src/views/OfficeOverview.vue b/src/views/OfficeOverview.vue index 8733de61..190aa446 100644 --- a/src/views/OfficeOverview.vue +++ b/src/views/OfficeOverview.vue @@ -7,7 +7,7 @@ import { computed, nextTick, ref, watch } from 'vue' import { useRoute, useRouter } from 'vue-router' import { getCurrentUser } from '@nextcloud/auth' -import { translate as t } from '@nextcloud/l10n' +import { translate as t, translatePlural as n } from '@nextcloud/l10n' import { loadState } from '@nextcloud/initial-state' import { generateUrl } from '@nextcloud/router' import NcAppContent from '@nextcloud/vue/components/NcAppContent' @@ -291,7 +291,7 @@ fetchAll()
- {{ t('office', '{count} found in {category}', { count: files.length, category: activeCategoryName }) }} + {{ n('office', '%n file found in {category}', '%n files found in {category}', files.length, { category: activeCategoryName }) }}