diff options
| author | Fuwn <[email protected]> | 2024-02-07 08:05:03 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-02-07 08:05:03 -0800 |
| commit | 2f24d972aff6d991be67612cc97305250f83c131 (patch) | |
| tree | ffd325889cda810af7569c0f78001c2df388357f | |
| parent | feat(api): health check endpoint (diff) | |
| download | due.moe-2f24d972aff6d991be67612cc97305250f83c131.tar.xz due.moe-2f24d972aff6d991be67612cc97305250f83c131.zip | |
feat(locale): localise hololive
| -rw-r--r-- | src/lib/Locale/english.ts | 9 | ||||
| -rw-r--r-- | src/lib/Locale/japanese.ts | 9 | ||||
| -rw-r--r-- | src/lib/Locale/layout.ts | 9 | ||||
| -rw-r--r-- | src/routes/hololive/+page.svelte | 18 |
4 files changed, 41 insertions, 4 deletions
diff --git a/src/lib/Locale/english.ts b/src/lib/Locale/english.ts index 5477632c..50d0f908 100644 --- a/src/lib/Locale/english.ts +++ b/src/lib/Locale/english.ts @@ -231,6 +231,15 @@ const English: Locale = { hint2: 'If you are having issues with data loading or logging out, it is recommended to clear your site data.' } + }, + hololive: { + live: 'LIVE', + upcoming: 'Upcoming', + with: 'With ', + comma: ', ', + commaNoSpace: ',', + ampersand: '& ', + ended: 'Ended' } }; diff --git a/src/lib/Locale/japanese.ts b/src/lib/Locale/japanese.ts index 09b7dc32..3e3fcc35 100644 --- a/src/lib/Locale/japanese.ts +++ b/src/lib/Locale/japanese.ts @@ -233,6 +233,15 @@ const Japanese: Locale = { hint2: 'データの読み込みやログアウトに問題がある場合、サイトデータをクリアすることをお勧めします。' } + }, + hololive: { + live: 'ライブ', + upcoming: '近日公開予定', + with: 'と', + comma: '、', + commaNoSpace: '、', + ampersand: '', + ended: '終了' } }; diff --git a/src/lib/Locale/layout.ts b/src/lib/Locale/layout.ts index e1c81e0f..9d2b84c9 100644 --- a/src/lib/Locale/layout.ts +++ b/src/lib/Locale/layout.ts @@ -233,4 +233,13 @@ export interface Locale { hint2: LocaleValue; }; }; + hololive: { + live: LocaleValue; + upcoming: LocaleValue; + with: LocaleValue; + comma: LocaleValue; + commaNoSpace: LocaleValue; + ampersand: LocaleValue; + ended: LocaleValue; + }; } diff --git a/src/routes/hololive/+page.svelte b/src/routes/hololive/+page.svelte index 0ed25b57..25c1d058 100644 --- a/src/routes/hololive/+page.svelte +++ b/src/routes/hololive/+page.svelte @@ -5,6 +5,7 @@ import HeadTitle from '$lib/Home/HeadTitle.svelte'; import { parseScheduleHtml } from '$lib/hololive'; import proxy from '$lib/Utility/proxy'; + import locale from '$stores/locale'; interface ParseResult { lives: { @@ -78,15 +79,24 @@ <div class="stream card"> <p> [{#if live.streaming} - <b class="live">LIVE</b>{:else if new Date(live.time).getTime() < Date.now()} - <span class="ended">Ended</span>{:else} - <span class="upcoming">Upcoming</span>{/if}] + <b class="live">{$locale().hololive.live}</b + >{:else if new Date(live.time).getTime() < Date.now()} + <span class="ended">{$locale().hololive.ended}</span>{:else} + <span class="upcoming">{$locale().hololive.upcoming}</span>{/if}] <b>{live.streamer}</b> <span class="opaque">|</span> {new Date(live.time).toLocaleString()} {#if live.guests.length > 0} <br /> <small> - With {live.guests.join(', ').replace(/, ([^,]+)$/, ', & $1')} + {$locale().hololive.with}{live.guests + .join($locale().hololive.comma) + .replace( + new RegExp( + `${$locale().hololive.comma}([^${$locale().hololive.commaNoSpace}]+)$`, + 'g' + ), + `${$locale().hololive.comma}${$locale().hololive.ampersand}$1` + )} </small> {/if} </p> |