diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-18 18:38:21 +0100 |
|---|---|---|
| committer | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-18 18:38:21 +0100 |
| commit | 7ec49f16a3c8f76dcbe1a12edb50e23096ae27ff (patch) | |
| tree | b6176966af3aa3b36905d3610c7fde6f4e1d7586 /src/components/Footer.astro | |
| parent | dcf5bd40027f4264d2cd201278824e185869c412 (diff) | |
Localises back to top link
Diffstat (limited to 'src/components/Footer.astro')
| -rw-r--r-- | src/components/Footer.astro | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/Footer.astro b/src/components/Footer.astro index a346877..c636c8d 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -1,9 +1,14 @@ --- +import translate from '$i18n/translate'; +import tSite from '$i18n/translations/site'; +import getLocaleFromPath from '$lib/getLocaleFromPath'; +const locale = getLocaleFromPath(Astro.url.pathname); +const t = translate(locale); --- <footer> <p class="back-to-top-link"> - <a class="btn" href="#top">▴ Back til tap</a> + <a class="btn" href="#top">▴ {t(tSite, { key: 'back-to-top' })}</a> </p> </footer> |
