diff --git a/src/components/CookieConsent.astro b/src/components/CookieConsent.astro index 9b40cb9..86b66c7 100644 --- a/src/components/CookieConsent.astro +++ b/src/components/CookieConsent.astro @@ -1,8 +1,9 @@ --- import 'vanilla-cookieconsent/dist/cookieconsent.css' import { createCookieConsentConfig } from '../CookieConsentConfig' +import { defaultLocale, type Locale } from '../i18n/locales' -const locale = (Astro.currentLocale ?? 'en') as 'en' | 'es' | 'ja' +const locale = (Astro.currentLocale ?? defaultLocale) as Locale const cookieConsentConfig = createCookieConsentConfig(locale) --- diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 48a97e5..374093c 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -2,8 +2,9 @@ import { Image } from 'astro:assets' import { getRelativeLocaleUrl } from 'astro:i18n' import logo from '../assets/xahau-logo.svg' +import { defaultLocale, type Locale } from '../i18n/locales' -const locale = Astro.currentLocale ?? 'en' +const locale = Astro.currentLocale ?? defaultLocale const translations = { en: { @@ -68,8 +69,7 @@ const translations = { }, } -type Locale = 'en' | 'es' | 'ja' -const t = translations[locale as Locale] || translations.en +const t = translations[locale as Locale] || translations[defaultLocale] ---