fix(ui): show agent and user-defined option labels as written (#6193)

Option labels that come from agents, databases, build tools and user settings matched UI catalog keys by accident, so some were translated and others were not (reasoning effort showed 高 next to Extra high; an HTTP client environment named test showed as 测试 while prod stayed English).

Mark these labels and descriptions verbatim: agent config values, model names and providers, the approval switch label, HTTP client environments, dependency scopes and Gradle configurations, chart columns, database schemas, data sources, warehouses and roles, custom scopes, and plugin setting options. Option headings stay localized.

Fixes #6191
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-26 21:39:30 +08:00
1 джерело 5289f44620
коміт dc490f1017
13 files changed
+163 -34

No files matched your search

+1 -1
Переглянути файл
@@ -56,7 +56,7 @@ export function ChartView({ columns, rows }: { columns: readonly GridColumn[]; r
return () => ro.disconnect();
}, []);
const options = columns.map((c, i) => ({ value: String(i), label: c.name }));
const options = columns.map((c, i) => ({ value: String(i), label: c.name, verbatim: true }));
const values = points.map((p) => p.value);
const ticks = niceTicks(
Math.min(0, ...values),
+9 -2
Переглянути файл
@@ -59,13 +59,20 @@ function SidePicker({ label, side, onChange }: { label: string; side: Side; onCh
.map((s) => ({
value: s.id ?? "",
label: s.name ?? "",
verbatim: true,
icon: "database",
}));
if (side.id && !sourceOptions.some((o) => o.value === side.id))
sourceOptions.push({ value: side.id, label: targetLabel(side.id), icon: "database" });
const names = schemas?.status === "ok" ? schemas.value : [];
const schemaOptions: SelectOption[] = names.map((n) => ({ value: n, label: n, icon: "db-schema" }));
if (side.schema && !names.includes(side.schema)) schemaOptions.unshift({ value: side.schema, label: side.schema });
const schemaOptions: SelectOption[] = names.map((n) => ({
value: n,
label: n,
verbatim: true,
icon: "db-schema",
}));
if (side.schema && !names.includes(side.schema))
schemaOptions.unshift({ value: side.schema, label: side.schema, verbatim: true });
return (
<div className={styles.side}>
<span className={styles.sideLabel}>
+6 -1
Переглянути файл
@@ -38,7 +38,12 @@ export function SqlScopesPage() {
const options: SelectOption[] = [
{ value: NONE, label: tx("<none>") },
...(sources ?? []).map((s) => ({ value: s.id ?? "", label: s.name ?? s.id ?? "", icon: "database" })),
...(sources ?? []).map((s) => ({
value: s.id ?? "",
label: s.name ?? s.id ?? "",
verbatim: true,
icon: "database",
})),
];
const sourceOptions = (current: string) =>
current && !options.some((o) => o.value === current)
+3 -3
Переглянути файл
@@ -759,10 +759,10 @@ function ConsoleBar({ path, view }: { path: string; view: EditorView }) {
const schemaOptions = useMemo(() => {
if (!switchable) return [];
const names = schemaList?.status === "ok" ? schemaList.value : [];
const out = names.map((n) => ({ value: n, label: n, icon: "db-schema" }));
const out = names.map((n) => ({ value: n, label: n, verbatim: true, icon: "db-schema" }));
// The connection's default is offered even before its schema list loads.
if (defaultSchema && !names.includes(defaultSchema))
out.unshift({ value: defaultSchema, label: defaultSchema, icon: "db-schema" });
out.unshift({ value: defaultSchema, label: defaultSchema, verbatim: true, icon: "db-schema" });
return out;
}, [switchable, schemaList, defaultSchema]);
// IDEA's order: pick the data source, then a database and a schema in it.
@@ -1026,7 +1026,7 @@ function SnowflakeSession({ target, idle }: { target: string; idle: boolean }) {
setState((s) => (what === "WAREHOUSE" ? { ...s, warehouse: name } : { ...s, role: name }));
};
const options = (names: string[], current: string) =>
[...new Set(current ? [current, ...names] : names)].map((n) => ({ value: n, label: n }));
[...new Set(current ? [current, ...names] : names)].map((n) => ({ value: n, label: n, verbatim: true }));
return (
<>
<Select