diff --git a/config/i18n.config.ts b/config/i18n.config.ts index 0e1dec3..96130db 100644 --- a/config/i18n.config.ts +++ b/config/i18n.config.ts @@ -3,7 +3,7 @@ import type { LocaleObject } from "vue-i18n-routing"; import type de from "@/messages/de.json"; import type en from "@/messages/en.json"; -export const locales = ["de"] as const; +export const locales = ["de", "en"] as const; export type Locale = (typeof locales)[number]; @@ -11,6 +11,7 @@ export const defaultLocale: Locale = "de"; export const localesMap = { de: { code: "de", iso: "de", file: "de.json" }, + en: { code: "en", iso: "en", file: "en.json" }, } satisfies Record; export type Messages = typeof de; diff --git a/e2e/tests/app/analytics.test.ts b/e2e/tests/app/analytics.test.ts index 4596f5b..655ffae 100644 --- a/e2e/tests/app/analytics.test.ts +++ b/e2e/tests/app/analytics.test.ts @@ -10,7 +10,7 @@ if (process.env.NUXT_PUBLIC_MATOMO_BASE_URL && process.env.NUXT_PUBLIC_MATOMO_ID test.describe("analytics service", () => { test("should track page views", async ({ page }) => { const initialResponsePromise = page.waitForResponse(baseUrl); - await page.goto("/en"); + await page.goto("/de"); const initialResponse = await initialResponsePromise; expect(initialResponse.status()).toBe(204); diff --git a/e2e/tests/app/app.test.ts b/e2e/tests/app/app.test.ts index 488fe1c..5dbba70 100644 --- a/e2e/tests/app/app.test.ts +++ b/e2e/tests/app/app.test.ts @@ -107,7 +107,7 @@ test.describe("app", () => { test.use({ colorScheme: "no-preference" }); test("with no preference", async ({ page }) => { - await page.goto("/en"); + await page.goto("/de"); await expect(page.locator("html")).toHaveAttribute("data-ui-color-scheme", "light"); }); }); @@ -116,7 +116,7 @@ test.describe("app", () => { test.use({ colorScheme: "light" }); test("in light mode", async ({ page }) => { - await page.goto("/en"); + await page.goto("/de"); await expect(page.locator("html")).toHaveAttribute("data-ui-color-scheme", "light"); }); }); @@ -125,21 +125,21 @@ test.describe("app", () => { test.use({ colorScheme: "dark" }); test("in dark mode", async ({ page }) => { - await page.goto("/en"); + await page.goto("/de"); await expect(page.locator("html")).toHaveAttribute("data-ui-color-scheme", "dark"); }); }); - // test("should skip to main content with skip-link", async ({ createIndexPage }) => { - // const locale = "en"; + test.skip("should skip to main content with skip-link", async ({ createIndexPage }) => { + const locale = "en"; - // const { indexPage } = await createIndexPage(locale); - // await indexPage.goto(); + const { indexPage } = await createIndexPage(locale); + await indexPage.goto(); - // await indexPage.page.keyboard.press("Tab"); - // await expect(indexPage.skipLink).toBeFocused(); + await indexPage.page.keyboard.press("Tab"); + await expect(indexPage.skipLink).toBeFocused(); - // await indexPage.skipLink.click(); - // await expect(indexPage.mainContent).toBeFocused(); - // }); + await indexPage.skipLink.click(); + await expect(indexPage.mainContent).toBeFocused(); + }); }); diff --git a/e2e/tests/app/i18n.test.ts b/e2e/tests/app/i18n.test.ts index cbe63c6..ad42c14 100644 --- a/e2e/tests/app/i18n.test.ts +++ b/e2e/tests/app/i18n.test.ts @@ -50,7 +50,8 @@ test.describe("i18n", () => { await expect(page.getByRole("heading", { name: "Seite nicht gefunden" })).toBeVisible(); }); - test("should support switching locale", async ({ page }) => { + // use only one locale at the moment + test.skip("should support switching locale", async ({ page }) => { await page.goto("/de/imprint"); await expect(page).toHaveURL("/de/imprint"); await expect(page.getByRole("heading", { name: "Impressum" })).toBeVisible(); @@ -70,7 +71,7 @@ test.describe("i18n", () => { } }); - test("should set alternate links in link tags", async ({ page }) => { + test.skip("should set alternate links in link tags", async ({ page }) => { function createAbsoluteUrl(pathname: string) { return String(createUrl({ baseUrl, pathname })); } diff --git a/e2e/tests/app/metadata.test.ts b/e2e/tests/app/metadata.test.ts index 5363dda..99f730b 100644 --- a/e2e/tests/app/metadata.test.ts +++ b/e2e/tests/app/metadata.test.ts @@ -36,7 +36,7 @@ test("should disallow indexing of not-found page", async ({ page }) => { }); test.describe("should set page metadata", () => { - test("static", async ({ page }) => { + test.skip("static", async ({ page }) => { await page.goto("/en"); const ogType = page.locator('meta[property="og:type"]'); @@ -55,7 +55,7 @@ test.describe("should set page metadata", () => { // await expect(googleSiteVerification).toHaveAttribute("content", ""); }); - test("with en locale", async ({ page }) => { + test.skip("with en locale", async ({ page }) => { await page.goto("/en"); await expect(page).toHaveTitle("Home | SiCProD"); @@ -99,7 +99,7 @@ test.describe("should set page metadata", () => { }); test.describe("should add json+ld metadata", () => { - test("with en locale", async ({ page }) => { + test.skip("with en locale", async ({ page }) => { await page.goto("/en"); const metadata = await page.locator('script[type="application/ld+json"]').textContent(); diff --git a/server/routes/manifest.webmanifest.get.ts b/server/routes/manifest.webmanifest.get.ts index 036053a..2cb2728 100644 --- a/server/routes/manifest.webmanifest.get.ts +++ b/server/routes/manifest.webmanifest.get.ts @@ -1,10 +1,10 @@ import { createI18n } from "vue-i18n"; -import en from "@/messages/en.json"; +import de from "@/messages/de.json"; -const locale = "en"; +const locale = "de"; -const { t } = createI18n({ legacy: false, locale, messages: { en } }).global; +const { t } = createI18n({ legacy: false, locale, messages: { de } }).global; const manifest = { name: t("Manifest.name"),