[+] Set language button
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
export default {
|
export default {
|
||||||
home: {
|
home: {
|
||||||
titles: {
|
titles: {
|
||||||
continue: 'Continue from pause',
|
continue: 'Continue From Last Session',
|
||||||
history: 'History',
|
history: 'History',
|
||||||
myPlaylists: 'My Playlists',
|
myPlaylists: 'My Playlists',
|
||||||
recPlaylists: 'Recommended Playlists'
|
recPlaylists: 'Recommended Playlists'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
import Button from "$lib/ui/Button.svelte"
|
import Button from "$lib/ui/Button.svelte"
|
||||||
import { Layer } from "m3-svelte"
|
import { Layer } from "m3-svelte"
|
||||||
import { goto } from "$app/navigation"
|
import { goto } from "$app/navigation"
|
||||||
import { getI18n } from "$lib/i18n"
|
import { getI18n, setLanguage } from "$lib/i18n"
|
||||||
|
|
||||||
let { data }: PageProps = $props()
|
let { data }: PageProps = $props()
|
||||||
|
|
||||||
@@ -20,7 +20,11 @@
|
|||||||
|
|
||||||
|
|
||||||
<AppBar account={() => goto('/user')} right={[
|
<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">
|
<div class="vbox gap-16px overflow-y-auto flex-1">
|
||||||
|
|||||||
Reference in New Issue
Block a user