From 036a3eae0de7a9d087eaa73cd34c0fcceac6f272 Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Sun, 21 Jan 2024 10:13:54 +0000 Subject: WIP: log-in page --- src/i18n/translations/pages/logIn/index.ts | 23 +++++++++++ src/pages/[locale]/log-in/index.astro | 66 ++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 src/i18n/translations/pages/logIn/index.ts create mode 100644 src/pages/[locale]/log-in/index.astro diff --git a/src/i18n/translations/pages/logIn/index.ts b/src/i18n/translations/pages/logIn/index.ts new file mode 100644 index 0000000..8316d42 --- /dev/null +++ b/src/i18n/translations/pages/logIn/index.ts @@ -0,0 +1,23 @@ +import type { TranslationsDictionary } from '$types/TranslationsDictionary'; + +const tPage = { + title: { + sco: () => 'Log in', + 'en-GB': () => 'Log in', + }, + 'label-username': { + sco: () => 'Username', + 'en-GB': () => 'Username', + }, + submit: { + sco: () => 'Log in', + 'en-GB': () => 'Log in', + }, + 'status-working': { + sco: () => 'Loggin you in…', + 'en-GB': () => 'Logging you in…', + }, +}; + +type Raw = typeof tPage; +export default tPage as TranslationsDictionary; diff --git a/src/pages/[locale]/log-in/index.astro b/src/pages/[locale]/log-in/index.astro new file mode 100644 index 0000000..35197bc --- /dev/null +++ b/src/pages/[locale]/log-in/index.astro @@ -0,0 +1,66 @@ +--- +import translate from '$i18n/translate'; +import tPage from '$i18n/translations/pages/logIn/index'; +import Page from '$layouts/Page.astro'; +import { getLocaleFromPathOrThrow } from '$lib/getLocaleFromPath'; +import localeStaticPaths from '$lib/localeStaticPaths'; + +export async function getStaticPaths() { + return localeStaticPaths; +} + +const locale = getLocaleFromPathOrThrow(Astro.url.pathname); +const t = translate(locale); +--- + + +
+

{t(tPage, { key: 'title' })}

+ +
+ + + + +
+
+
+ + -- cgit v1.2.3