From be14179c2d73b0705540172d2eab06ee384db517 Mon Sep 17 00:00:00 2001 From: core Date: Fri, 6 Oct 2023 22:27:04 -0400 Subject: [PATCH] incomplete work on new i18n --- tfweb/package.json | 2 +- tfweb/src/components/LoadingWrapper.svelte | 2 +- tfweb/src/hooks.server.js | 9 - tfweb/src/hooks.server.js.map | 1 - tfweb/src/hooks.server.ts | 10 - tfweb/src/lib/i18n/index.js | 10 - tfweb/src/lib/i18n/index.js.map | 1 - tfweb/src/lib/i18n/index.ts | 12 - tfweb/src/lib/i18n/locales/en.json | 203 +--------------- tfweb/src/lib/i18n/locales/en/2fa.json | 9 + tfweb/src/lib/i18n/locales/en/2fasetup.json | 13 + tfweb/src/lib/i18n/locales/en/common.json | 19 ++ tfweb/src/lib/i18n/locales/en/hosts.json | 41 ++++ tfweb/src/lib/i18n/locales/en/itworks.json | 7 + tfweb/src/lib/i18n/locales/en/login.json | 17 ++ tfweb/src/lib/i18n/locales/en/ml.json | 8 + .../lib/i18n/locales/en/networkcreate.json | 12 + tfweb/src/lib/i18n/locales/en/roles.json | 77 ++++++ tfweb/src/lib/i18n/locales/en/signup.json | 18 ++ tfweb/src/lib/i18n/locales/nl.json | 223 ++++++++++++++++++ tfweb/src/lib/i18n/translations.ts | 27 +++ tfweb/src/routes/+layout.ts | 14 +- tfweb/src/routes/+page.svelte | 4 +- tfweb/src/routes/2fa/+page.svelte | 4 +- tfweb/src/routes/2fasetup/+page.svelte | 4 +- tfweb/src/routes/admin/+page.svelte | 4 +- tfweb/src/routes/hosts/+page.svelte | 19 +- .../hosts/[host_id]/delete/+page.svelte | 6 +- .../hosts/[host_id]/enroll/+page.svelte | 122 ++++++++++ tfweb/src/routes/hosts/add/+page.svelte | 9 +- tfweb/src/routes/lighthouses/+page.svelte | 4 +- tfweb/src/routes/login/+page.svelte | 4 +- tfweb/src/routes/magic-link/+page.svelte | 4 +- tfweb/src/routes/networkcreate/+page.svelte | 2 +- tfweb/src/routes/relays/+page.svelte | 4 +- tfweb/src/routes/roles/+page.svelte | 4 +- .../roles/[role_id]/delete/+page.svelte | 4 +- .../routes/roles/[role_id]/edit/+page.svelte | 4 +- tfweb/src/routes/roles/add/+page.svelte | 4 +- tfweb/src/routes/signup/+page.svelte | 4 +- tfweb/yarn.lock | 207 ++-------------- 41 files changed, 678 insertions(+), 474 deletions(-) delete mode 100644 tfweb/src/hooks.server.js delete mode 100644 tfweb/src/hooks.server.js.map delete mode 100644 tfweb/src/hooks.server.ts delete mode 100644 tfweb/src/lib/i18n/index.js delete mode 100644 tfweb/src/lib/i18n/index.js.map delete mode 100644 tfweb/src/lib/i18n/index.ts create mode 100644 tfweb/src/lib/i18n/locales/en/2fa.json create mode 100644 tfweb/src/lib/i18n/locales/en/2fasetup.json create mode 100644 tfweb/src/lib/i18n/locales/en/common.json create mode 100644 tfweb/src/lib/i18n/locales/en/hosts.json create mode 100644 tfweb/src/lib/i18n/locales/en/itworks.json create mode 100644 tfweb/src/lib/i18n/locales/en/login.json create mode 100644 tfweb/src/lib/i18n/locales/en/ml.json create mode 100644 tfweb/src/lib/i18n/locales/en/networkcreate.json create mode 100644 tfweb/src/lib/i18n/locales/en/roles.json create mode 100644 tfweb/src/lib/i18n/locales/en/signup.json create mode 100644 tfweb/src/lib/i18n/locales/nl.json create mode 100644 tfweb/src/lib/i18n/translations.ts create mode 100644 tfweb/src/routes/hosts/[host_id]/enroll/+page.svelte diff --git a/tfweb/package.json b/tfweb/package.json index a05dbf3..79fb14c 100644 --- a/tfweb/package.json +++ b/tfweb/package.json @@ -31,6 +31,6 @@ "bootstrap": "^5.3.2", "bootswatch": "^5.3.2", "qrcode": "^1.5.3", - "svelte-i18n": "^3.6.0" + "sveltekit-i18n": "^2.4.2" } } diff --git a/tfweb/src/components/LoadingWrapper.svelte b/tfweb/src/components/LoadingWrapper.svelte index 965c1d9..9b51662 100644 --- a/tfweb/src/components/LoadingWrapper.svelte +++ b/tfweb/src/components/LoadingWrapper.svelte @@ -1,6 +1,6 @@ + + + {$t("common.title", {values: {title: $t("common.page.hosts")}})} + + + + +

{$t("hosts.enroll.title", {values: {host: host.data.name}})}

+

{$t("hosts.enroll.explainer")}

+ {#if loading} + + {:else} +

{$t("hosts.enroll.code", {values:{code: code.code, expires: code.lifetimeSeconds / 60}})}

+ + + {/if} + + {#if hasFormErr} +

{formErr}

+ {/if} +
+
diff --git a/tfweb/src/routes/hosts/add/+page.svelte b/tfweb/src/routes/hosts/add/+page.svelte index 400245c..a2e0d20 100644 --- a/tfweb/src/routes/hosts/add/+page.svelte +++ b/tfweb/src/routes/hosts/add/+page.svelte @@ -1,5 +1,5 @@