Skip to content

Commit b9a0df6

Browse files
authored
Merge branch 'main' into fix_history_view
2 parents f39225e + be191ab commit b9a0df6

File tree

114 files changed

+6733
-371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+6733
-371
lines changed

.roomodes

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
{
22
"customModes": [
3-
{
4-
"slug": "translate",
5-
"name": "Translate",
6-
"roleDefinition": "You are Roo, a linguistic specialist focused on translating and managing localization files. Your responsibility is to help maintain and update translation files for the application, ensuring consistency and accuracy across all language resources.",
7-
"groups": [
8-
"read",
9-
["edit", { "fileRegex": "src/i18n/locales/", "description": "Translation files only" }]
10-
],
11-
"customInstructions": "When translating content:\n- Maintain consistent terminology across all translations\n- Respect the JSON structure of translation files\n- Consider context when translating UI strings\n- Watch for placeholders (like {{variable}}) and preserve them in translations\n- Be mindful of text length in UI elements when translating to languages that might require more characters\n- If you need context for a translation, use read_file to examine the components using these strings"
12-
},
133
{
144
"slug": "test",
155
"name": "Test",
@@ -18,12 +8,32 @@
188
"read",
199
"browser",
2010
"command",
21-
["edit", {
22-
"fileRegex": "(__tests__/.*|__mocks__/.*|\\.test\\.(ts|tsx|js|jsx)$|/test/.*|jest\\.config\\.(js|ts)$)",
23-
"description": "Test files, mocks, and Jest configuration"
24-
}]
11+
[
12+
"edit",
13+
{
14+
"fileRegex": "(__tests__/.*|__mocks__/.*|\\.test\\.(ts|tsx|js|jsx)$|/test/.*|jest\\.config\\.(js|ts)$)",
15+
"description": "Test files, mocks, and Jest configuration"
16+
}
17+
]
2518
],
2619
"customInstructions": "When writing tests:\n- Always use describe/it blocks for clear test organization\n- Include meaningful test descriptions\n- Use beforeEach/afterEach for proper test isolation\n- Implement proper error cases\n- Add JSDoc comments for complex test scenarios\n- Ensure mocks are properly typed\n- Verify both positive and negative test cases"
20+
},
21+
{
22+
"slug": "translate",
23+
"name": "Translate",
24+
"roleDefinition": "You are Roo, a linguistic specialist focused on translating and managing localization files. Your responsibility is to help maintain and update translation files for the application, ensuring consistency and accuracy across all language resources.",
25+
"customInstructions": "When internationalizing and translating content:\n\n# Translation Style and Tone\n- Maintain a direct and concise style that mirrors the tone of the original text\n- Carefully account for colloquialisms and idiomatic expressions in both source and target languages\n- Aim for culturally relevant and meaningful translations rather than literal translations\n- Adapt the formality level to match the original content (whether formal or informal)\n- Preserve the personality and voice of the original content\n- Use natural-sounding language that feels native to speakers of the target language\n- Don't translate the word \"token\" as it means something specific in English that all languages will understand\n\n# Technical Implementation\n- Use namespaces to organize translations logically\n- Handle pluralization using i18next's built-in capabilities\n- Implement proper interpolation for variables using {{variable}} syntax\n- Don't include defaultValue. The `en` translations are the fallback.\n\n# Quality Assurance\n- Maintain consistent terminology across all translations\n- Respect the JSON structure of translation files\n- Watch for placeholders and preserve them in translations\n- Be mindful of text length in UI elements when translating to languages that might require more characters\n- Use context-aware translations when the same string has different meanings\n\n# Supported Languages\n- Localize all strings into the following locale files: ar, ca, cs, de, en, es, fr, hi, hu, it, ja, ko, pl, pt, pt-BR, ru, tr, zh-CN, zh-TW",
26+
"groups": [
27+
"read",
28+
[
29+
"edit",
30+
{
31+
"fileRegex": "(.*\\.(md|ts|tsx|js|jsx)$|.*\\.json$)",
32+
"description": "Source code, translation files, and documentation"
33+
}
34+
]
35+
],
36+
"source": "project"
2737
}
2838
]
2939
}

README.md

Lines changed: 16 additions & 16 deletions
Large diffs are not rendered by default.

src/core/mentions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export async function parseMentions(text: string, cwd: string, urlContentFetcher
104104
}
105105
} else if (mention === "problems") {
106106
try {
107-
const problems = getWorkspaceProblems(cwd)
107+
const problems = await getWorkspaceProblems(cwd)
108108
parsedText += `\n\n<workspace_diagnostics>\n${problems}\n</workspace_diagnostics>`
109109
} catch (error) {
110110
parsedText += `\n\n<workspace_diagnostics>\nError fetching diagnostics: ${error.message}\n</workspace_diagnostics>`

webview-ui/src/components/chat/AutoApproveMenu.tsx

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
22
import { useCallback, useState } from "react"
33
import { useExtensionState } from "../../context/ExtensionStateContext"
4+
import { useAppTranslation } from "../../i18n/TranslationContext"
45
import { vscode } from "../../utils/vscode"
56

67
interface AutoApproveAction {
@@ -38,63 +39,64 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
3839
setAutoApprovalEnabled,
3940
} = useExtensionState()
4041

42+
const { t } = useAppTranslation()
43+
4144
const actions: AutoApproveAction[] = [
4245
{
4346
id: "readFiles",
44-
label: "Read files and directories",
45-
shortName: "Read",
47+
label: t("chat:autoApprove.actions.readFiles.label"),
48+
shortName: t("chat:autoApprove.actions.readFiles.shortName"),
4649
enabled: alwaysAllowReadOnly ?? false,
47-
description: "Allows access to read any file on your computer.",
50+
description: t("chat:autoApprove.actions.readFiles.description"),
4851
},
4952
{
5053
id: "editFiles",
51-
label: "Edit files",
52-
shortName: "Edit",
54+
label: t("chat:autoApprove.actions.editFiles.label"),
55+
shortName: t("chat:autoApprove.actions.editFiles.shortName"),
5356
enabled: alwaysAllowWrite ?? false,
54-
description: "Allows modification of any files on your computer.",
57+
description: t("chat:autoApprove.actions.editFiles.description"),
5558
},
5659
{
5760
id: "executeCommands",
58-
label: "Execute approved commands",
59-
shortName: "Commands",
61+
label: t("chat:autoApprove.actions.executeCommands.label"),
62+
shortName: t("chat:autoApprove.actions.executeCommands.shortName"),
6063
enabled: alwaysAllowExecute ?? false,
61-
description:
62-
"Allows execution of approved terminal commands. You can configure this in the settings panel.",
64+
description: t("chat:autoApprove.actions.executeCommands.description"),
6365
},
6466
{
6567
id: "useBrowser",
66-
label: "Use the browser",
67-
shortName: "Browser",
68+
label: t("chat:autoApprove.actions.useBrowser.label"),
69+
shortName: t("chat:autoApprove.actions.useBrowser.shortName"),
6870
enabled: alwaysAllowBrowser ?? false,
69-
description: "Allows ability to launch and interact with any website in a headless browser.",
71+
description: t("chat:autoApprove.actions.useBrowser.description"),
7072
},
7173
{
7274
id: "useMcp",
73-
label: "Use MCP servers",
74-
shortName: "MCP",
75+
label: t("chat:autoApprove.actions.useMcp.label"),
76+
shortName: t("chat:autoApprove.actions.useMcp.shortName"),
7577
enabled: alwaysAllowMcp ?? false,
76-
description: "Allows use of configured MCP servers which may modify filesystem or interact with APIs.",
78+
description: t("chat:autoApprove.actions.useMcp.description"),
7779
},
7880
{
7981
id: "switchModes",
80-
label: "Switch modes",
81-
shortName: "Modes",
82+
label: t("chat:autoApprove.actions.switchModes.label"),
83+
shortName: t("chat:autoApprove.actions.switchModes.shortName"),
8284
enabled: alwaysAllowModeSwitch ?? false,
83-
description: "Allows automatic switching between different modes without requiring approval.",
85+
description: t("chat:autoApprove.actions.switchModes.description"),
8486
},
8587
{
8688
id: "subtasks",
87-
label: "Create & complete subtasks",
88-
shortName: "Subtasks",
89+
label: t("chat:autoApprove.actions.subtasks.label"),
90+
shortName: t("chat:autoApprove.actions.subtasks.shortName"),
8991
enabled: alwaysAllowSubtasks ?? false,
90-
description: "Allow creation and completion of subtasks without requiring approval.",
92+
description: t("chat:autoApprove.actions.subtasks.description"),
9193
},
9294
{
9395
id: "retryRequests",
94-
label: "Retry failed requests",
95-
shortName: "Retries",
96+
label: t("chat:autoApprove.actions.retryRequests.label"),
97+
shortName: t("chat:autoApprove.actions.retryRequests.shortName"),
9698
enabled: alwaysApproveResubmit ?? false,
97-
description: "Automatically retry failed API requests when the provider returns an error response.",
99+
description: t("chat:autoApprove.actions.retryRequests.description"),
98100
},
99101
]
100102

@@ -211,7 +213,7 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
211213
color: "var(--vscode-foreground)",
212214
flexShrink: 0,
213215
}}>
214-
Auto-approve:
216+
{t("chat:autoApprove.title")}
215217
</span>
216218
<span
217219
style={{
@@ -222,7 +224,7 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
222224
flex: 1,
223225
minWidth: 0,
224226
}}>
225-
{enabledActionsList || "None"}
227+
{enabledActionsList || t("chat:autoApprove.none")}
226228
</span>
227229
<span
228230
className={`codicon codicon-chevron-${isExpanded ? "down" : "right"}`}
@@ -241,8 +243,7 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
241243
color: "var(--vscode-descriptionForeground)",
242244
fontSize: "12px",
243245
}}>
244-
Auto-approve allows Roo Code to perform actions without asking for permission. Only enable for
245-
actions you fully trust.
246+
{t("chat:autoApprove.description")}
246247
</div>
247248
{actions.map((action) => (
248249
<div key={action.id} style={{ margin: "6px 0" }}>

webview-ui/src/components/chat/ChatTextArea.tsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import Thumbnails from "../common/Thumbnails"
2020
import { convertToMentionPath } from "../../utils/path-mentions"
2121
import { MAX_IMAGES_PER_MESSAGE } from "./ChatView"
2222
import ContextMenu from "./ContextMenu"
23+
import { useAppTranslation } from "../../i18n/TranslationContext"
2324

2425
interface ChatTextAreaProps {
2526
inputValue: string
@@ -56,6 +57,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
5657
},
5758
ref,
5859
) => {
60+
const { t } = useAppTranslation()
5961
const { filePaths, openedTabs, currentApiConfigName, listApiConfigMeta, customModes, cwd } = useExtensionState()
6062
const [gitCommits, setGitCommits] = useState<any[]>([])
6163
const [showDropdown, setShowDropdown] = useState(false)
@@ -133,12 +135,11 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
133135
}
134136
vscode.postMessage(message)
135137
} else {
136-
const promptDescription =
137-
"The 'Enhance Prompt' button helps improve your prompt by providing additional context, clarification, or rephrasing. Try typing a prompt in here and clicking the button again to see how it works."
138+
const promptDescription = t("chat:enhancePromptDescription")
138139
setInputValue(promptDescription)
139140
}
140141
}
141-
}, [inputValue, textAreaDisabled, setInputValue])
142+
}, [inputValue, textAreaDisabled, setInputValue, t])
142143

143144
const queryItems = useMemo(() => {
144145
return [
@@ -475,7 +476,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
475476
const reader = new FileReader()
476477
reader.onloadend = () => {
477478
if (reader.error) {
478-
console.error("Error reading file:", reader.error)
479+
console.error(t("chat:errorReadingFile"), reader.error)
479480
resolve(null)
480481
} else {
481482
const result = reader.result
@@ -490,11 +491,11 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
490491
if (dataUrls.length > 0) {
491492
setSelectedImages((prevImages) => [...prevImages, ...dataUrls].slice(0, MAX_IMAGES_PER_MESSAGE))
492493
} else {
493-
console.warn("No valid images were processed")
494+
console.warn(t("chat:noValidImages"))
494495
}
495496
}
496497
},
497-
[shouldDisableImages, setSelectedImages, cursorPosition, setInputValue, inputValue],
498+
[shouldDisableImages, setSelectedImages, cursorPosition, setInputValue, inputValue, t],
498499
)
499500

500501
const handleThumbnailsHeightChange = useCallback((height: number) => {
@@ -611,7 +612,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
611612
const reader = new FileReader()
612613
reader.onloadend = () => {
613614
if (reader.error) {
614-
console.error("Error reading file:", reader.error)
615+
console.error(t("chat:errorReadingFile"), reader.error)
615616
resolve(null)
616617
} else {
617618
const result = reader.result
@@ -634,7 +635,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
634635
})
635636
}
636637
} else {
637-
console.warn("No valid images were processed")
638+
console.warn(t("chat:noValidImages"))
638639
}
639640
}
640641
}}
@@ -779,7 +780,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
779780
<SelectDropdown
780781
value={mode}
781782
disabled={textAreaDisabled}
782-
title="Select mode for interaction"
783+
title={t("chat:selectMode")}
783784
options={[
784785
// Add the shortcut text as a disabled option at the top
785786
{
@@ -797,13 +798,13 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
797798
// Add separator
798799
{
799800
value: "sep-1",
800-
label: "Separator",
801+
label: t("chat:separator"),
801802
type: DropdownOptionType.SEPARATOR,
802803
},
803804
// Add Edit option
804805
{
805806
value: "promptsButtonClicked",
806-
label: "Edit...",
807+
label: t("chat:edit"),
807808
type: DropdownOptionType.ACTION,
808809
},
809810
]}
@@ -829,7 +830,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
829830
<SelectDropdown
830831
value={currentApiConfigName || ""}
831832
disabled={textAreaDisabled}
832-
title="Select API configuration"
833+
title={t("chat:selectApiConfig")}
833834
options={[
834835
// Add all API configurations
835836
...(listApiConfigMeta || []).map((config) => ({
@@ -840,13 +841,13 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
840841
// Add separator
841842
{
842843
value: "sep-2",
843-
label: "Separator",
844+
label: t("chat:separator"),
844845
type: DropdownOptionType.SEPARATOR,
845846
},
846847
// Add Edit option
847848
{
848849
value: "settingsButtonClicked",
849-
label: "Edit...",
850+
label: t("chat:edit"),
850851
type: DropdownOptionType.ACTION,
851852
},
852853
]}
@@ -886,7 +887,7 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
886887
role="button"
887888
aria-label="enhance prompt"
888889
data-testid="enhance-prompt-button"
889-
title="Enhance prompt with additional context"
890+
title={t("chat:enhancePrompt")}
890891
className={`input-icon-button ${
891892
textAreaDisabled ? "disabled" : ""
892893
} codicon codicon-sparkle`}
@@ -899,13 +900,13 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
899900
className={`input-icon-button ${
900901
shouldDisableImages ? "disabled" : ""
901902
} codicon codicon-device-camera`}
902-
title="Add images to message"
903+
title={t("chat:addImages")}
903904
onClick={() => !shouldDisableImages && onSelectImages()}
904905
style={{ fontSize: 16.5 }}
905906
/>
906907
<span
907908
className={`input-icon-button ${textAreaDisabled ? "disabled" : ""} codicon codicon-send`}
908-
title="Send message"
909+
title={t("chat:sendMessage")}
909910
onClick={() => !textAreaDisabled && onSend()}
910911
style={{ fontSize: 15 }}
911912
/>

0 commit comments

Comments
 (0)