diff --git a/web/src/lib/components/DownloadButton.svelte b/web/src/lib/components/DownloadButton.svelte index c452846..62836f9 100644 --- a/web/src/lib/components/DownloadButton.svelte +++ b/web/src/lib/components/DownloadButton.svelte @@ -3,6 +3,7 @@ import { downloadBlob, encode } from '$lib/core/io'; import type { PixelImage } from '$lib/core/types'; import type { OutputFormat } from '$lib/registry'; + import { t } from '$lib/i18n/t'; interface Props { image: PixelImage | null; @@ -38,8 +39,8 @@ fullWidth disabled={!image || !format} {busy} - busyText="Готовим файл…" + busyText={t('download.busy')} onclick={download} > - Скачать .{format?.ext ?? 'png'} + {t('download.file', { ext: format?.ext ?? 'png' })} diff --git a/web/src/lib/components/DropOverlay.svelte b/web/src/lib/components/DropOverlay.svelte index c146ec5..339e162 100644 --- a/web/src/lib/components/DropOverlay.svelte +++ b/web/src/lib/components/DropOverlay.svelte @@ -1,6 +1,7 @@
-

Текст

+

{t('textInput.heading')}

diff --git a/web/src/lib/components/tool/TextResult.svelte b/web/src/lib/components/tool/TextResult.svelte index 43693f5..ed96786 100644 --- a/web/src/lib/components/tool/TextResult.svelte +++ b/web/src/lib/components/tool/TextResult.svelte @@ -1,5 +1,6 @@
- +
- +
diff --git a/web/src/lib/components/ui/ColorField.svelte b/web/src/lib/components/ui/ColorField.svelte index 45eaf7f..39057d4 100644 --- a/web/src/lib/components/ui/ColorField.svelte +++ b/web/src/lib/components/ui/ColorField.svelte @@ -1,5 +1,6 @@ - Все инструменты — easy-png-tools - + {t('catalog.pageTitle')} + -

Каталог инструментов

-

- {TOOLS.length} утилит для работы с PNG. Все операции выполняются локально в браузере. -

+

{t('catalog.heading')}

+

{t('catalog.lead', { count: TOOLS.length })}

{#each CATEGORIES as category (category.id)} {@const categoryTools = TOOLS.filter((tool) => tool.category === category.id)} {#if categoryTools.length > 0}
-

{category.label}

+

{t(`categories.${category.id}`)}

{#each categoryTools as tool (tool.id)}
diff --git a/web/src/routes/tools/[id]/+page.svelte b/web/src/routes/tools/[id]/+page.svelte index 0e98a5b..82abbd6 100644 --- a/web/src/routes/tools/[id]/+page.svelte +++ b/web/src/routes/tools/[id]/+page.svelte @@ -1,6 +1,7 @@ - {tool?.title ?? 'Инструмент'} — easy-png-tools + {tool?.title ?? t('toolPage.fallbackTitle')} — easy-png-tools {#if tool} {/if} diff --git a/web/src/routes/tools/[id]/+page.ts b/web/src/routes/tools/[id]/+page.ts index a2a0ac9..3c8ce97 100644 --- a/web/src/routes/tools/[id]/+page.ts +++ b/web/src/routes/tools/[id]/+page.ts @@ -1,5 +1,6 @@ import { error } from '@sveltejs/kit'; import { getTool, TOOLS } from '$lib/registry'; +import { t } from '$lib/i18n/t'; import type { EntryGenerator, PageLoad } from './$types'; export const entries: EntryGenerator = () => TOOLS.map((tool) => ({ id: tool.id })); @@ -7,7 +8,7 @@ export const entries: EntryGenerator = () => TOOLS.map((tool) => ({ id: tool.id export const load: PageLoad = ({ params }) => { const tool = getTool(params.id); if (!tool) { - error(404, 'Инструмент не найден'); + error(404, t('errors.notFound')); } return { id: tool.id }; };