fix: update i18n - tool group descriptions

This commit is contained in:
2026-09-13 06:47:14 +05:00
parent 372babc3b7
commit 4de42b1e40
12 changed files with 131 additions and 75 deletions
-15
View File
@@ -3,29 +3,14 @@ import { TOOLS, type ToolEntry } from "./registry";
export type PreviewGroup = { export type PreviewGroup = {
id: string; id: string;
label: string;
tools: ToolEntry[]; tools: ToolEntry[];
}; };
/** Uppercase labels для всех категорий каталога (стиль нового дизайна). */
const GROUP_LABELS: Record<string, string> = {
convert: "CONVERT",
alpha: "TRANSPARENCY",
color: "COLOR",
geometry: "GEOMETRY",
filters: "FILTERS",
text: "TEXT",
analyze: "ANALYZE",
generate: "GENERATE",
};
/** /**
* Preview-каталог: полный реестр инструментов, сгруппированный по категориям. * Preview-каталог: полный реестр инструментов, сгруппированный по категориям.
* Больше не урезаем до референс-набора — показываем все инструменты из TOOLS.
*/ */
export const PREVIEW_GROUPS: PreviewGroup[] = CATEGORY_IDS.map((category) => ({ export const PREVIEW_GROUPS: PreviewGroup[] = CATEGORY_IDS.map((category) => ({
id: category, id: category,
label: GROUP_LABELS[category] ?? category.toUpperCase(),
tools: TOOLS.filter((tool) => tool.category === category), tools: TOOLS.filter((tool) => tool.category === category),
})).filter((group) => group.tools.length > 0); })).filter((group) => group.tools.length > 0);
@@ -38,6 +38,7 @@
.group-title span { .group-title span {
font: var(--font-size-s) var(--font-mono); font: var(--font-size-s) var(--font-mono);
letter-spacing: var(--space-text-xl); letter-spacing: var(--space-text-xl);
text-transform: uppercase;
color: var(--color-text); color: var(--color-text);
} }
.group-title i { .group-title i {
+28 -1
View File
@@ -204,7 +204,34 @@ export const en: Dict = {
toolUnknown: 'No tool is registered under "{id}".', toolUnknown: 'No tool is registered under "{id}".',
}, },
fields: {}, 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: { tools: {
"png-file-size": { "png-file-size": {
results: { results: {
+28 -1
View File
@@ -205,7 +205,34 @@ export const ru: Dict = {
toolUnknown: "Инструмента с id «{id}» нет в реестре.", toolUnknown: "Инструмента с id «{id}» нет в реестре.",
}, },
fields: {}, 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: { tools: {
"png-to-bmp": { "png-to-bmp": {
title: "Конвертировать PNG в BMP", title: "Конвертировать PNG в BMP",
+10 -10
View File
@@ -104,8 +104,8 @@ const circleMaskSchema = toolSchema<CircleMaskParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Shape", fields: ["size"] }, { title: "groups.shape", fields: ["size"] },
{ title: "Position", fields: ["offset"] }, { title: "groups.position", fields: ["offset"] },
], ],
}, },
}, },
@@ -145,11 +145,11 @@ const squareMaskSchema = toolSchema<SquareMaskParams>(
layout: { layout: {
groups: [ groups: [
{ {
title: "Shape", title: "groups.shape",
cols: 2, cols: 2,
fields: ["widthPct", "heightPct"], fields: ["widthPct", "heightPct"],
}, },
{ title: "Position", fields: ["offset"] }, { title: "groups.position", fields: ["offset"] },
], ],
}, },
}, },
@@ -193,11 +193,11 @@ const starMaskSchema = toolSchema<StarMaskParams>(
layout: { layout: {
groups: [ groups: [
{ {
title: "Shape", title: "groups.shape",
cols: 2, cols: 2,
fields: ["points", "innerRadius", "size", "rotation"], fields: ["points", "innerRadius", "size", "rotation"],
}, },
{ title: "Position", fields: ["offset"] }, { title: "groups.position", fields: ["offset"] },
], ],
}, },
}, },
@@ -241,11 +241,11 @@ const wavyMaskSchema = toolSchema<WavyMaskParams>(
layout: { layout: {
groups: [ groups: [
{ {
title: "Shape", title: "groups.shape",
cols: 2, cols: 2,
fields: ["size", "amplitude", "waves", "phase"], fields: ["size", "amplitude", "waves", "phase"],
}, },
{ title: "Position", fields: ["offset"] }, { title: "groups.position", fields: ["offset"] },
], ],
}, },
}, },
@@ -363,11 +363,11 @@ export const removeBackgroundSchema = toolSchema<RemoveBackgroundParams>(
layout: { layout: {
groups: [ groups: [
{ {
title: "Background", title: "groups.background",
cols: 2, cols: 2,
fields: ["color", "tolerance"], fields: ["color", "tolerance"],
}, },
{ title: "Options", fields: ["outerOnly", "smooth"] }, { title: "groups.options", fields: ["outerOnly", "smooth"] },
], ],
}, },
}, },
+1 -1
View File
@@ -208,7 +208,7 @@ export const brightnessContrastSchema = toolSchema<BrightnessContrastParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Adjust", cols: 2, fields: ["brightness", "contrast"] }, { title: "groups.adjust", cols: 2, fields: ["brightness", "contrast"] },
], ],
}, },
}, },
+5 -3
View File
@@ -119,7 +119,9 @@ export const randomizePixelsSchema = toolSchema<RandomizePixelsParams>(
}, },
{ {
layout: { 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<AddNoiseParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Noise", cols: 2, fields: ["amount", "mode"] }, { title: "groups.noise", cols: 2, fields: ["amount", "mode"] },
{ title: "Seed", fields: ["seed"] }, { title: "groups.seed", fields: ["seed"] },
], ],
}, },
}, },
+38 -24
View File
@@ -87,8 +87,8 @@ export const createEmptySchema = toolSchema<CreateEmptyParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Canvas", fields: ["size"] }, { title: "groups.canvas", fields: ["size"] },
{ title: "Fill", fields: ["transparent", "color"] }, { title: "groups.fill", fields: ["transparent", "color"] },
], ],
}, },
}, },
@@ -174,8 +174,8 @@ export const linearGradientSchema = toolSchema<LinearGradientParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Canvas", fields: ["size"] }, { title: "groups.canvas", fields: ["size"] },
{ title: "Colors", fields: ["gradient"] }, { title: "groups.colors", fields: ["gradient"] },
], ],
}, },
}, },
@@ -225,8 +225,11 @@ export const colorSpectrumSchema = toolSchema<ColorSpectrumParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Canvas", fields: ["size"] }, { title: "groups.canvas", fields: ["size"] },
{ title: "Spectrum", fields: ["direction", "saturation", "lightness"] }, {
title: "groups.spectrum",
fields: ["direction", "saturation", "lightness"],
},
], ],
}, },
}, },
@@ -262,8 +265,8 @@ export const randomColorsSchema = toolSchema<RandomColorsParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Canvas", fields: ["size"] }, { title: "groups.canvas", fields: ["size"] },
{ title: "Random", cols: 2, fields: ["blockSize", "seed"] }, { title: "groups.random", cols: 2, fields: ["blockSize", "seed"] },
], ],
}, },
}, },
@@ -305,9 +308,9 @@ export const drawGridSchema = toolSchema<DrawGridParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Canvas", fields: ["size"] }, { title: "groups.canvas", fields: ["size"] },
{ {
title: "Grid", title: "groups.grid",
cols: 2, cols: 2,
fields: ["cols", "rows", "lineWidth", "color", "transparentBg"], fields: ["cols", "rows", "lineWidth", "color", "transparentBg"],
}, },
@@ -356,9 +359,13 @@ export const placeholderSchema = toolSchema<PlaceholderParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Canvas", fields: ["size"] }, { title: "groups.canvas", fields: ["size"] },
{ title: "Colors", cols: 2, fields: ["backgroundColor", "color"] }, {
{ title: "Text", fields: ["showText"] }, title: "groups.colors",
cols: 2,
fields: ["backgroundColor", "color"],
},
{ title: "groups.text", fields: ["showText"] },
], ],
}, },
}, },
@@ -436,8 +443,12 @@ export const stepColorsSchema = toolSchema<StepColorsParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Colors", fields: ["pair"] }, { title: "groups.colors", fields: ["pair"] },
{ title: "Output", cols: 2, fields: ["steps", "width", "layout"] }, {
title: "groups.output",
cols: 2,
fields: ["steps", "width", "layout"],
},
], ],
}, },
}, },
@@ -523,9 +534,9 @@ const paletteBaseSchema = {
const paletteLayoutGroup = { const paletteLayoutGroup = {
layout: { layout: {
groups: [ groups: [
{ title: "Base color", fields: ["baseColor"] }, { title: "groups.baseColor", fields: ["baseColor"] },
{ {
title: "Output", title: "groups.output",
cols: 2, cols: 2,
fields: ["width", "layout"], fields: ["width", "layout"],
}, },
@@ -684,8 +695,8 @@ export const mixColorsSchema = toolSchema<MixColorsParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Colors", fields: ["colors"] }, { title: "groups.colors", fields: ["colors"] },
{ title: "Output", fields: ["width"] }, { title: "groups.output", fields: ["width"] },
], ],
}, },
}, },
@@ -741,9 +752,9 @@ export const sortColorsSchema = toolSchema<SortColorsParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Colors", fields: ["colors"] }, { title: "groups.colors", fields: ["colors"] },
{ {
title: "Output", title: "groups.output",
cols: 2, cols: 2,
fields: ["order", "width", "layout"], fields: ["order", "width", "layout"],
}, },
@@ -791,9 +802,12 @@ export const textToPngSchema = toolSchema<TextToPngParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Text", fields: ["text", "style"] }, { title: "groups.text", fields: ["text", "style"] },
{ title: "Background", fields: ["transparentBg", "backgroundColor"] }, {
{ title: "Padding", fields: ["padding"] }, title: "groups.background",
fields: ["transparentBg", "backgroundColor"],
},
{ title: "groups.padding", fields: ["padding"] },
], ],
}, },
}, },
+10 -10
View File
@@ -76,8 +76,8 @@ export const fitOnBackgroundSchema = toolSchema<FitOnBackgroundParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Canvas", fields: ["size"] }, { title: "groups.canvas", fields: ["size"] },
{ title: "Background", fields: ["transparent", "color"] }, { title: "groups.background", fields: ["transparent", "color"] },
], ],
}, },
}, },
@@ -136,8 +136,8 @@ export const changeCanvasSizeSchema = toolSchema<ChangeCanvasSizeParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Canvas", fields: ["size"] }, { title: "groups.canvas", fields: ["size"] },
{ title: "Anchor", fields: ["anchor"] }, { title: "groups.anchor", fields: ["anchor"] },
], ],
}, },
}, },
@@ -174,8 +174,8 @@ export const resizeSchema = toolSchema<ResizeParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Canvas", fields: ["size"] }, { title: "groups.canvas", fields: ["size"] },
{ title: "Scaling", fields: ["keepAspect"] }, { title: "groups.scaling", fields: ["keepAspect"] },
], ],
}, },
}, },
@@ -226,8 +226,8 @@ export const cropSchema = toolSchema<CropParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Offset", fields: ["x", "y"] }, { title: "groups.offset", fields: ["x", "y"] },
{ title: "Crop area", fields: ["size"] }, { title: "groups.cropArea", fields: ["size"] },
], ],
}, },
}, },
@@ -315,8 +315,8 @@ export const addPaddingSchema = toolSchema<AddPaddingParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Padding", fields: ["padding"] }, { title: "groups.padding", fields: ["padding"] },
{ title: "Fill", fields: ["transparent", "color"] }, { title: "groups.fill", fields: ["transparent", "color"] },
], ],
}, },
}, },
+8 -8
View File
@@ -31,9 +31,9 @@ const addTextSchema = toolSchema<AddTextParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Text", fields: ["text", "style"] }, { title: "groups.text", fields: ["text", "style"] },
{ title: "Placement", fields: ["position", "margin"] }, { title: "groups.placement", fields: ["position", "margin"] },
{ title: "Plate", fields: ["plate"] }, { title: "groups.plate", fields: ["plate"] },
], ],
}, },
}, },
@@ -93,9 +93,9 @@ const dateStampSchema = toolSchema<DateStampParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Text", fields: ["format", "style"] }, { title: "groups.text", fields: ["format", "style"] },
{ title: "Placement", fields: ["position", "margin"] }, { title: "groups.placement", fields: ["position", "margin"] },
{ title: "Plate", fields: ["plate"] }, { title: "groups.plate", fields: ["plate"] },
], ],
}, },
}, },
@@ -154,9 +154,9 @@ const watermarkTileSchema = toolSchema<WatermarkTileParams>(
{ {
layout: { layout: {
groups: [ groups: [
{ title: "Watermark", fields: ["text", "style", "opacity"] }, { title: "groups.watermark", fields: ["text", "style", "opacity"] },
{ {
title: "Tile", title: "groups.tile",
cols: 2, cols: 2,
fields: ["angle", "stepX", "stepY"], fields: ["angle", "stepX", "stepY"],
}, },
+1 -1
View File
@@ -13,7 +13,7 @@
const groups = $derived( const groups = $derived(
PREVIEW_GROUPS.map((g) => ({ PREVIEW_GROUPS.map((g) => ({
id: g.id, id: g.id,
label: g.label, label: t(`categories.${g.id}`),
tools: g.tools.filter( tools: g.tools.filter(
(t) => (t) =>
(category === "all" || category === g.id) && (category === "all" || category === g.id) &&
+1 -1
View File
@@ -13,7 +13,7 @@
const groups = $derived( const groups = $derived(
PREVIEW_GROUPS.map((g) => ({ PREVIEW_GROUPS.map((g) => ({
id: g.id, id: g.id,
label: g.label, label: t(`categories.${g.id}`),
tools: g.tools.filter( tools: g.tools.filter(
(t) => (t) =>
(category === "all" || category === g.id) && (category === "all" || category === g.id) &&