Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions e2e-tests/playwright/e2e/localization/locale.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,53 @@
import deBackstage from "../../../../translations/backstage-de.json" with { type: "json" };
import deRhdh from "../../../../translations/rhdh-de.json" with { type: "json" };
import deRhdhPlugins from "../../../../translations/rhdh-plugins-de.json" with { type: "json" };

import esBackstage from "../../../../translations/backstage-es.json" with { type: "json" };
import esRhdh from "../../../../translations/rhdh-es.json" with { type: "json" };
import esRhdhPlugins from "../../../../translations/rhdh-plugins-es.json" with { type: "json" };

import frBackstage from "../../../../translations/backstage-fr.json" with { type: "json" };
import frRhdh from "../../../../translations/rhdh-fr.json" with { type: "json" };
import frRhdhPlugins from "../../../../translations/rhdh-plugins-fr.json" with { type: "json" };

import itBackstage from "../../../../translations/backstage-it.json" with { type: "json" };
import itRhdh from "../../../../translations/rhdh-it.json" with { type: "json" };
import itRhdhPlugins from "../../../../translations/rhdh-plugins-it.json" with { type: "json" };

import jaBackstage from "../../../../translations/backstage-ja.json" with { type: "json" };
import jaRhdh from "../../../../translations/rhdh-ja.json" with { type: "json" };
import jaRhdhPlugins from "../../../../translations/rhdh-plugins-ja.json" with { type: "json" };

import en from "../../../../translations/test/all-en.json" with { type: "json" };

const de = {
...deBackstage,
...deRhdh,
...deRhdhPlugins,
};

const es = {
...esBackstage,
...esRhdh,
...esRhdhPlugins,
};

const fr = {
...frBackstage,
...frRhdh,
...frRhdhPlugins,
};

const it = {
...itBackstage,
...itRhdh,
...itRhdhPlugins,
};

const ja = {
...jaBackstage,
...jaRhdh,
...jaRhdhPlugins,
};

export type Locale = "de" | "en" | "es" | "fr" | "it" | "ja";
Expand Down
8 changes: 3 additions & 5 deletions e2e-tests/playwright/utils/ui-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,20 +256,18 @@ export class UIhelper {
async goToSettingsPage() {
await expect(this.page.locator("nav[id='global-header']")).toBeVisible();
await this.openProfileDropdown();
// TODO: RHDHBUGS-2552 - Strings not getting translated
// The profile dropdown renders Settings as a menuitem, not an <a> link
const settingsItem = this.page.getByRole("menuitem", {
name: "Settings",
name: t["plugin.global-header"][lang]["profile.settings"],
});
await expect(settingsItem).toBeVisible();
await settingsItem.click();
}

async goToSelfServicePage() {
await this.clickLink({
ariaLabel: "Self-service",
ariaLabel: t["rhdh"][lang]["menuItem.selfService"],
});
await this.verifyHeading(t["rhdh"][lang]["menuItem.selfService"]);
await this.verifyHeading(t["scaffolder"][lang]["templateListPage.title"]);
}

async verifyLink(
Expand Down
6 changes: 6 additions & 0 deletions translations/test/all-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
},
"scaffolder": {
"en": {
"templateListPage.title": "Self-service",
"templateListPage.contentHeader.registerExistingButtonTitle": "Import an existing Git repository"
}
},
Expand All @@ -56,6 +57,11 @@
"searchBar.title": "Search"
}
},
"plugin.global-header": {
"en": {
"profile.settings": "Settings"
}
},
"rhdh": {
"en": {
"menuItem.home": "Home",
Expand Down
Loading