[O] More i18n
This commit is contained in:
+27
-1
@@ -134,5 +134,31 @@ export default {
|
|||||||
title: 'Oops!',
|
title: 'Oops!',
|
||||||
message: 'The page you’re looking for doesn’t exist. It might have been removed, renamed, or never existed.\n\n </br></br> Go back to the <a class="error-page__link" href="/">homepage</a> to continue browsing',
|
message: 'The page you’re looking for doesn’t exist. It might have been removed, renamed, or never existed.\n\n </br></br> Go back to the <a class="error-page__link" href="/">homepage</a> to continue browsing',
|
||||||
return: 'Return home',
|
return: 'Return home',
|
||||||
}
|
},
|
||||||
|
player: {
|
||||||
|
menu: {
|
||||||
|
showFuri: 'Show Furigana',
|
||||||
|
hideFuri: 'Hide Furigana',
|
||||||
|
revertHiragana: 'Revert to Hiragana',
|
||||||
|
convertToKatakana: 'Convert all to Katakana',
|
||||||
|
showRomaji: 'Show Romaji',
|
||||||
|
hideRomaji: 'Hide Romaji',
|
||||||
|
showRomajiOnError: 'Show Romaji on Error',
|
||||||
|
hideRomajiOnError: 'Don\'t Show Romaji on Error',
|
||||||
|
musicModeUnavailable: 'Not available in music mode',
|
||||||
|
showRepeated: 'Show Repeated Lines',
|
||||||
|
hideRepeated: 'Hide Repeated Lines',
|
||||||
|
shuffle: 'Current: Shuffle',
|
||||||
|
sequential: 'Current: Sequential',
|
||||||
|
nextSong: 'Next Song'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dialog: {
|
||||||
|
close: 'Close',
|
||||||
|
error: {
|
||||||
|
title: 'Error',
|
||||||
|
refresh: 'Refresh to Retry'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {}
|
||||||
}
|
}
|
||||||
+27
-1
@@ -134,5 +134,31 @@ export default {
|
|||||||
title: 'おっと!',
|
title: 'おっと!',
|
||||||
message: 'お探しのページは見つかりませんでした。削除されたか、名前が変更されたか、あるいは最初から存在しなかった可能性があります。\n\n </br></br> <a class="error-page__link" href="/">トップページ</a> に戻って閲覧を続けてください',
|
message: 'お探しのページは見つかりませんでした。削除されたか、名前が変更されたか、あるいは最初から存在しなかった可能性があります。\n\n </br></br> <a class="error-page__link" href="/">トップページ</a> に戻って閲覧を続けてください',
|
||||||
return: 'トップページに戻る',
|
return: 'トップページに戻る',
|
||||||
}
|
},
|
||||||
|
player: {
|
||||||
|
menu: {
|
||||||
|
showFuri: 'ふりがなを表示',
|
||||||
|
hideFuri: 'ふりがなを隠す',
|
||||||
|
revertHiragana: 'ひらがなに戻す',
|
||||||
|
convertToKatakana: 'すべてカタカナに変換',
|
||||||
|
showRomaji: 'ローマ字を表示',
|
||||||
|
hideRomaji: 'ローマ字を隠す',
|
||||||
|
showRomajiOnError: 'エラー時にローマ字を表示',
|
||||||
|
hideRomajiOnError: 'エラー時にローマ字を表示しない',
|
||||||
|
musicModeUnavailable: '音楽モードでは利用できません',
|
||||||
|
showRepeated: '重複行を表示',
|
||||||
|
hideRepeated: '重複行を隠す',
|
||||||
|
shuffle: '現在:シャッフル再生',
|
||||||
|
sequential: '現在:順次再生',
|
||||||
|
nextSong: '次の曲'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dialog: {
|
||||||
|
close: '閉じる',
|
||||||
|
error: {
|
||||||
|
title: 'エラー',
|
||||||
|
refresh: '更新して再試行'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,5 +134,33 @@ export default {
|
|||||||
title: '页面不存在',
|
title: '页面不存在',
|
||||||
message: '很抱歉,您访问的页面不存在。可能已被删除、更名,或链接输入错误。\n\n </br></br> 返回 <a class="error-page__link" href="/">首页</a> 继续浏览',
|
message: '很抱歉,您访问的页面不存在。可能已被删除、更名,或链接输入错误。\n\n </br></br> 返回 <a class="error-page__link" href="/">首页</a> 继续浏览',
|
||||||
return: '返回首页',
|
return: '返回首页',
|
||||||
|
},
|
||||||
|
player: {
|
||||||
|
menu: {
|
||||||
|
showFuri: '显示假名标注',
|
||||||
|
hideFuri: '隐藏假名标注',
|
||||||
|
revertHiragana: '恢复平假名',
|
||||||
|
convertToKatakana: '全部转换为片假名',
|
||||||
|
showRomaji: '显示罗马音',
|
||||||
|
hideRomaji: '隐藏罗马音',
|
||||||
|
showRomajiOnError: '错误时显示罗马音',
|
||||||
|
hideRomajiOnError: '不在错误时显示罗马音',
|
||||||
|
musicModeUnavailable: '音乐模式下不可用',
|
||||||
|
showRepeated: '显示重复行',
|
||||||
|
hideRepeated: '隐藏重复行',
|
||||||
|
shuffle: '当前:随机播放',
|
||||||
|
sequential: '当前:顺序播放',
|
||||||
|
nextSong: '下首'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dialog: {
|
||||||
|
close: '关闭',
|
||||||
|
error: {
|
||||||
|
title: '错误',
|
||||||
|
refresh: '刷新重试'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,8 @@
|
|||||||
import { API } from "$lib/client"
|
import { API } from "$lib/client"
|
||||||
import { getNextSong, getNextLoc } from "./SongSwitching"
|
import { getNextSong, getNextLoc } from "./SongSwitching"
|
||||||
|
|
||||||
|
import { getI18n } from "$lib/i18n"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
song: NeteaseSong
|
song: NeteaseSong
|
||||||
settings: TypingSettings
|
settings: TypingSettings
|
||||||
@@ -27,6 +29,8 @@
|
|||||||
isKaraoke = false
|
isKaraoke = false
|
||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
|
|
||||||
|
const t = getI18n().player.menu
|
||||||
|
|
||||||
let isHideRepeated = $derived(settings.hideRepeated && !disableHideRepeated)
|
let isHideRepeated = $derived(settings.hideRepeated && !disableHideRepeated)
|
||||||
|
|
||||||
const nextSongId = $derived(getNextSong(playlist, loc))
|
const nextSongId = $derived(getNextSong(playlist, loc))
|
||||||
@@ -48,27 +52,27 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AppBar title={song.name} sub={artistAndAlbum(song)}>
|
<AppBar title={song.name} sub={artistAndAlbum(song)}>
|
||||||
<MenuItem textIcon="あ" onclick={() => settings.isFuri = !settings.isFuri}>{settings.isFuri ? "隐藏" : "显示"}假名标注</MenuItem>
|
<MenuItem textIcon="あ" onclick={() => settings.isFuri = !settings.isFuri}>{settings.isFuri ? t.hideFuri : t.showFuri}</MenuItem>
|
||||||
<MenuItem textIcon="カ" onclick={() => settings.allKata = !settings.allKata}>{settings.allKata ? "恢复平假名" : "全部转换为片假名"}</MenuItem>
|
<MenuItem textIcon="カ" onclick={() => settings.allKata = !settings.allKata}>{settings.allKata ? t.revertHiragana : t.convertToKatakana}</MenuItem>
|
||||||
<MenuItem icon="i-material-symbols:language-japanese-kana-rounded" onclick={() => settings.showRomaji = !settings.showRomaji}>{settings.showRomaji ? "隐藏罗马音" : "显示罗马音"}</MenuItem>
|
<MenuItem icon="i-material-symbols:language-japanese-kana-rounded" onclick={() => settings.showRomaji = !settings.showRomaji}>{settings.showRomaji ? t.hideRomaji : t.showRomaji}</MenuItem>
|
||||||
|
|
||||||
{#if showRomajiOnError}
|
{#if showRomajiOnError}
|
||||||
<MenuItem icon="i-material-symbols:error-circle-rounded" onclick={() => settings.showRomajiOnError = !settings.showRomajiOnError}>{settings.showRomajiOnError ? "不在错误时显示罗马音" : "错误时显示罗马音"}</MenuItem>
|
<MenuItem icon="i-material-symbols:error-circle-rounded" onclick={() => settings.showRomajiOnError = !settings.showRomajiOnError}>{settings.showRomajiOnError ? t.hideRomajiOnError : t.showRomajiOnError}</MenuItem>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<MenuItem icon="i-material-symbols:compress-rounded"
|
<MenuItem icon="i-material-symbols:compress-rounded"
|
||||||
disabled={disableHideRepeated}
|
disabled={disableHideRepeated}
|
||||||
sub={disableHideRepeated ? "音乐模式下不可用" : ""}
|
sub={disableHideRepeated ? t.musicModeUnavailable : ""}
|
||||||
onclick={() => settings.hideRepeated = !settings.hideRepeated}>{isHideRepeated ? "显示重复行" : "隐藏重复行"}</MenuItem>
|
onclick={() => settings.hideRepeated = !settings.hideRepeated}>{isHideRepeated ? t.showRepeated : t.hideRepeated}</MenuItem>
|
||||||
|
|
||||||
{#if loc}
|
{#if loc}
|
||||||
<MenuItem icon={loc.playMode === 'random' ? "i-material-symbols:shuffle-rounded" : "i-material-symbols:repeat-rounded"}
|
<MenuItem icon={loc.playMode === 'random' ? "i-material-symbols:shuffle-rounded" : "i-material-symbols:repeat-rounded"}
|
||||||
onclick={() => loc!.playMode = loc!.playMode === 'random' ? 'sequential' : 'random'}>
|
onclick={() => loc!.playMode = loc!.playMode === 'random' ? 'sequential' : 'random'}>
|
||||||
{loc.playMode === 'random' ? "当前:随机播放" : "当前:顺序播放"}
|
{loc.playMode === 'random' ? t.shuffle : t.sequential}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|
||||||
{#if nextSongId}
|
{#if nextSongId}
|
||||||
<MenuItem icon="i-material-symbols:skip-next-rounded" onclick={handleNext}>下首</MenuItem>
|
<MenuItem icon="i-material-symbols:skip-next-rounded" onclick={handleNext}>{t.nextSong}</MenuItem>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
</AppBar>
|
</AppBar>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Layer } from "m3-svelte"
|
import { Layer } from "m3-svelte"
|
||||||
import { fade } from "svelte/transition"
|
import { fade } from "svelte/transition"
|
||||||
|
import { getI18n } from "$lib/i18n"
|
||||||
|
|
||||||
let { open = $bindable(), ...p }: {
|
let { open = $bindable(), ...p }: {
|
||||||
title: string,
|
title: string,
|
||||||
@@ -13,8 +14,10 @@
|
|||||||
noClose?: boolean
|
noClose?: boolean
|
||||||
} = $props()
|
} = $props()
|
||||||
|
|
||||||
|
const t = getI18n().dialog
|
||||||
|
|
||||||
let buttons = $derived([...(p.buttons ?? []), ...(p.noClose ? [] : [{
|
let buttons = $derived([...(p.buttons ?? []), ...(p.noClose ? [] : [{
|
||||||
text: '关闭', onclick: () => open = false
|
text: t.close, onclick: () => open = false
|
||||||
}])])
|
}])])
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Dialog from "./Dialog.svelte";
|
import Dialog from "./Dialog.svelte";
|
||||||
|
import { getI18n } from "$lib/i18n"
|
||||||
|
|
||||||
let p: {
|
let p: {
|
||||||
error?: string
|
error?: string
|
||||||
} = $props()
|
} = $props()
|
||||||
|
|
||||||
|
const t = getI18n().dialog.error
|
||||||
|
|
||||||
let open = $derived(!!p.error)
|
let open = $derived(!!p.error)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Dialog title="错误" bind:open buttons={[{
|
<Dialog title={t.title} bind:open buttons={[{
|
||||||
text: "刷新重试",
|
text: t.refresh,
|
||||||
onclick: () => location.reload()
|
onclick: () => location.reload()
|
||||||
}]} noClose>
|
}]} noClose>
|
||||||
<div class="text-red-500">
|
<div class="text-red-500">
|
||||||
|
|||||||
Reference in New Issue
Block a user