fix: update i18n text in pages and layout

This commit is contained in:
2026-09-13 05:36:38 +05:00
parent 1097186487
commit e06970997e
4 changed files with 20 additions and 21 deletions
+12 -12
View File
@@ -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<string, string> = {
"/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");
}
</script>