From e06970997e5a402139d2f2b9c78cab8310cad293 Mon Sep 17 00:00:00 2001 From: Ku6epXBOCTuK Date: Sun, 13 Sep 2026 05:36:38 +0500 Subject: [PATCH] fix: update i18n text in pages and layout --- web/src/routes/+layout.svelte | 24 ++++++++++++------------ web/src/routes/+page.svelte | 5 ++--- web/src/routes/list-tools/+page.svelte | 5 ++--- web/src/routes/tools/[id]/+page.svelte | 7 ++++--- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/web/src/routes/+layout.svelte b/web/src/routes/+layout.svelte index f0a3709..07b0174 100644 --- a/web/src/routes/+layout.svelte +++ b/web/src/routes/+layout.svelte @@ -3,6 +3,9 @@ import Footer from "$lib/components/layout/Footer.svelte"; import TopBar from "$lib/components/layout/TopBar.svelte"; import { initLocale } from "$lib/i18n/locale.svelte"; + import { toolTitle } from "$lib/i18n/schema-tool-strings"; + import { t } from "$lib/i18n/t"; + import { getTool } from "$lib/registry"; import { getTheme, initTheme, setTheme } from "$lib/theme.svelte"; import type { Snippet } from "svelte"; import { onMount } from "svelte"; @@ -27,19 +30,16 @@ let crumb = $derived(toCrumb(page.url.pathname)); - const CRUMB: Record = { - "/list-tools": "CATALOG", - "/tools/linear-gradient-png": "GRADIENT", - "/tools/remove-background-png": "BACKGROUND REMOVER", - }; - function toCrumb(path: string): string { - return ( - "/ " + - (CRUMB[path] ?? - path.split("/").filter(Boolean).pop()?.toUpperCase() ?? - "HOME") - ); + if (path === "/") return "/ " + t("header.home"); + if (path === "/list-tools") return "/ " + t("header.catalog"); + if (path === "/kit") return "/ " + t("header.uiKit"); + const match = /^\/tools\/([^/]+)$/.exec(path); + if (match) { + const tool = getTool(match[1]); + if (tool) return "/ " + toolTitle(tool); + } + return "/ " + t("header.home"); } diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index 14b294b..c0cd848 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -4,6 +4,7 @@ import CatalogHeader from "$lib/components/CatalogHeader.svelte"; import CatalogToolbar from "$lib/components/CatalogToolbar.svelte"; import ToolCard from "$lib/components/ToolCard.svelte"; + import { t } from "$lib/i18n/t"; import { TOOL_ICONS } from "$lib/tool-icons"; let query = $state(""); @@ -44,9 +45,7 @@ {/each} -
- ALL OPERATIONS RUN LOCALLY YOUR FILES NEVER LEAVE THIS DEVICE -
+
{t("header.footerNote")}