From ae0109225872af8d21fa36d8c95b4002417c65b7 Mon Sep 17 00:00:00 2001 From: Felipe <60716370+Felipeness@users.noreply.github.com> Date: Mon, 30 Mar 2026 08:31:11 -0300 Subject: [PATCH] fix: use i18n for apps count with proper pluralization (#28479) * fix: use i18n for apps count with proper pluralization Replace hardcoded "${installedAppsNumber} apps" with t("number_apps", { count: installedAppsNumber }) for proper i18n pluralization support. Removes the TODO comment that flagged this issue. Closes #28407 * fix: update e2e test to match i18n singular/plural apps count --------- Co-authored-by: Sahitya Chandra Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com> --- apps/web/playwright/apps/analytics/analyticsApps.e2e.ts | 4 ++-- apps/web/playwright/fixtures/apps.ts | 7 +++++-- .../atoms/event-types/hooks/useTabsNavigations.tsx | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/web/playwright/apps/analytics/analyticsApps.e2e.ts b/apps/web/playwright/apps/analytics/analyticsApps.e2e.ts index 306b054bcc..1f1ee90b54 100644 --- a/apps/web/playwright/apps/analytics/analyticsApps.e2e.ts +++ b/apps/web/playwright/apps/analytics/analyticsApps.e2e.ts @@ -22,9 +22,9 @@ test.describe("check analytics Apps", () => { await page.goto("/event-types"); await appsPage.goToEventType("30 min"); await appsPage.goToAppsTab(); - await appsPage.verifyAppsInfo(0); + await appsPage.verifyAppsInfo(1, 0); await appsPage.activeApp(app); - await appsPage.verifyAppsInfo(1); + await appsPage.verifyAppsInfo(1, 1); }); }); }); diff --git a/apps/web/playwright/fixtures/apps.ts b/apps/web/playwright/fixtures/apps.ts index 353c228f46..7ff8f5f4d0 100644 --- a/apps/web/playwright/fixtures/apps.ts +++ b/apps/web/playwright/fixtures/apps.ts @@ -127,8 +127,11 @@ export function createAppsFixture(page: Page) { activeApp: async (app: string) => { await page.locator(`[data-testid='${app}-app-switch']`).click(); }, - verifyAppsInfo: async (activeApps: number) => { - await expect(page.locator(`text=1 apps, ${activeApps} active`)).toBeVisible(); + verifyAppsInfo: async (installedApps: number, activeApps: number) => { + const appsLabel = installedApps === 1 ? "app" : "apps"; + await expect( + page.locator(`text=${installedApps} ${appsLabel}, ${activeApps} active`) + ).toBeVisible(); }, verifyAppsInfoNew: async (app: string, eventTypeId: number) => { await page.goto(`event-types/${eventTypeId}?tabName=apps`); diff --git a/packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx b/packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx index 7abaecd1a0..7a08cadb9b 100644 --- a/packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx +++ b/packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx @@ -216,8 +216,7 @@ function getNavigation({ name: t("apps"), href: `/event-types/${id}?tabName=apps`, icon: "grid-3x3", - //TODO: Handle proper translation with count handling - info: `${installedAppsNumber} apps, ${enabledAppsNumber} ${t("active")}`, + info: `${t("number_apps", { count: installedAppsNumber })}, ${enabledAppsNumber} ${t("active")}`, "data-testid": "apps", }, ];