🚀 Staging environment, Nix shell, Biome formatter, update dependencies
All checks were successful
Build and deploy website / build (push) Successful in 56s
All checks were successful
Build and deploy website / build (push) Successful in 56s
This commit is contained in:
29
src/components/LanguageButtonGroup.svelte
Normal file
29
src/components/LanguageButtonGroup.svelte
Normal file
@ -0,0 +1,29 @@
|
||||
<script lang="ts">
|
||||
import { getLocale, type Locale, setLocale } from "@/paraglide/runtime"
|
||||
|
||||
const isEnglish = getLocale() === "en"
|
||||
|
||||
function updateLocale(lang: Locale) {
|
||||
setLocale(lang)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="join">
|
||||
<button
|
||||
onclick={() => updateLocale("nb")}
|
||||
class={[
|
||||
"btn join-item !text-cat-text border-cat-surface0",
|
||||
!isEnglish ? "bg-cat-mantle" : "bg-cat-base",
|
||||
]}>Norsk
|
||||
</button
|
||||
>
|
||||
<button
|
||||
onclick={() => updateLocale("en")}
|
||||
class={[
|
||||
"btn join-item !text-cat-text border-cat-surface0",
|
||||
isEnglish ? "bg-cat-mantle" : "bg-cat-base",
|
||||
]}>English
|
||||
</button
|
||||
>
|
||||
</div>
|
Reference in New Issue
Block a user