Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support multilingual menu display using i18next (supports Chinese and English) #991

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
47 changes: 39 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
"fastest-levenshtein": "^1.0.16",
"get-folder-size": "^5.0.0",
"globby": "^14.0.2",
"i18next": "^24.2.2",
"isbinaryfile": "^5.0.2",
"mammoth": "^1.8.0",
"monaco-vscode-textmate-theme-converter": "^0.1.7",
Expand Down Expand Up @@ -378,7 +379,7 @@
"prettier": "^3.4.2",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.5",
"typescript": "^5.4.5"
"typescript": "^5.7.3"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,css,md}": [
Expand Down
15 changes: 6 additions & 9 deletions src/shared/experiments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,19 @@ type valueof<X> = X[keyof X]

export const experimentConfigsMap: Record<ExperimentKey, ExperimentConfig> = {
DIFF_STRATEGY: {
name: "Use experimental unified diff strategy",
description:
"Enable the experimental unified diff strategy. This strategy might reduce the number of retries caused by model errors but may cause unexpected behavior or incorrect edits. Only enable if you understand the risks and are willing to carefully review all changes.",
name: "settings.advanced.diff.unifiedStrategy.title",
description: "settings.advanced.diff.unifiedStrategy.description",
enabled: false,
},
SEARCH_AND_REPLACE: {
name: "Use experimental search and replace tool",
description:
"Enable the experimental search and replace tool, allowing Roo to replace multiple instances of a search term in one request.",
name: "settings.advanced.searchReplace.title",
description: "settings.advanced.searchReplace.description",
enabled: false,
},
INSERT_BLOCK: {
name: "Use experimental insert content tool",
name: "settings.advanced.insertBlock.title",

description:
"Enable the experimental insert content tool, allowing Roo to insert content at specific line numbers without needing to create a diff.",
description: "settings.advanced.insertBlock.description",
enabled: false,
},
}
Expand Down
35 changes: 14 additions & 21 deletions src/shared/support-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@ interface SupportPromptConfig {

const supportPromptConfigs: Record<string, SupportPromptConfig> = {
ENHANCE: {
label: "Enhance Prompt",
description:
"Use prompt enhancement to get tailored suggestions or improvements for your inputs. This ensures Roo understands your intent and provides the best possible responses. Available via the ✨ icon in chat.",
label: "supportPrompt.ENHANCE.label",
description: "supportPrompt.ENHANCE.description",
template: `Generate an enhanced version of this prompt (reply with only the enhanced prompt - no conversation, explanations, lead-in, bullet points, placeholders, or surrounding quotes):

\${userInput}`,
},
EXPLAIN: {
label: "Explain Code",
description:
"Get detailed explanations of code snippets, functions, or entire files. Useful for understanding complex code or learning new patterns. Available in code actions (lightbulb icon in the editor) and the editor context menu (right-click on selected code).",
label: "supportPrompt.EXPLAIN.label",
description: "supportPrompt.EXPLAIN.description",
template: `Explain the following code from file path @/\${filePath}:
\${userInput}

Expand All @@ -56,9 +54,8 @@ Please provide a clear and concise explanation of what this code does, including
3. Important patterns or techniques used`,
},
FIX: {
label: "Fix Issues",
description:
"Get help identifying and resolving bugs, errors, or code quality issues. Provides step-by-step guidance for fixing problems. Available in code actions (lightbulb icon in the editor) and the editor context menu (right-click on selected code).",
label: "supportPrompt.FIX.label",
description: "supportPrompt.FIX.description",
template: `Fix any issues in the following code from file path @/\${filePath}
\${diagnosticText}
\${userInput}
Expand All @@ -74,9 +71,8 @@ Please:
4. Explain what was fixed and why`,
},
IMPROVE: {
label: "Improve Code",
description:
"Receive suggestions for code optimization, better practices, and architectural improvements while maintaining functionality. Available in code actions (lightbulb icon in the editor) and the editor context menu (right-click on selected code).",
label: "supportPrompt.IMPROVE.label",
description: "supportPrompt.IMPROVE.description",
template: `Improve the following code from file path @/\${filePath}:
\${userInput}

Expand All @@ -93,9 +89,8 @@ Please suggest improvements for:
Provide the improved code along with explanations for each enhancement.`,
},
ADD_TO_CONTEXT: {
label: "Add to Context",
description:
"Add context to your current task or conversation. Useful for providing additional information or clarifications. Available in code actions (lightbulb icon in the editor). and the editor context menu (right-click on selected code).",
label: "supportPrompt.ADD_TO_CONTEXT.label",
description: "supportPrompt.ADD_TO_CONTEXT.description",
template: `@/\${filePath}:
\`\`\`
\${selectedText}
Expand All @@ -112,9 +107,8 @@ Terminal output:
\`\`\``,
},
TERMINAL_FIX: {
label: "Fix Terminal Command",
description:
"Get help fixing terminal commands that failed or need improvement. Available in the terminal context menu (right-click on selected terminal content).",
label: "supportPrompt.TERMINAL_FIX.label",
description: "supportPrompt.TERMINAL_FIX.description",
template: `\${userInput}
Fix this terminal command:
\`\`\`
Expand All @@ -127,9 +121,8 @@ Please:
3. Explain what was fixed and why`,
},
TERMINAL_EXPLAIN: {
label: "Explain Terminal Command",
description:
"Get detailed explanations of terminal commands and their outputs. Available in the terminal context menu (right-click on selected terminal content).",
label: "supportPrompt.TERMINAL_EXPLAIN.label",
description: "supportPrompt.TERMINAL_EXPLAIN.description",
template: `\${userInput}
Explain this terminal command:
\`\`\`
Expand Down
10 changes: 5 additions & 5 deletions src/shared/tool-groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ export function getToolOptions(toolConfig: string | readonly [ToolName, ...any[]

// Display names for groups in UI
export const GROUP_DISPLAY_NAMES: Record<ToolGroup, string> = {
read: "Read Files",
edit: "Edit Files",
browser: "Use Browser",
command: "Run Commands",
mcp: "Use MCP",
read: "tools.read.description",
edit: "tools.edit.description",
browser: "tools.browser.description",
command: "tools.command.description",
mcp: "tools.mcp.description",
}
2 changes: 1 addition & 1 deletion webview-ui/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const config: StorybookConfig = {
options: {},
},
}
export default config
export default config
2 changes: 1 addition & 1 deletion webview-ui/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const preview: Preview = {
},
}

export default preview
export default preview
Loading
Loading