From 4de42b1e402a17f43992b132d8d3d97b869fc0d9 Mon Sep 17 00:00:00 2001 From: Ku6epXBOCTuK Date: Sun, 13 Sep 2026 06:47:14 +0500 Subject: [PATCH] fix: update i18n - tool group descriptions --- web/src/lib/catalog.ts | 15 ------ web/src/lib/components/CatalogGroup.svelte | 1 + web/src/lib/i18n/en.ts | 29 +++++++++- web/src/lib/i18n/ru.ts | 29 +++++++++- web/src/lib/registry/alpha.ts | 20 +++---- web/src/lib/registry/color.ts | 2 +- web/src/lib/registry/filters.ts | 8 +-- web/src/lib/registry/generate.ts | 62 +++++++++++++--------- web/src/lib/registry/geometry.ts | 20 +++---- web/src/lib/registry/text.ts | 16 +++--- web/src/routes/+page.svelte | 2 +- web/src/routes/list-tools/+page.svelte | 2 +- 12 files changed, 131 insertions(+), 75 deletions(-) diff --git a/web/src/lib/catalog.ts b/web/src/lib/catalog.ts index 1d4d254..76b1629 100644 --- a/web/src/lib/catalog.ts +++ b/web/src/lib/catalog.ts @@ -3,29 +3,14 @@ import { TOOLS, type ToolEntry } from "./registry"; export type PreviewGroup = { id: string; - label: string; tools: ToolEntry[]; }; -/** Uppercase labels для всех категорий каталога (стиль нового дизайна). */ -const GROUP_LABELS: Record = { - convert: "CONVERT", - alpha: "TRANSPARENCY", - color: "COLOR", - geometry: "GEOMETRY", - filters: "FILTERS", - text: "TEXT", - analyze: "ANALYZE", - generate: "GENERATE", -}; - /** * Preview-каталог: полный реестр инструментов, сгруппированный по категориям. - * Больше не урезаем до референс-набора — показываем все инструменты из TOOLS. */ export const PREVIEW_GROUPS: PreviewGroup[] = CATEGORY_IDS.map((category) => ({ id: category, - label: GROUP_LABELS[category] ?? category.toUpperCase(), tools: TOOLS.filter((tool) => tool.category === category), })).filter((group) => group.tools.length > 0); diff --git a/web/src/lib/components/CatalogGroup.svelte b/web/src/lib/components/CatalogGroup.svelte index fc8228a..39a8ac0 100644 --- a/web/src/lib/components/CatalogGroup.svelte +++ b/web/src/lib/components/CatalogGroup.svelte @@ -38,6 +38,7 @@ .group-title span { font: var(--font-size-s) var(--font-mono); letter-spacing: var(--space-text-xl); + text-transform: uppercase; color: var(--color-text); } .group-title i { diff --git a/web/src/lib/i18n/en.ts b/web/src/lib/i18n/en.ts index 83368fe..a5ac018 100644 --- a/web/src/lib/i18n/en.ts +++ b/web/src/lib/i18n/en.ts @@ -204,7 +204,34 @@ export const en: Dict = { toolUnknown: 'No tool is registered under "{id}".', }, fields: {}, - groups: {}, + groups: { + adjust: "Adjust", + anchor: "Anchor", + background: "Background", + baseColor: "Base color", + blocks: "Blocks", + canvas: "Canvas", + colors: "Colors", + cropArea: "Crop area", + fill: "Fill", + grid: "Grid", + noise: "Noise", + offset: "Offset", + options: "Options", + output: "Output", + padding: "Padding", + placement: "Placement", + plate: "Plate", + position: "Position", + random: "Random", + scaling: "Scaling", + seed: "Seed", + shape: "Shape", + spectrum: "Spectrum", + text: "Text", + tile: "Tile", + watermark: "Watermark", + }, tools: { "png-file-size": { results: { diff --git a/web/src/lib/i18n/ru.ts b/web/src/lib/i18n/ru.ts index 9b679e2..c367c12 100644 --- a/web/src/lib/i18n/ru.ts +++ b/web/src/lib/i18n/ru.ts @@ -205,7 +205,34 @@ export const ru: Dict = { toolUnknown: "Инструмента с id «{id}» нет в реестре.", }, fields: {}, - groups: {}, + groups: { + adjust: "Коррекция", + anchor: "Привязка", + background: "Фон", + baseColor: "Базовый цвет", + blocks: "Блоки", + canvas: "Холст", + colors: "Цвета", + cropArea: "Область кадрирования", + fill: "Заливка", + grid: "Сетка", + noise: "Шум", + offset: "Смещение", + options: "Параметры", + output: "Вывод", + padding: "Поля", + placement: "Размещение", + plate: "Плашка", + position: "Положение", + random: "Случайность", + scaling: "Масштаб", + seed: "Сид", + shape: "Форма", + spectrum: "Спектр", + text: "Текст", + tile: "Плитка", + watermark: "Водяной знак", + }, tools: { "png-to-bmp": { title: "Конвертировать PNG в BMP", diff --git a/web/src/lib/registry/alpha.ts b/web/src/lib/registry/alpha.ts index 5b15fa2..cb51560 100644 --- a/web/src/lib/registry/alpha.ts +++ b/web/src/lib/registry/alpha.ts @@ -104,8 +104,8 @@ const circleMaskSchema = toolSchema( { layout: { groups: [ - { title: "Shape", fields: ["size"] }, - { title: "Position", fields: ["offset"] }, + { title: "groups.shape", fields: ["size"] }, + { title: "groups.position", fields: ["offset"] }, ], }, }, @@ -145,11 +145,11 @@ const squareMaskSchema = toolSchema( layout: { groups: [ { - title: "Shape", + title: "groups.shape", cols: 2, fields: ["widthPct", "heightPct"], }, - { title: "Position", fields: ["offset"] }, + { title: "groups.position", fields: ["offset"] }, ], }, }, @@ -193,11 +193,11 @@ const starMaskSchema = toolSchema( layout: { groups: [ { - title: "Shape", + title: "groups.shape", cols: 2, fields: ["points", "innerRadius", "size", "rotation"], }, - { title: "Position", fields: ["offset"] }, + { title: "groups.position", fields: ["offset"] }, ], }, }, @@ -241,11 +241,11 @@ const wavyMaskSchema = toolSchema( layout: { groups: [ { - title: "Shape", + title: "groups.shape", cols: 2, fields: ["size", "amplitude", "waves", "phase"], }, - { title: "Position", fields: ["offset"] }, + { title: "groups.position", fields: ["offset"] }, ], }, }, @@ -363,11 +363,11 @@ export const removeBackgroundSchema = toolSchema( layout: { groups: [ { - title: "Background", + title: "groups.background", cols: 2, fields: ["color", "tolerance"], }, - { title: "Options", fields: ["outerOnly", "smooth"] }, + { title: "groups.options", fields: ["outerOnly", "smooth"] }, ], }, }, diff --git a/web/src/lib/registry/color.ts b/web/src/lib/registry/color.ts index abf2eca..b572d68 100644 --- a/web/src/lib/registry/color.ts +++ b/web/src/lib/registry/color.ts @@ -208,7 +208,7 @@ export const brightnessContrastSchema = toolSchema( { layout: { groups: [ - { title: "Adjust", cols: 2, fields: ["brightness", "contrast"] }, + { title: "groups.adjust", cols: 2, fields: ["brightness", "contrast"] }, ], }, }, diff --git a/web/src/lib/registry/filters.ts b/web/src/lib/registry/filters.ts index 9198d74..2fc4a68 100644 --- a/web/src/lib/registry/filters.ts +++ b/web/src/lib/registry/filters.ts @@ -119,7 +119,9 @@ export const randomizePixelsSchema = toolSchema( }, { layout: { - groups: [{ title: "Blocks", cols: 2, fields: ["blockSize", "seed"] }], + groups: [ + { title: "groups.blocks", cols: 2, fields: ["blockSize", "seed"] }, + ], }, }, ); @@ -156,8 +158,8 @@ export const addNoiseSchema = toolSchema( { layout: { groups: [ - { title: "Noise", cols: 2, fields: ["amount", "mode"] }, - { title: "Seed", fields: ["seed"] }, + { title: "groups.noise", cols: 2, fields: ["amount", "mode"] }, + { title: "groups.seed", fields: ["seed"] }, ], }, }, diff --git a/web/src/lib/registry/generate.ts b/web/src/lib/registry/generate.ts index ba08754..36861c9 100644 --- a/web/src/lib/registry/generate.ts +++ b/web/src/lib/registry/generate.ts @@ -87,8 +87,8 @@ export const createEmptySchema = toolSchema( { layout: { groups: [ - { title: "Canvas", fields: ["size"] }, - { title: "Fill", fields: ["transparent", "color"] }, + { title: "groups.canvas", fields: ["size"] }, + { title: "groups.fill", fields: ["transparent", "color"] }, ], }, }, @@ -174,8 +174,8 @@ export const linearGradientSchema = toolSchema( { layout: { groups: [ - { title: "Canvas", fields: ["size"] }, - { title: "Colors", fields: ["gradient"] }, + { title: "groups.canvas", fields: ["size"] }, + { title: "groups.colors", fields: ["gradient"] }, ], }, }, @@ -225,8 +225,11 @@ export const colorSpectrumSchema = toolSchema( { layout: { groups: [ - { title: "Canvas", fields: ["size"] }, - { title: "Spectrum", fields: ["direction", "saturation", "lightness"] }, + { title: "groups.canvas", fields: ["size"] }, + { + title: "groups.spectrum", + fields: ["direction", "saturation", "lightness"], + }, ], }, }, @@ -262,8 +265,8 @@ export const randomColorsSchema = toolSchema( { layout: { groups: [ - { title: "Canvas", fields: ["size"] }, - { title: "Random", cols: 2, fields: ["blockSize", "seed"] }, + { title: "groups.canvas", fields: ["size"] }, + { title: "groups.random", cols: 2, fields: ["blockSize", "seed"] }, ], }, }, @@ -305,9 +308,9 @@ export const drawGridSchema = toolSchema( { layout: { groups: [ - { title: "Canvas", fields: ["size"] }, + { title: "groups.canvas", fields: ["size"] }, { - title: "Grid", + title: "groups.grid", cols: 2, fields: ["cols", "rows", "lineWidth", "color", "transparentBg"], }, @@ -356,9 +359,13 @@ export const placeholderSchema = toolSchema( { layout: { groups: [ - { title: "Canvas", fields: ["size"] }, - { title: "Colors", cols: 2, fields: ["backgroundColor", "color"] }, - { title: "Text", fields: ["showText"] }, + { title: "groups.canvas", fields: ["size"] }, + { + title: "groups.colors", + cols: 2, + fields: ["backgroundColor", "color"], + }, + { title: "groups.text", fields: ["showText"] }, ], }, }, @@ -436,8 +443,12 @@ export const stepColorsSchema = toolSchema( { layout: { groups: [ - { title: "Colors", fields: ["pair"] }, - { title: "Output", cols: 2, fields: ["steps", "width", "layout"] }, + { title: "groups.colors", fields: ["pair"] }, + { + title: "groups.output", + cols: 2, + fields: ["steps", "width", "layout"], + }, ], }, }, @@ -523,9 +534,9 @@ const paletteBaseSchema = { const paletteLayoutGroup = { layout: { groups: [ - { title: "Base color", fields: ["baseColor"] }, + { title: "groups.baseColor", fields: ["baseColor"] }, { - title: "Output", + title: "groups.output", cols: 2, fields: ["width", "layout"], }, @@ -684,8 +695,8 @@ export const mixColorsSchema = toolSchema( { layout: { groups: [ - { title: "Colors", fields: ["colors"] }, - { title: "Output", fields: ["width"] }, + { title: "groups.colors", fields: ["colors"] }, + { title: "groups.output", fields: ["width"] }, ], }, }, @@ -741,9 +752,9 @@ export const sortColorsSchema = toolSchema( { layout: { groups: [ - { title: "Colors", fields: ["colors"] }, + { title: "groups.colors", fields: ["colors"] }, { - title: "Output", + title: "groups.output", cols: 2, fields: ["order", "width", "layout"], }, @@ -791,9 +802,12 @@ export const textToPngSchema = toolSchema( { layout: { groups: [ - { title: "Text", fields: ["text", "style"] }, - { title: "Background", fields: ["transparentBg", "backgroundColor"] }, - { title: "Padding", fields: ["padding"] }, + { title: "groups.text", fields: ["text", "style"] }, + { + title: "groups.background", + fields: ["transparentBg", "backgroundColor"], + }, + { title: "groups.padding", fields: ["padding"] }, ], }, }, diff --git a/web/src/lib/registry/geometry.ts b/web/src/lib/registry/geometry.ts index 52670b0..19f77b3 100644 --- a/web/src/lib/registry/geometry.ts +++ b/web/src/lib/registry/geometry.ts @@ -76,8 +76,8 @@ export const fitOnBackgroundSchema = toolSchema( { layout: { groups: [ - { title: "Canvas", fields: ["size"] }, - { title: "Background", fields: ["transparent", "color"] }, + { title: "groups.canvas", fields: ["size"] }, + { title: "groups.background", fields: ["transparent", "color"] }, ], }, }, @@ -136,8 +136,8 @@ export const changeCanvasSizeSchema = toolSchema( { layout: { groups: [ - { title: "Canvas", fields: ["size"] }, - { title: "Anchor", fields: ["anchor"] }, + { title: "groups.canvas", fields: ["size"] }, + { title: "groups.anchor", fields: ["anchor"] }, ], }, }, @@ -174,8 +174,8 @@ export const resizeSchema = toolSchema( { layout: { groups: [ - { title: "Canvas", fields: ["size"] }, - { title: "Scaling", fields: ["keepAspect"] }, + { title: "groups.canvas", fields: ["size"] }, + { title: "groups.scaling", fields: ["keepAspect"] }, ], }, }, @@ -226,8 +226,8 @@ export const cropSchema = toolSchema( { layout: { groups: [ - { title: "Offset", fields: ["x", "y"] }, - { title: "Crop area", fields: ["size"] }, + { title: "groups.offset", fields: ["x", "y"] }, + { title: "groups.cropArea", fields: ["size"] }, ], }, }, @@ -315,8 +315,8 @@ export const addPaddingSchema = toolSchema( { layout: { groups: [ - { title: "Padding", fields: ["padding"] }, - { title: "Fill", fields: ["transparent", "color"] }, + { title: "groups.padding", fields: ["padding"] }, + { title: "groups.fill", fields: ["transparent", "color"] }, ], }, }, diff --git a/web/src/lib/registry/text.ts b/web/src/lib/registry/text.ts index 6fbdd23..6d9e23c 100644 --- a/web/src/lib/registry/text.ts +++ b/web/src/lib/registry/text.ts @@ -31,9 +31,9 @@ const addTextSchema = toolSchema( { layout: { groups: [ - { title: "Text", fields: ["text", "style"] }, - { title: "Placement", fields: ["position", "margin"] }, - { title: "Plate", fields: ["plate"] }, + { title: "groups.text", fields: ["text", "style"] }, + { title: "groups.placement", fields: ["position", "margin"] }, + { title: "groups.plate", fields: ["plate"] }, ], }, }, @@ -93,9 +93,9 @@ const dateStampSchema = toolSchema( { layout: { groups: [ - { title: "Text", fields: ["format", "style"] }, - { title: "Placement", fields: ["position", "margin"] }, - { title: "Plate", fields: ["plate"] }, + { title: "groups.text", fields: ["format", "style"] }, + { title: "groups.placement", fields: ["position", "margin"] }, + { title: "groups.plate", fields: ["plate"] }, ], }, }, @@ -154,9 +154,9 @@ const watermarkTileSchema = toolSchema( { layout: { groups: [ - { title: "Watermark", fields: ["text", "style", "opacity"] }, + { title: "groups.watermark", fields: ["text", "style", "opacity"] }, { - title: "Tile", + title: "groups.tile", cols: 2, fields: ["angle", "stepX", "stepY"], }, diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index c0cd848..b92f065 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -13,7 +13,7 @@ const groups = $derived( PREVIEW_GROUPS.map((g) => ({ id: g.id, - label: g.label, + label: t(`categories.${g.id}`), tools: g.tools.filter( (t) => (category === "all" || category === g.id) && diff --git a/web/src/routes/list-tools/+page.svelte b/web/src/routes/list-tools/+page.svelte index df92f6c..f9ef94b 100644 --- a/web/src/routes/list-tools/+page.svelte +++ b/web/src/routes/list-tools/+page.svelte @@ -13,7 +13,7 @@ const groups = $derived( PREVIEW_GROUPS.map((g) => ({ id: g.id, - label: g.label, + label: t(`categories.${g.id}`), tools: g.tools.filter( (t) => (category === "all" || category === g.id) &&