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 <[email protected]>
Co-authored-by: Romit <[email protected]>
This commit is contained in:
3 files changed
+8
-6
No files matched your search
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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`);
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user