From 7781c69153e3956ca14684fe9a287fbbb8a01082 Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Sun, 13 Aug 2023 20:41:29 +0100 Subject: Determines current locale with lib function --- src/components/Navbar.astro | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/components/Navbar.astro') 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' })}
-