Skip to content

Commit ae01092

Browse files
Felipenesssahitya-chandraromitg2
authored
fix: use i18n for apps count with proper pluralization (calcom#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 calcom#28407 * fix: update e2e test to match i18n singular/plural apps count --------- Co-authored-by: Sahitya Chandra <sahityajb@gmail.com> Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
1 parent 96d78a0 commit ae01092

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

apps/web/playwright/apps/analytics/analyticsApps.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ test.describe("check analytics Apps", () => {
2222
await page.goto("/event-types");
2323
await appsPage.goToEventType("30 min");
2424
await appsPage.goToAppsTab();
25-
await appsPage.verifyAppsInfo(0);
25+
await appsPage.verifyAppsInfo(1, 0);
2626
await appsPage.activeApp(app);
27-
await appsPage.verifyAppsInfo(1);
27+
await appsPage.verifyAppsInfo(1, 1);
2828
});
2929
});
3030
});

apps/web/playwright/fixtures/apps.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ export function createAppsFixture(page: Page) {
127127
activeApp: async (app: string) => {
128128
await page.locator(`[data-testid='${app}-app-switch']`).click();
129129
},
130-
verifyAppsInfo: async (activeApps: number) => {
131-
await expect(page.locator(`text=1 apps, ${activeApps} active`)).toBeVisible();
130+
verifyAppsInfo: async (installedApps: number, activeApps: number) => {
131+
const appsLabel = installedApps === 1 ? "app" : "apps";
132+
await expect(
133+
page.locator(`text=${installedApps} ${appsLabel}, ${activeApps} active`)
134+
).toBeVisible();
132135
},
133136
verifyAppsInfoNew: async (app: string, eventTypeId: number) => {
134137
await page.goto(`event-types/${eventTypeId}?tabName=apps`);

packages/platform/atoms/event-types/hooks/useTabsNavigations.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ function getNavigation({
216216
name: t("apps"),
217217
href: `/event-types/${id}?tabName=apps`,
218218
icon: "grid-3x3",
219-
//TODO: Handle proper translation with count handling
220-
info: `${installedAppsNumber} apps, ${enabledAppsNumber} ${t("active")}`,
219+
info: `${t("number_apps", { count: installedAppsNumber })}, ${enabledAppsNumber} ${t("active")}`,
221220
"data-testid": "apps",
222221
},
223222
];

0 commit comments

Comments
 (0)