diff --git a/astro-i18n.adapter.ts b/astro-i18n.adapter.ts index 7a1686d..79e8f99 100644 --- a/astro-i18n.adapter.ts +++ b/astro-i18n.adapter.ts @@ -1,5 +1,5 @@ import type { AstroIntegration } from "astro"; -import { mkdir, access, constants, copyFile, rename } from 'node:fs/promises' +import { mkdir, access, constants, copyFile, rename } from "node:fs/promises"; const locales = ["de"]; @@ -8,30 +8,30 @@ export default function configureI18n(): AstroIntegration { name: "astro-i18n-renamer", hooks: { "astro:build:done": async ({pages, dir, logger, routes}) => { - for (let page of pages) { - let [locale, ...rest] = page.pathname.split("/"); + for (const page of pages) { + const [locale, ...rest] = page.pathname.split("/"); if (locales.includes(locale)) { - let path = rest.join("/"); - let oldPath = `${dir.pathname}${page.pathname}` - let newPath = `${dir.pathname}${path}` + const path = rest.join("/"); + const oldPath = `${dir.pathname}${page.pathname}`; + const newPath = `${dir.pathname}${path}`; try { - await access(cutPrefix(newPath), constants.R_OK | constants.W_OK) + await access(cutPrefix(newPath), constants.R_OK | constants.W_OK); } catch (e) { await mkdir(cutPrefix(newPath), {recursive: true}); } - await copyFile(`${cutPrefix(oldPath)}index.html`, `${cutPrefix(newPath)}index.html.${locale}`) - logger.info(`Copied ${oldPath}index.html to ${newPath}index.html.${locale}`) + await copyFile(`${cutPrefix(oldPath)}index.html`, `${cutPrefix(newPath)}index.html.${locale}`); + logger.info(`Copied ${oldPath}index.html to ${newPath}index.html.${locale}`); } else { - let oldPath = cutPrefix(`${dir.pathname}${page.pathname}`) - await rename(`${oldPath}index.html`, `${oldPath}index.html.en`) + const oldPath = cutPrefix(`${dir.pathname}${page.pathname}`); + await rename(`${oldPath}index.html`, `${oldPath}index.html.en`); } } } } - } + }; } function cutPrefix(path: string): string { - return process.platform === "win32" ? path.substring(1) : path + return process.platform === "win32" ? path.substring(1) : path; } \ No newline at end of file diff --git a/astro-i18n.config.ts b/astro-i18n.config.ts index d38b78f..eab5ce4 100644 --- a/astro-i18n.config.ts +++ b/astro-i18n.config.ts @@ -1,28 +1,28 @@ -import { defineAstroI18nConfig } from "astro-i18n" +import { defineAstroI18nConfig } from "astro-i18n"; export default defineAstroI18nConfig({ - primaryLocale: "en", - secondaryLocales: ["de"], - fallbackLocale: "en", - trailingSlash: "never", - run: "client+server", - showPrimaryLocale: false, - translationLoadingRules: [], - translationDirectory: {}, - translations: {}, - routes: { - de: { - about: "ueber-uns", - join: "jetzt-spielen", - imprint: "impressum", - "code-of-conduct": "verhaltensrichtlinien", - rules: "regeln", - ranked: "rangliste", - faq: "haeufige-fragen", - stats: "statistiken", - announcements: "ankuendigungen", - "privacy-policy": "datenschutzerklaerung", - "set-password": "passwort-setzen" - } - }, -}) \ No newline at end of file + primaryLocale: "en", + secondaryLocales: ["de"], + fallbackLocale: "en", + trailingSlash: "never", + run: "client+server", + showPrimaryLocale: false, + translationLoadingRules: [], + translationDirectory: {}, + translations: {}, + routes: { + de: { + about: "ueber-uns", + join: "jetzt-spielen", + imprint: "impressum", + "code-of-conduct": "verhaltensrichtlinien", + rules: "regeln", + ranked: "rangliste", + faq: "haeufige-fragen", + stats: "statistiken", + announcements: "ankuendigungen", + "privacy-policy": "datenschutzerklaerung", + "set-password": "passwort-setzen" + } + }, +}); \ No newline at end of file diff --git a/src/components/Login.svelte b/src/components/Login.svelte index 94acc61..f5b1f5d 100644 --- a/src/components/Login.svelte +++ b/src/components/Login.svelte @@ -62,7 +62,7 @@
+ {t("login.setPassword")} {#if error}{error}
diff --git a/src/content/pages/de/token.md b/src/content/pages/de/token.md deleted file mode 100644 index 87eeeeb..0000000 --- a/src/content/pages/de/token.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Erstelle einen Token für die Webseite -description: Erstelle einen Token für die Webseite -slug: token-erstellen ---- - -Ein Token ist ein Schlüssel, mit dem du dich auf der Webseite als Spieler identifizieren kannst. Dieser wird benötigt, um z.B. deine Schematics anzuzeigen. - -## Token erstellen - -Um einen Token zu erstellen, musst du dich auf dem Minecraftserver einloggen und `/token create