diff --git a/src/lib/components/LanguageSwitcher.svelte b/src/lib/components/LanguageSwitcher.svelte index c711757..b80d27b 100644 --- a/src/lib/components/LanguageSwitcher.svelte +++ b/src/lib/components/LanguageSwitcher.svelte @@ -6,6 +6,7 @@ import { goto } from '$app/navigation'; import { page } from '$app/stores'; import { get } from 'svelte/store'; + import { scale } from 'svelte/transition'; function switchToLanguage(newLanguage: AvailableLanguageTag) { const canonicalPath = i18n.route(get(page).url.pathname); @@ -17,9 +18,9 @@ nl: '🇳🇱', en: '🇬🇧' } as Record; + const currentLanguage = languageTag(); const newLanguage = currentLanguage === 'nl' ? 'en' : 'nl'; - const buttonLabel = labels[newLanguage];
@@ -28,7 +29,14 @@ on:click={() => switchToLanguage(newLanguage)} title="Switch language to {newLanguage.toUpperCase()}" > - {buttonLabel} + {labels.nl} + {labels.en}
@@ -39,9 +47,25 @@ } .language-button { - font-size: 2rem; + font-size: 1.2rem; background: none; border: none; cursor: pointer; + display: flex; + align-items: center; + } + + .language-flag { + padding: 0.2rem 0.5rem; + transition: color 0.3s ease; + } + + .language-flag.selected { + transform: scale(1.4); + color: #007bff; /* Bootstrap primary color */ + } + + .separator { + margin: 0 0.5rem; }