From 56a7a7851b09cb30a5cd543c8cb4f926109b4290 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.net>
Date: Sun, 24 May 2026 13:22:34 +0000
Subject: refactor(locale): move hardcoded UI strings into english locale

Adds optional namespaces (common, errors, commandPalette, headTitle,
notifications, schedule, events, home, reader, routes, badgePreview,
badgeWall) and extends existing ones (settings.*, lists.*, tools.*,
user.*, hololive.*) on the Locale interface. New fields are optional
so japanese.ts can omit them; svelte-i18n's fallbackLocale handles
the runtime miss.

HeadTitle gains an optional routeKey prop for type-safe lookup.
defaultActions becomes a factory so the command palette re-reads
locale on language toggle. The existing JP feedback translation
in routes/settings is preserved via japanese.ts.

Out of scope (kept hardcoded): service-worker.ts, app.html,
Landing*.svelte, tools.ts registry, Easter Event 2025 pages.
---
 src/lib/List/Manga/CleanMangaList.svelte | 36 +++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 15 deletions(-)

(limited to 'src/lib/List/Manga/CleanMangaList.svelte')

diff --git a/src/lib/List/Manga/CleanMangaList.svelte b/src/lib/List/Manga/CleanMangaList.svelte
index a52a9d7e..25e6d48f 100644
--- a/src/lib/List/Manga/CleanMangaList.svelte
+++ b/src/lib/List/Manga/CleanMangaList.svelte
@@ -145,7 +145,7 @@ const increment = (manga: Media) => {
     {#if !dummy}
       <button
         class="small-button"
-        title="Force a full refresh"
+        title={$locale().lists.actions?.forceFullRefresh}
         onclick={cleanCache}
         data-umami-event="Force Refresh Manga">Refresh</button
       >
@@ -153,7 +153,7 @@ const increment = (manga: Media) => {
         <button
           class="small-button"
           onclick={() => (showRoulette = true)}
-          title="Pick a random manga to read"
+          title={$locale().lists.actions?.pickRandomManga}
         >
           Roulette
         </button>
@@ -168,11 +168,13 @@ const increment = (manga: Media) => {
   {:then status}
     {#if status}
       {#if status.status === 503}
-        <a href="https://due.moe">due.moe</a>'s manga data source is currently down for maintenance.
-        Please check back later.
+        {$locale().lists.errors?.mangaDataDown?.split("due.moe's")[0]}<a href="https://due.moe"
+          >due.moe</a
+        >{$locale().lists.errors?.mangaDataDown?.split("due.moe")[1]}
       {:else if status.status !== 200}
-        <a href="https://due.moe">due.moe</a>'s manga data source is currently unavailable. Please
-        check back later.
+        {$locale().lists.errors?.mangaDataUnavailable?.split("due.moe's")[0]}<a
+          href="https://due.moe">due.moe</a
+        >{$locale().lists.errors?.mangaDataUnavailable?.split("due.moe")[1]}
       {:else}
         <RateLimitedError />
       {/if}
@@ -180,8 +182,9 @@ const increment = (manga: Media) => {
       <Skeleton card={false} count={1} height="0.9rem" list />
     {/if}
   {:catch}
-    <a href="https://due.moe">due.moe</a>'s manga data source is currently unreachable. Please check
-    back later.
+    {$locale().lists.errors?.mangaDataUnreachable?.split("due.moe's")[0]}<a href="https://due.moe"
+      >due.moe</a
+    >{$locale().lists.errors?.mangaDataUnreachable?.split("due.moe")[1]}
   {/await}
 {/if}
 
@@ -191,21 +194,24 @@ const increment = (manga: Media) => {
   {/if}
 
   <p>
-    No manga to display. <button onclick={cleanCache} data-umami-event="Force Refresh No Manga"
-      >Force refresh</button
+    {$locale().lists.empty?.manga}
+    <button onclick={cleanCache} data-umami-event="Force Refresh No Manga"
+      >{$locale().lists.actions?.forceRefresh}</button
     >
   </p>
 
   <span>
-    Don't read manga? <button
-      onclick={() => ($settings.disableManga = true)}
-      data-umami-event="Disable No Manga">Hide the manga panel</button
+    {$locale().lists.dontReadMangaPrefix}
+    <button onclick={() => ($settings.disableManga = true)} data-umami-event="Disable No Manga"
+      >{$locale().lists.hideMangaPanel}</button
     >
-    You can re-enable it later in the <a href={root('/settings')}>Settings</a>.
+    {$locale().lists.reenableInSettings?.split('Settings')[0]}<a href={root('/settings')}
+      >{$locale().navigation.settings}</a
+    >.
   </span>
 {:else if $settings.displayMediaListFilter && !disableFilter && hasDistinguishingList}
   <select value={selectedList} onchange={updateSelectedList}>
-    <option value="All">All</option>
+    <option value="All">{$locale().lists.actions?.all}</option>
 
     {#each lists as list}
       <option value={list}>{list}</option>
-- 
cgit v1.2.3

