From 2f24d972aff6d991be67612cc97305250f83c131 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
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/hololive/+page.svelte')

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>
-- 
cgit v1.2.3

