docs: update dict for i18n

This commit is contained in:
2026-09-13 04:23:41 +05:00
parent 71b5c90a4a
commit a71487d30b
3 changed files with 18 additions and 12 deletions
+2 -9
View File
@@ -4,7 +4,7 @@
FieldSpecKind,
ToolSchema,
} from "$lib/registry-schema";
import { fieldLabel as labelOf } from "$lib/i18n/schema-tool-strings";
import { fieldLabel } from "$lib/i18n/schema-tool-strings";
import { RotateCcw } from "@lucide/svelte";
import type { Component } from "svelte";
import DimensionField from "./fields/DimensionField.svelte";
@@ -53,13 +53,6 @@
}
let { schema, values, onchange, onreset }: Props = $props();
function labelOf(id: string): string {
return id
.replace(/([a-z])([A-Z])/g, "$1 $2")
.replace(/[_-]+/g, " ")
.replace(/\b\w/g, (c) => c.toUpperCase());
}
interface LayoutGroup {
key: string;
title?: string;
@@ -107,7 +100,7 @@
{#each group.fields as id (id)}
{@const Control = FIELDS[schema.fields[id].spec.kind]}
<Control
label={labelOf(id)}
label={fieldLabel(schema.fields[id], id)}
value={values[id]}
spec={schema.fields[id].spec}
onchange={(v) => onchange(id, v)}
+8
View File
@@ -53,4 +53,12 @@ export type Dict = {
ui: Record<string, string>;
errors: Record<string, string>;
tools: Record<string, ToolStrings>;
/** Действия панели результата/генерации (Generate, Open image…). */
actions?: Record<string, string>;
/** Поля ввода текста нового UI (placeholder, Try sample…). */
textSource?: Record<string, string>;
/** Подписи полей по ключу (решение C: label-ключ на поле). */
fields?: Record<string, string>;
/** Заголовки групп полей по ключу (решение A). */
groups?: Record<string, string>;
};