feat: move all common messages to i18n (ru\en)

This commit is contained in:
2026-08-25 05:45:34 +05:00
parent 8255d33098
commit 2301b0e165
22 changed files with 100 additions and 87 deletions
@@ -1,6 +1,7 @@
<script lang="ts">
import ParamForm from '../ParamForm.svelte';
import type { ParamDef } from '$lib/registry';
import { t } from '$lib/i18n/t';
interface Props {
params: ParamDef[];
@@ -32,9 +33,7 @@
bind:showMask
/>
{:else}
<p class="hint text-caption text-muted">
У этого инструмента нет параметров — результат уже готов.
</p>
<p class="hint text-caption text-muted">{t('paramsCard.noParams')}</p>
{/if}
</div>
@@ -8,6 +8,7 @@
import type { ImageInfo } from '$lib/core/analyze';
import type { PixelImage } from '$lib/core/types';
import { outputOf, type ToolEntry } from '$lib/registry';
import { t } from '$lib/i18n/t';
type Status = 'idle' | 'loaded' | 'processing' | 'error';
@@ -45,16 +46,13 @@
<div class="container">
{#if !sourceLoaded}
<div class="media">
<EmptyState
title="Результат появится здесь"
hint="Сначала загрузите исходное изображение слева"
/>
<EmptyState title={t('resultCard.emptyTitle')} hint={t('resultCard.emptyHint')} />
</div>
{:else if !isInfo && status === 'processing' && !result}
<div class="media">
<EmptyState
title="Обработка…"
hint="Изображение обрабатывается, это займёт немного времени"
title={t('resultCard.processingTitle')}
hint={t('resultCard.processingHint')}
/>
</div>
{:else if isInfo}
@@ -73,7 +71,7 @@
<div class="media">
<Preview image={displayImage} />
{#if status === 'processing'}
<span class="recalc" aria-live="polite">Пересчёт…</span>
<span class="recalc" aria-live="polite">{t('resultCard.recalc')}</span>
{/if}
</div>
<div class="actions-row">
@@ -86,7 +84,7 @@
/>
{#if onChainToggle}
<Button variant="secondary" fullWidth onclick={onChainToggle}>
{hasChain ? '✂ Оборвать цепочку' : '⛓ Следующий инструмент'}
{hasChain ? t('resultCard.breakChain') : t('resultCard.nextTool')}
</Button>
{/if}
</div>
@@ -1,5 +1,6 @@
<script lang="ts">
import type { PixelImage } from '$lib/core/types';
import { t } from '$lib/i18n/t';
import DropOverlay from '../DropOverlay.svelte';
import DropZone from '../DropZone.svelte';
import Preview from '../Preview.svelte';
@@ -25,7 +26,7 @@
<div class="media">
<Preview image={source} pipetteActive={pipetteActive} onPickColor={onPickColor} />
</div>
<Button variant="secondary" onclick={onReset}>Заменить изображение</Button>
<Button variant="secondary" onclick={onReset}>{t('sourceCard.replaceImage')}</Button>
</DropOverlay>
{/if}
</div>
@@ -1,5 +1,6 @@
<script lang="ts">
import Button from '../ui/Button.svelte';
import { t } from '$lib/i18n/t';
interface Props {
onSubmit: (text: string) => void;
@@ -16,16 +17,16 @@
</script>
<div class="container">
<h2 class="heading-section">Текст</h2>
<h2 class="heading-section">{t('textInput.heading')}</h2>
<textarea
class="input"
rows="8"
bind:value={text}
placeholder="Вставьте данные сюда"
aria-label="Текстовые данные"
placeholder={t('textInput.placeholder')}
aria-label={t('textInput.aria')}
></textarea>
<Button variant="secondary" onclick={submit} disabled={text.trim().length === 0}>
Декодировать
{t('textInput.decode')}
</Button>
</div>
@@ -1,5 +1,6 @@
<script lang="ts">
import { downloadBlob } from '$lib/core/io';
import { t } from '$lib/i18n/t';
interface Props {
text: string;
@@ -22,12 +23,12 @@
</script>
<div class="panel text-result">
<textarea class="output" rows="10" readonly value={text} aria-label="Текстовый результат"></textarea>
<textarea class="output" rows="10" readonly value={text} aria-label={t('textResult.outputAria')}></textarea>
<div class="actions">
<button type="button" class="secondary" onclick={copy}>
{copied ? 'Скопировано' : 'Копировать'}
{copied ? t('textResult.copied') : t('textResult.copy')}
</button>
<button type="button" class="primary" onclick={download}>Скачать .txt</button>
<button type="button" class="primary" onclick={download}>{t('textResult.downloadTxt')}</button>
</div>
</div>