From 4a2e83f9376238dcf8a9dd8d4839515e8c075802 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 21 Jan 2024 02:08:07 -0800
Subject: refactor(settings): use typed localiser

---
 src/routes/settings/+page.svelte | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

(limited to 'src/routes/settings/+page.svelte')

diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte
index c878f364..180b3554 100644
--- a/src/routes/settings/+page.svelte
+++ b/src/routes/settings/+page.svelte
@@ -13,7 +13,7 @@
 	import { getNotificationsContext } from 'svelte-notifications';
 	import { options } from '$lib/Notification/options.js';
 	import tooltip from '$lib/Tooltip/tooltip';
-	import { _ } from 'svelte-i18n';
+	import locale from '$stores/locale.js';
 
 	export let data;
 
@@ -36,7 +36,7 @@
 	<a
 		href="https://anilist.co/user/fuwn"
 		target="_blank"
-		title={$_('settings.tooltips.author')}
+		title={$locale().settings.tooltips.author}
 		use:tooltip>@fuwn</a
 	> on AniList!
 </blockquote>
@@ -44,7 +44,7 @@
 {#if data.user === undefined}
 	<div class="card">Please log in to modify settings.</div>
 {:else}
-	<Category title={$_('settings.rss_feeds.title')} id="feeds">
+	<Category title={$locale().settings.rss_feeds.title} id="feeds">
 		<button
 			on:click={() => {
 				addNotification(
@@ -61,14 +61,14 @@
 				);
 			}}
 		>
-			{$_('settings.rss_feeds.buttons.copy_to_clipboard')}
+			{$locale().settings.rss_feeds.buttons.copy_to_clipboard}
 		</button>
 		Your AniList notifications RSS feed URL
 		<SettingHint lineBreak>
 			This <a
 				href="https://en.wikipedia.org/wiki/RSS"
 				target="_blank"
-				title={$_('settings.rss_feeds.tooltips.rss')}
+				title={$locale().settings.rss_feeds.tooltips.rss}
 				use:tooltip
 				data-tooltip-above>RSS</a
 			>
@@ -77,19 +77,19 @@
 			Do not share this link with <b>anyone</b>!
 		</SettingHint>
 	</Category>
-	<Category title={$_('settings.display.title')}><Display /></Category>
-	<Category title={$_('settings.calculation.title')}><Calculation /></Category>
-	<Category title={$_('settings.cache.title')}><Cache /></Category>
+	<Category title={$locale().settings.display.title}><Display /></Category>
+	<Category title={$locale().settings.calculation.title}><Calculation /></Category>
+	<Category title={$locale().settings.cache.title}><Cache /></Category>
 	<Category id="debug">
 		<summary
-			>{$_('settings.debug.title')}<button
+			>{$locale().settings.debug.title}<button
 				class="smaller-button button-badge badge-info"
-				title={$_('settings.debug.tooltips.version')}
+				title={$locale().settings.debug.tooltips.version}
 				use:tooltip>{data.commit.slice(0, 7)}</button
 			></summary
 		>
 
 		<Debug />
 	</Category>
-	<Category title={$_('settings.attributions.title')} open={false}><Attributions /></Category>
+	<Category title={$locale().settings.attributions.title} open={false}><Attributions /></Category>
 {/if}
-- 
cgit v1.2.3

