From e0c5ec43f5c2a105dc3c626d7c4bc74b512662f4 Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Sat, 12 Aug 2023 17:22:33 +0100 Subject: Parameterises translation --- src/pages/[locale]/furthsettins/index.astro | 10 ++++++---- .../[locale]/furthsettins/lallans/[issueNumber]/index.astro | 12 +++++------- src/pages/[locale]/furthsettins/lallans/index.astro | 8 +++++--- src/pages/[locale]/index.astro | 8 +++++--- 4 files changed, 21 insertions(+), 17 deletions(-) (limited to 'src/pages') diff --git a/src/pages/[locale]/furthsettins/index.astro b/src/pages/[locale]/furthsettins/index.astro index f59616a..45e583c 100644 --- a/src/pages/[locale]/furthsettins/index.astro +++ b/src/pages/[locale]/furthsettins/index.astro @@ -6,21 +6,23 @@ import tFurthsettins from '../../../i18n/translations/pages/furthsettins'; import tSite from '../../../i18n/translations/site'; import type Locale from '../../../types/Locale'; -export async function getStaticPaths() { return localeStaticPaths; } +export async function getStaticPaths() { + return localeStaticPaths; +} const locale = Astro.params.locale as Locale; const t = translate(locale); --- - +

Furthsettins

-
\ No newline at end of file +
diff --git a/src/pages/[locale]/furthsettins/lallans/[issueNumber]/index.astro b/src/pages/[locale]/furthsettins/lallans/[issueNumber]/index.astro index dc3cecc..876eab1 100644 --- a/src/pages/[locale]/furthsettins/lallans/[issueNumber]/index.astro +++ b/src/pages/[locale]/furthsettins/lallans/[issueNumber]/index.astro @@ -10,11 +10,9 @@ import LallansIssue from '../../../../../components/LallansIssue.astro'; export async function getStaticPaths() { const lallansIssueNumbers = Object.keys(getLallansIssue) as `${LallansIssueNumber}`[]; - return lallansIssueNumbers.flatMap(n => ( - localeStaticPaths.map(p => ( - { ...p, params: { ...p.params, issueNumber: n } } - )) - )); + return lallansIssueNumbers.flatMap((n) => + localeStaticPaths.map((p) => ({ ...p, params: { ...p.params, issueNumber: n } })) + ); } const locale = Astro.params.locale as Locale; @@ -23,6 +21,6 @@ const issueNumber = new Number(Astro.params.issueNumber).valueOf() as LallansIss const issue = await getLallansIssue[issueNumber](); --- - + - \ No newline at end of file + diff --git a/src/pages/[locale]/furthsettins/lallans/index.astro b/src/pages/[locale]/furthsettins/lallans/index.astro index 0c10b99..b565497 100644 --- a/src/pages/[locale]/furthsettins/lallans/index.astro +++ b/src/pages/[locale]/furthsettins/lallans/index.astro @@ -6,14 +6,16 @@ import tFurthsettins from '../../../../i18n/translations/pages/furthsettins'; import type Locale from '../../../../types/Locale'; import LallansIssuesGallery from '../../../../components/LallansIssuesGallery.astro'; -export async function getStaticPaths() { return localeStaticPaths; } +export async function getStaticPaths() { + return localeStaticPaths; +} const locale = Astro.params.locale as Locale; const t = translate(locale); --- - +

Lallans

-
\ No newline at end of file +
diff --git a/src/pages/[locale]/index.astro b/src/pages/[locale]/index.astro index 5f9ab7a..8ae3a7b 100644 --- a/src/pages/[locale]/index.astro +++ b/src/pages/[locale]/index.astro @@ -6,15 +6,17 @@ import site from '../../i18n/translations/site'; import home from '../../i18n/translations/pages/home'; import type Locale from '../../types/Locale'; -export async function getStaticPaths() { return localeStaticPaths; } +export async function getStaticPaths() { + return localeStaticPaths; +} const locale = Astro.params.locale as Locale; const t = translate(locale); --- - +
-

{ t(site, 'title') }

+

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

Tap-level heidin

Seicont-level heidin

Third-level heidin

-- cgit v1.2.3