mirror of https://github.com/hykilpikonna/AquaDX
[+] i18n for status messages
parent
e1cdb3ab65
commit
f1461f905d
|
@ -5,6 +5,7 @@
|
||||||
import type { ConfirmProps } from "../libs/generalTypes";
|
import type { ConfirmProps } from "../libs/generalTypes";
|
||||||
import { DISCORD_INVITE } from "../libs/config";
|
import { DISCORD_INVITE } from "../libs/config";
|
||||||
import Icon from "@iconify/svelte";
|
import Icon from "@iconify/svelte";
|
||||||
|
import { t } from "../libs/i18n"
|
||||||
|
|
||||||
// Props
|
// Props
|
||||||
export let confirm: ConfirmProps | null = null
|
export let confirm: ConfirmProps | null = null
|
||||||
|
@ -26,9 +27,9 @@
|
||||||
|
|
||||||
// Set to null
|
// Set to null
|
||||||
confirm = null
|
confirm = null
|
||||||
}}>Cancel</button>
|
}}>{t('action.cancel')}</button>
|
||||||
{/if}
|
{/if}
|
||||||
<button on:click={() => confirm && confirm.confirm()} class:error={confirm.dangerous}>Confirm</button>
|
<button on:click={() => confirm && confirm.confirm()} class:error={confirm.dangerous}>{t('action.confirm')}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -37,16 +38,13 @@
|
||||||
{#if error}
|
{#if error}
|
||||||
<div class="overlay" transition:fade>
|
<div class="overlay" transition:fade>
|
||||||
<div>
|
<div>
|
||||||
<h2 class="error">Error</h2>
|
<h2 class="error">{t('status.error')}</h2>
|
||||||
<span>Something went wrong, please try again later or <a href={DISCORD_INVITE}>join our discord for support.</a></span>
|
<span>{t('status.error.hint')}<a href={DISCORD_INVITE}>{t('status.error.hint.link')}</a></span>
|
||||||
<span>Detail: {error}</span>
|
<span>{t('status.detail', { detail: error })}</span>
|
||||||
<!-- <div class="actions">-->
|
|
||||||
<!-- <button on:click={() => error = null}>Close</button>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<button on:click={() => location.reload()} class="error">
|
<button on:click={() => location.reload()} class="error">
|
||||||
Refresh
|
{t('action.refresh')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -59,6 +59,13 @@ export const EN_REF_GENERAL = {
|
||||||
'game.mai2': "Mai",
|
'game.mai2': "Mai",
|
||||||
'game.chu3': "Chuni",
|
'game.chu3': "Chuni",
|
||||||
'game.ongeki': "Ongeki",
|
'game.ongeki': "Ongeki",
|
||||||
|
'status.error': "Error",
|
||||||
|
'status.error.hint': 'Something went wrong, please try again later or ',
|
||||||
|
'status.error.hint.link': 'join our discord for support.',
|
||||||
|
'status.detail': 'Detail: ${detail}',
|
||||||
|
'action.refresh': 'Refresh',
|
||||||
|
'action.cancel': 'Cancel',
|
||||||
|
'action.confirm': 'Confirm',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EN_REF = { ...EN_REF_USER, ...EN_REF_Welcome, ...EN_REF_GENERAL, ...EN_REF_LEADERBOARD }
|
export const EN_REF = { ...EN_REF_USER, ...EN_REF_Welcome, ...EN_REF_GENERAL, ...EN_REF_LEADERBOARD }
|
||||||
|
|
|
@ -61,6 +61,13 @@ const zhGeneral: typeof EN_REF_GENERAL = {
|
||||||
'game.mai2': "舞萌",
|
'game.mai2': "舞萌",
|
||||||
'game.chu3': "中二",
|
'game.chu3': "中二",
|
||||||
'game.ongeki': "音击",
|
'game.ongeki': "音击",
|
||||||
|
"status.error": "发生错误",
|
||||||
|
"status.error.hint": "出了一些问题,请稍后刷新重试或者",
|
||||||
|
"status.error.hint.link": "加我们的 Discord 群问一问",
|
||||||
|
"status.detail": "详细信息:${detail}",
|
||||||
|
"action.refresh": "刷新",
|
||||||
|
"action.cancel": "取消",
|
||||||
|
"action.confirm": "确认",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ZH = { ...zhUser, ...zhWelcome, ...zhGeneral, ...zhLeaderboard }
|
export const ZH = { ...zhUser, ...zhWelcome, ...zhGeneral, ...zhLeaderboard }
|
||||||
|
|
Loading…
Reference in New Issue