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 = {
id: string;
label: string;
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-каталог: полный реестр инструментов, сгруппированный по категориям.
* Больше не урезаем до референс-набора — показываем все инструменты из 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);
@@ -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 {
+28 -1
View File
@@ -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: {
+28 -1
View File
@@ -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",
+10 -10
View File
@@ -104,8 +104,8 @@ const circleMaskSchema = toolSchema<CircleMaskParams>(
{
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<SquareMaskParams>(
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<StarMaskParams>(
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<WavyMaskParams>(
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<RemoveBackgroundParams>(
layout: {
groups: [
{
title: "Background",
title: "groups.background",
cols: 2,
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: {
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: {
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: {
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"] },
],
},
},
+38 -24
View File
@@ -87,8 +87,8 @@ export const createEmptySchema = toolSchema<CreateEmptyParams>(
{
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<LinearGradientParams>(
{
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<ColorSpectrumParams>(
{
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<RandomColorsParams>(
{
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<DrawGridParams>(
{
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<PlaceholderParams>(
{
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<StepColorsParams>(
{
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<MixColorsParams>(
{
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<SortColorsParams>(
{
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<TextToPngParams>(
{
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"] },
],
},
},
+10 -10
View File
@@ -76,8 +76,8 @@ export const fitOnBackgroundSchema = toolSchema<FitOnBackgroundParams>(
{
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<ChangeCanvasSizeParams>(
{
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<ResizeParams>(
{
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<CropParams>(
{
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<AddPaddingParams>(
{
layout: {
groups: [
{ title: "Padding", fields: ["padding"] },
{ title: "Fill", fields: ["transparent", "color"] },
{ title: "groups.padding", fields: ["padding"] },
{ title: "groups.fill", fields: ["transparent", "color"] },
],
},
},
+8 -8
View File
@@ -31,9 +31,9 @@ const addTextSchema = toolSchema<AddTextParams>(
{
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<DateStampParams>(
{
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<WatermarkTileParams>(
{
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"],
},
+1 -1
View File
@@ -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) &&
+1 -1
View File
@@ -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) &&