From 199032c0621742610547bb81f5af16009f79fd76 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sun, 23 Nov 2025 00:46:59 +0800 Subject: [PATCH] [+] Set language button --- src/lib/i18n/en.ts | 2 +- src/routes/+page.svelte | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/i18n/en.ts b/src/lib/i18n/en.ts index 46380ac..048ca18 100644 --- a/src/lib/i18n/en.ts +++ b/src/lib/i18n/en.ts @@ -1,7 +1,7 @@ export default { home: { titles: { - continue: 'Continue from pause', + continue: 'Continue From Last Session', history: 'History', myPlaylists: 'My Playlists', recPlaylists: 'Recommended Playlists' diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 2e47312..c5df11d 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -6,7 +6,7 @@ import Button from "$lib/ui/Button.svelte" import { Layer } from "m3-svelte" import { goto } from "$app/navigation" - import { getI18n } from "$lib/i18n" + import { getI18n, setLanguage } from "$lib/i18n" let { data }: PageProps = $props() @@ -20,7 +20,11 @@ goto('/user')} right={[ - {icon: "i-material-symbols:settings-rounded", onclick: () => alert('Settings clicked')} + // {icon: "i-material-symbols:settings-rounded", onclick: () => alert('Settings clicked')} + // Language switching button + {icon: "i-material-symbols:translate-rounded", onclick: () => { + setLanguage(data.lang === 'en' ? 'zh' : 'en') + }} ]} />