[+] Set language button

This commit is contained in:
2025-11-23 00:46:59 +08:00
parent 82f2858cde
commit 199032c062
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -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'
+6 -2
View File
@@ -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 @@
<AppBar account={() => 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')
}}
]} />
<div class="vbox gap-16px overflow-y-auto flex-1">