diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-13 20:41:29 +0100 |
|---|---|---|
| committer | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-13 20:41:29 +0100 |
| commit | 7781c69153e3956ca14684fe9a287fbbb8a01082 (patch) | |
| tree | 6bf18977ee93608aead54dc2322c0d42c2284f78 /src/components/Navbar.astro | |
| parent | 71eac2d383c9918645e99b6b845fb8f4faecf346 (diff) | |
Determines current locale with lib function
Diffstat (limited to 'src/components/Navbar.astro')
| -rw-r--r-- | src/components/Navbar.astro | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index 45cf96b..c4e31b2 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -1,16 +1,11 @@ --- -import type Locale from '$types/Locale'; import Breadcrumbs from './Breadcrumbs.astro'; import SwitchLanguageLink from './SwitchLanguageLink.astro'; import tSite from '$i18n/translations/site'; import translate from '$i18n/translate'; +import getLocaleFromPath from '$lib/getLocaleFromPath'; -interface Props { - locale: Locale; -} - -const { locale } = Astro.props; - +const locale = getLocaleFromPath(Astro.url.pathname); const t = translate(locale); --- @@ -20,6 +15,6 @@ const t = translate(locale); {t(tSite, { key: 'scots-leid-associe' })} </a> </p> - <SwitchLanguageLink currentLocale={locale} /> + <SwitchLanguageLink /> <Breadcrumbs /> </nav> |
