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 Footer from "$lib/components/layout/Footer.svelte";
import TopBar from "$lib/components/layout/TopBar.svelte"; import TopBar from "$lib/components/layout/TopBar.svelte";
import { initLocale } from "$lib/i18n/locale.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 { getTheme, initTheme, setTheme } from "$lib/theme.svelte";
import type { Snippet } from "svelte"; import type { Snippet } from "svelte";
import { onMount } from "svelte"; import { onMount } from "svelte";
@@ -27,19 +30,16 @@
let crumb = $derived(toCrumb(page.url.pathname)); 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 { function toCrumb(path: string): string {
return ( if (path === "/") return "/ " + t("header.home");
"/ " + if (path === "/list-tools") return "/ " + t("header.catalog");
(CRUMB[path] ?? if (path === "/kit") return "/ " + t("header.uiKit");
path.split("/").filter(Boolean).pop()?.toUpperCase() ?? const match = /^\/tools\/([^/]+)$/.exec(path);
"HOME") if (match) {
); const tool = getTool(match[1]);
if (tool) return "/ " + toolTitle(tool);
}
return "/ " + t("header.home");
} }
</script> </script>
+2 -3
View File
@@ -4,6 +4,7 @@
import CatalogHeader from "$lib/components/CatalogHeader.svelte"; import CatalogHeader from "$lib/components/CatalogHeader.svelte";
import CatalogToolbar from "$lib/components/CatalogToolbar.svelte"; import CatalogToolbar from "$lib/components/CatalogToolbar.svelte";
import ToolCard from "$lib/components/ToolCard.svelte"; import ToolCard from "$lib/components/ToolCard.svelte";
import { t } from "$lib/i18n/t";
import { TOOL_ICONS } from "$lib/tool-icons"; import { TOOL_ICONS } from "$lib/tool-icons";
let query = $state(""); let query = $state("");
@@ -44,9 +45,7 @@
</CatalogGroup> </CatalogGroup>
{/each} {/each}
</div> </div>
<footer class="catalog-footer"> <footer class="catalog-footer">{t("header.footerNote")}</footer>
ALL OPERATIONS RUN LOCALLY <span></span> YOUR FILES NEVER LEAVE THIS DEVICE
</footer>
</div> </div>
<style> <style>
+2 -3
View File
@@ -4,6 +4,7 @@
import CatalogHeader from "$lib/components/CatalogHeader.svelte"; import CatalogHeader from "$lib/components/CatalogHeader.svelte";
import CatalogToolbar from "$lib/components/CatalogToolbar.svelte"; import CatalogToolbar from "$lib/components/CatalogToolbar.svelte";
import ToolCard from "$lib/components/ToolCard.svelte"; import ToolCard from "$lib/components/ToolCard.svelte";
import { t } from "$lib/i18n/t";
import { TOOL_ICONS } from "$lib/tool-icons"; import { TOOL_ICONS } from "$lib/tool-icons";
let query = $state(""); let query = $state("");
@@ -42,9 +43,7 @@
</CatalogGroup> </CatalogGroup>
{/each} {/each}
</div> </div>
<footer class="catalog-footer"> <footer class="catalog-footer">{t("header.footerNote")}</footer>
ALL OPERATIONS RUN LOCALLY <span></span> YOUR FILES NEVER LEAVE THIS DEVICE
</footer>
</div> </div>
<style> <style>
+4 -3
View File
@@ -1,6 +1,7 @@
<script lang="ts"> <script lang="ts">
import EmptyState from "$lib/components/EmptyState.svelte"; import EmptyState from "$lib/components/EmptyState.svelte";
import SchemaToolView from "$lib/components/SchemaToolView.svelte"; import SchemaToolView from "$lib/components/SchemaToolView.svelte";
import { t } from "$lib/i18n/t";
import { getTool } from "$lib/registry"; import { getTool } from "$lib/registry";
import { SlidersHorizontal as ToolIcon } from "@lucide/svelte"; import { SlidersHorizontal as ToolIcon } from "@lucide/svelte";
@@ -13,15 +14,15 @@
</script> </script>
<svelte:head> <svelte:head>
<title>easy-png-tools / {tool?.title ?? "Tool"}</title> <title>easy-png-tools / {tool?.title ?? t("toolPage.fallbackTitle")}</title>
<meta name="robots" content="noindex, nofollow" /> <meta name="robots" content="noindex, nofollow" />
</svelte:head> </svelte:head>
{#if !tool} {#if !tool}
<div class="notfound"> <div class="notfound">
<EmptyState <EmptyState
title="Tool not found" title={t("errors.notFound")}
description="No tool is registered under “{data.id}”." description={t("errors.toolUnknown", { id: data.id })}
icon={ToolIcon} icon={ToolIcon}
/> />
</div> </div>