From 2f24d972aff6d991be67612cc97305250f83c131 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 7 Feb 2024 08:05:03 -0800 Subject: feat(locale): localise hololive --- src/routes/hololive/+page.svelte | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/routes') 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 @@

[{#if live.streaming} - LIVE{:else if new Date(live.time).getTime() < Date.now()} - Ended{:else} - Upcoming{/if}] + {$locale().hololive.live}{:else if new Date(live.time).getTime() < Date.now()} + {$locale().hololive.ended}{:else} + {$locale().hololive.upcoming}{/if}] {live.streamer} | {new Date(live.time).toLocaleString()} {#if live.guests.length > 0}
- 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` + )} {/if}

-- cgit v1.2.3