From f4eb8b6fc931f7ded138dceb2b9df4c63ac7e353 Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Sat, 26 Aug 2023 16:58:27 +0100 Subject: Differentiates getLocaleFromPath failure strategies --- src/components/Navbar/Logo.astro | 4 ++-- src/components/Navbar/NavLinks.astro | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/components/Navbar') diff --git a/src/components/Navbar/Logo.astro b/src/components/Navbar/Logo.astro index 6dc372c..dc87d19 100644 --- a/src/components/Navbar/Logo.astro +++ b/src/components/Navbar/Logo.astro @@ -1,9 +1,9 @@ --- import translate from '$i18n/translate'; -import getLocaleFromPath from '$lib/getLocaleFromPath'; +import { getLocaleFromPathOrDefault } from '$lib/getLocaleFromPath'; import tSite from '$i18n/translations/site'; -const locale = getLocaleFromPath(Astro.url.pathname); +const locale = getLocaleFromPathOrDefault(Astro.url.pathname); const t = translate(locale); --- diff --git a/src/components/Navbar/NavLinks.astro b/src/components/Navbar/NavLinks.astro index fe2ade0..798c24e 100644 --- a/src/components/Navbar/NavLinks.astro +++ b/src/components/Navbar/NavLinks.astro @@ -1,11 +1,11 @@ --- -import getLocaleFromPath from '$lib/getLocaleFromPath'; +import { getLocaleFromPathOrDefault } from '$lib/getLocaleFromPath'; import translate from '$i18n/translate'; import tNews from '$i18n/translations/pages/news'; import tFurthsettins from '$i18n/translations/pages/furthsettins'; import tHame from '$i18n/translations/pages/home'; -const locale = getLocaleFromPath(Astro.url.pathname); +const locale = getLocaleFromPathOrDefault(Astro.url.pathname); const t = translate(locale); --- -- cgit v1.2.3