Skip to content

Commit 1749197

Browse files
authored
Merge pull request #1707 from RooVetGit/i18n_tool_names
Localize tool group names
2 parents 39d24ff + 534f6fa commit 1749197

File tree

21 files changed

+156
-32
lines changed

21 files changed

+156
-32
lines changed

src/shared/tool-groups.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,3 @@ export function getToolName(toolConfig: string | readonly [ToolName, ...any[]]):
6666
export function getToolOptions(toolConfig: string | readonly [ToolName, ...any[]]): any {
6767
return typeof toolConfig === "string" ? undefined : toolConfig[1]
6868
}
69-
70-
// Display names for groups in UI
71-
export const GROUP_DISPLAY_NAMES: Record<ToolGroup, string> = {
72-
read: "Read Files",
73-
edit: "Edit Files",
74-
browser: "Use Browser",
75-
command: "Run Commands",
76-
mcp: "Use MCP",
77-
}

webview-ui/src/components/prompts/PromptsView.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
import { CustomModeSchema } from "../../../../src/core/config/CustomModesSchema"
2323
import { supportPrompt, SupportPromptType } from "../../../../src/shared/support-prompt"
2424

25-
import { TOOL_GROUPS, GROUP_DISPLAY_NAMES, ToolGroup } from "../../../../src/shared/tool-groups"
25+
import { TOOL_GROUPS, ToolGroup } from "../../../../src/shared/tool-groups"
2626
import { vscode } from "../../utils/vscode"
2727
import { Tab, TabContent, TabHeader } from "../common/Tab"
2828
import i18next from "i18next"
@@ -657,7 +657,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
657657
checked={isGroupEnabled}
658658
onChange={handleGroupChange(group, Boolean(isCustomMode), customMode)}
659659
disabled={!isCustomMode}>
660-
{GROUP_DISPLAY_NAMES[group]}
660+
{t(`prompts:tools.toolNames.${group}`)}
661661
{group === "edit" && (
662662
<div className="text-xs text-vscode-descriptionForeground mt-0.5">
663663
{t("prompts:tools.allowedFiles")}{" "}
@@ -689,7 +689,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
689689
return enabledGroups
690690
.map((group) => {
691691
const groupName = getGroupName(group)
692-
const displayName = GROUP_DISPLAY_NAMES[groupName]
692+
const displayName = t(`prompts:tools.toolNames.${groupName}`)
693693
if (Array.isArray(group) && group[1]?.fileRegex) {
694694
const description =
695695
group[1].description || `/${group[1].fileRegex}/`
@@ -1247,7 +1247,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
12471247
)
12481248
}
12491249
}}>
1250-
{GROUP_DISPLAY_NAMES[group]}
1250+
{t(`prompts:tools.toolNames.${group}`)}
12511251
</VSCodeCheckbox>
12521252
))}
12531253
</div>

webview-ui/src/i18n/locales/ar/prompts.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
"builtInModesText": "لا يمكن تعديل أدوات الأوضاع المدمجة",
1919
"editTools": "تعديل الأدوات",
2020
"doneEditing": "انتهاء التعديل",
21-
"allowedFiles": "الملفات المسموحة:"
21+
"allowedFiles": "الملفات المسموحة:",
22+
"toolNames": {
23+
"read": "قراءة الملفات",
24+
"edit": "تعديل الملفات",
25+
"browser": "استخدام المتصفح",
26+
"command": "تنفيذ الأوامر",
27+
"mcp": "استخدام MCP"
28+
}
2229
},
2330
"roleDefinition": {
2431
"title": "تعريف الدور",

webview-ui/src/i18n/locales/ca/prompts.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
"builtInModesText": "Les eines per a modes integrats no es poden modificar",
1919
"editTools": "Editar eines",
2020
"doneEditing": "Finalitzar edició",
21-
"allowedFiles": "Fitxers permesos:"
21+
"allowedFiles": "Fitxers permesos:",
22+
"toolNames": {
23+
"read": "Llegir fitxers",
24+
"edit": "Editar fitxers",
25+
"browser": "Utilitzar navegador",
26+
"command": "Executar comandes",
27+
"mcp": "Utilitzar MCP"
28+
}
2229
},
2330
"roleDefinition": {
2431
"title": "Definició de rol",

webview-ui/src/i18n/locales/cs/prompts.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
"builtInModesText": "Nástroje pro vestavěné režimy nelze upravovat",
1919
"editTools": "Upravit nástroje",
2020
"doneEditing": "Dokončit úpravy",
21-
"allowedFiles": "Povolené soubory:"
21+
"allowedFiles": "Povolené soubory:",
22+
"toolNames": {
23+
"read": "Číst soubory",
24+
"edit": "Upravit soubory",
25+
"browser": "Použít prohlížeč",
26+
"command": "Spustit příkazy",
27+
"mcp": "Použít MCP"
28+
}
2229
},
2330
"roleDefinition": {
2431
"title": "Definice role",

webview-ui/src/i18n/locales/de/prompts.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
"builtInModesText": "Werkzeuge für eingebaute Modi können nicht geändert werden",
1919
"editTools": "Werkzeuge bearbeiten",
2020
"doneEditing": "Bearbeitung abschließen",
21-
"allowedFiles": "Erlaubte Dateien:"
21+
"allowedFiles": "Erlaubte Dateien:",
22+
"toolNames": {
23+
"read": "Dateien lesen",
24+
"edit": "Dateien bearbeiten",
25+
"browser": "Browser verwenden",
26+
"command": "Befehle ausführen",
27+
"mcp": "MCP verwenden"
28+
}
2229
},
2330
"roleDefinition": {
2431
"title": "Rollendefinition",

webview-ui/src/i18n/locales/en/prompts.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
"builtInModesText": "Tools for built-in modes cannot be modified",
1919
"editTools": "Edit tools",
2020
"doneEditing": "Done editing",
21-
"allowedFiles": "Allowed files:"
21+
"allowedFiles": "Allowed files:",
22+
"toolNames": {
23+
"read": "Read Files",
24+
"edit": "Edit Files",
25+
"browser": "Use Browser",
26+
"command": "Run Commands",
27+
"mcp": "Use MCP"
28+
}
2229
},
2330
"roleDefinition": {
2431
"title": "Role Definition",

webview-ui/src/i18n/locales/es/prompts.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
"builtInModesText": "Las herramientas para modos integrados no se pueden modificar",
1919
"editTools": "Editar herramientas",
2020
"doneEditing": "Terminar edición",
21-
"allowedFiles": "Archivos permitidos:"
21+
"allowedFiles": "Archivos permitidos:",
22+
"toolNames": {
23+
"read": "Leer archivos",
24+
"edit": "Editar archivos",
25+
"browser": "Usar navegador",
26+
"command": "Ejecutar comandos",
27+
"mcp": "Usar MCP"
28+
}
2229
},
2330
"roleDefinition": {
2431
"title": "Definición de rol",

webview-ui/src/i18n/locales/fr/prompts.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
"builtInModesText": "Les outils pour les modes intégrés ne peuvent pas être modifiés",
1919
"editTools": "Modifier les outils",
2020
"doneEditing": "Terminer la modification",
21-
"allowedFiles": "Fichiers autorisés :"
21+
"allowedFiles": "Fichiers autorisés :",
22+
"toolNames": {
23+
"read": "Lire les fichiers",
24+
"edit": "Modifier les fichiers",
25+
"browser": "Utiliser le navigateur",
26+
"command": "Exécuter des commandes",
27+
"mcp": "Utiliser MCP"
28+
}
2229
},
2330
"roleDefinition": {
2431
"title": "Définition du rôle",

webview-ui/src/i18n/locales/hi/prompts.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
"builtInModesText": "अंतर्निहित मोड्स के लिए टूल्स को संशोधित नहीं किया जा सकता",
1919
"editTools": "टूल्स संपादित करें",
2020
"doneEditing": "संपादन पूरा हुआ",
21-
"allowedFiles": "अनुमत फाइलें:"
21+
"allowedFiles": "अनुमत फाइलें:",
22+
"toolNames": {
23+
"read": "फाइलें पढ़ें",
24+
"edit": "फाइलें संपादित करें",
25+
"browser": "ब्राउज़र का उपयोग करें",
26+
"command": "कमांड्स चलाएँ",
27+
"mcp": "MCP का उपयोग करें"
28+
}
2229
},
2330
"roleDefinition": {
2431
"title": "भूमिका परिभाषा",

0 commit comments

Comments
 (0)