diff --git a/README.md b/README.md index e69de29b..aeac0362 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,138 @@ +# Cline-Chinese (Cline中文汉化版) 🌏 + +> 🎉 截止到2026.5.1,Cline Chinese在VS Code插件市场的下载量突破224k啦!感谢大家的支持! + + + + +

+ +[![MCP市场](https://img.shields.io/badge/MCP%E5%B8%82%E5%9C%BA-访问-blue)](https://www.mcp-home.com/) [![Cline Chinese文档](https://img.shields.io/badge/Cline%20Chinese-文档-blue)](https://hybridtalentcomputing.gitbook.io/cline-chinese-doc/) [![Discord](https://img.shields.io/badge/Discord-加入讨论-7289DA)](https://discord.gg/fhj9hqy89t) [![Version](https://img.shields.io/visual-studio-marketplace/v/HybridTalentComputing.cline-chinese)](https://marketplace.visualstudio.com/items?itemName=HybridTalentComputing.cline-chinese) [![Downloads](https://img.shields.io/visual-studio-marketplace/d/HybridTalentComputing.cline-chinese)](https://marketplace.visualstudio.com/items?itemName=HybridTalentComputing.cline-chinese) [![Rating](https://img.shields.io/visual-studio-marketplace/r/HybridTalentComputing.cline-chinese)](https://marketplace.visualstudio.com/items?itemName=HybridTalentComputing.cline-chinese) + +

+ +## 项目地址 +https://github.com/HybridTalentComputing/cline-chinese +欢迎大家star,fork,提出issue,贡献代码,一起完善这个项目。 + +## 文档(感谢[@flyfreee](https://github.com/flyfreee)的翻译工作) +https://hybridtalentcomputing.gitbook.io/cline-chinese-doc/ + +## Supremum(更适合Vibe Coding的AI终端) +https://github.com/HybridTalentComputing/Supremum +如果您也在使用Claude Code/Codex 等CLI工具, 不妨看看我这个新项目。 + + + +## 赞助商 +胜算云 + + +## 功能展示 + + + + +## 安装使用 +Cline-Chinese已发布到VSCode插件市场,欢迎感兴趣的小伙伴们下载体验。 + +## 简介 + +这个项目是基于 [Cline](https://github.com/cline/cline) 的汉化版本。旨在优化由于英文 prompt 导致 Cline 在中文输入下+国产大模型(如:deepseek)表现不佳的问题, 并提供更符合中文用户习惯的UI界面和功能。目前已测试[DeepSeek-R1/DeepSeek-V3](https://github.com/deepseek-ai/DeepSeek-R1)工作良好。 + +日常使用cline等编程助手时发现使用某些模型推理速度较慢(如deepseek-R1, Claude-3.5-Sonnet),这个项目优先尝试在中文输入下,对轻量化LLM进行实验(如Deepseek-R1-Distill-Qwen-7B/14B),优化中文prompt, 以提升推理速度,大大减少等待的时间。 + + + +## 背景 + +本人是一名AI从业者+爱好者,在使用Cline时,发现Cline的UI界面和提示词均为英文,使用中文输入时,有时会出现奇奇怪怪的输出,影响体验。因此,决定自己动手,汉化Cline。 +另外,秉着学习的态度,未来将着手修改Cline的核心代码,增加新的功能,以提升体验。 + +## 特色功能 +1. 支持Dify Provider (已受cline官方支持,欢迎体验) + +## 版本更新说明 +## 2026.02.08 (ver.3.46.9) +修复defaultChatParticipant报错问题 + +## 2026.01.31 (ver.3.46.7) +1.修复https代理失效的问题 +2.修复胜算云登录及模型无法使用问题 +3.修复“claude code xxx” 报错问题 + +### 2026.01.28(ver.3.46.6) +修复openai compatible生成效果异常的问题 + +### 2026.01.23(ver.3.46.5) +1. 同步近期cline更新。 + +### 2025.08.25(ver.3.25.2) +1. 同步近期cline更新。(上下文压缩,添加claude code provider) + +### 2025.06.17(ver.3.17.11) + 1. 同步近期cline更新。 + 2. 接入胜算云. + +### 2025.05.19(ver.3.16.1) + 1. 同步近期cline更新。 + + +### 2025.04.01(ver.3.8.4) + + 1. Cline Chinese特色功能:新增Dify Provider,感谢@lofyer,代码来自:https://github.com/lofyer/cline-dify/tree/main + 2. 合入cline 3.8新增特性和问题修复: + 关键特性: + 1. 添加到 Cline:在任何文件或终端中右键单击选定的文本,以快速将上下文添加到您当前的任务中!此外,当您看到灯泡图标时,选择“使用Cline 修复”让 Cline 修复您代码中的错误。 + 2. 更快的推理:Cline/OpenRouter用户可以按吞吐量、价格和延迟对使用的底层提供商进行排序。按吞吐量排序将输出更快的生成结果(成本更高)。 + 3. 增强的 MCP 支持:支持 GIF 的动态图像加载,以及一个新的删除按钮来清理失败的服务器。 + 4. 近期新增模型支持,如gemini 2.5 pro, Deepseek-V3-0324,claude 3.7 sonnet-thinking. + +## 欢迎关注我的自媒体账号 + +欢迎关注我的自媒体账号,获取更多AI开发和技术分享: + +- 微信公众号:Leo的AI世界 + +## 加入社群 + +感兴趣的可以扫码加入微信社群,一起交流学习AI(如果二维码失效,请查看github项目中的首页中,相同位置的群二维码, 或者加入Discord频道): + +
+ 微信群二维码 +
+ +GitHub 项目地址:https://github.com/HybridTalentComputing/cline-chinese + +Discord 频道:https://discord.gg/fhj9hqy89t + + +## 免责声明 + +1. **使用风险**:本项目是一个开源的VSCode插件,用户在使用过程中可能会遇到的任何问题或风险,开发者不承担任何责任。 + +2. **数据安全**:本插件不会收集或存储任何用户数据。但在使用过程中,用户应注意保护自己的敏感信息和代码安全。 + +3. **知识产权**: + - 本项目是基于Cline的汉化版本,原版权归属于Cline团队。 + - 汉化部分的内容采用与原版Cline相同的Apache-2.0许可证。 + - 用户在使用过程中应遵守相关的开源协议。 + +4. **免责声明**: + - 本项目不提供任何明示或暗示的保证,包括但不限于适销性和特定用途适用性的保证。 + - 开发者不对任何直接或间接损失负责,包括但不限于利润损失、数据丢失等。 + - 用户使用本插件即表示同意承担使用过程中的所有风险。 + +5. **更新和维护**: + - 开发者将努力维护本项目,但不保证及时更新或修复所有问题。 + - 本项目可能随时变更或终止,会及时同步到本项目中。 + +6. **合规使用**: + - 用户在使用本插件时,必须遵守当地法律法规。 + - **严禁将本插件用于任何违法违规行为**(包括但不限于网络攻击、非法侵入、数据窃取、传播非法信息等)。 + - 开发者对用户利用本插件进行的任何违法行为及其产生的后果不承担任何法律责任。 +--- + +> 注:本项目是个人维护的汉化版本,与原版 Cline 团队无关。如果您喜欢这个项目,也请给原版 [Cline](https://github.com/cline/cline) 一个 star ⭐️ + + diff --git a/package.json b/package.json index 4b4ce727..374b1e2a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "claude-dev", - "displayName": "Cline", - "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.", + "name": "cline-chinese", + "displayName": "Cline Chinese", + "description": "%cline.description%", "version": "3.86.1", "icon": "assets/icons/icon.png", "workspaces": [ @@ -11,15 +11,15 @@ "vscode": "^1.84.0" }, "author": { - "name": "Cline Bot Inc." + "name": "HybridTalentComputing" }, "license": "Apache-2.0", - "publisher": "saoudrizwan", + "publisher": "HybridTalentComputing", "repository": { "type": "git", - "url": "https://github.com/cline/cline" + "url": "https://github.com/HybridTalentComputing/cline-chinese" }, - "homepage": "https://cline.bot", + "homepage": "https://github.com/HybridTalentComputing/cline-chinese", "categories": [ "AI", "Chat", @@ -62,45 +62,45 @@ "walkthroughs": [ { "id": "ClineWalkthrough", - "title": "Meet Cline, your new coding partner", - "description": "Cline codes like a developer because it thinks like one. Here are 5 ways to put it to work:", + "title": "%cline.walkthrough.title%", + "description": "%cline.walkthrough.description%", "steps": [ { "id": "welcome", - "title": "Start with a Goal, Not Just a Prompt", - "description": "Tell Cline what you want to achieve. It plans, asks, and then codes, like a true partner.", + "title": "%cline.walkthrough.step1.title%", + "description": "%cline.walkthrough.step1.description%", "media": { "markdown": "walkthrough/step1.md" } }, { "id": "learn", - "title": "Let Cline Learn Your Codebase", - "description": "Point Cline to your project. It builds understanding to make smart, context-aware changes.", + "title": "%cline.walkthrough.step2.title%", + "description": "%cline.walkthrough.step2.description%", "media": { "markdown": "walkthrough/step2.md" } }, { "id": "advanced-features", - "title": "Always Use the Best AI Models", - "description": "Cline empowers you with State-of-the-Art AI, connecting to top models (Anthropic, Gemini, OpenAI & more).", + "title": "%cline.walkthrough.step3.title%", + "description": "%cline.walkthrough.step3.description%", "media": { "markdown": "walkthrough/step3.md" } }, { "id": "mcp", - "title": "Extend with Powerful Tools (MCP)", - "description": "Connect to databases, APIs, or discover new capabilities in the MCP Marketplace.", + "title": "%cline.walkthrough.step4.title%", + "description": "%cline.walkthrough.step4.description%", "media": { "markdown": "walkthrough/step4.md" } }, { "id": "getting-started", - "title": "You're Always in Control", - "description": "Review Cline's plans and diffs. Approve changes before they happen. No surprises.", + "title": "%cline.walkthrough.step5.title%", + "description": "%cline.walkthrough.step5.description%", "media": { "markdown": "walkthrough/step5.md" }, @@ -133,115 +133,115 @@ "commands": [ { "command": "cline.plusButtonClicked", - "title": "New Task", + "title": "%cline.command.newTask%", "icon": "$(add)" }, { "command": "cline.mcpButtonClicked", - "title": "MCP Servers", + "title": "%cline.command.mcpServers%", "icon": "$(server)" }, { "command": "cline.historyButtonClicked", - "title": "History", + "title": "%cline.command.history%", "icon": "$(history)" }, { "command": "cline.accountButtonClicked", - "title": "Account", + "title": "%cline.command.account%", "icon": "$(account)" }, { "command": "cline.settingsButtonClicked", - "title": "Settings", + "title": "%cline.command.settings%", "icon": "$(settings-gear)" }, { "command": "cline.dev.createTestTasks", - "title": "Create Test Tasks", + "title": "%cline.command.createTestTasks%", "category": "Cline", "when": "cline.isDevMode" }, { "command": "cline.dev.expireMcpOAuthTokens", - "title": "Expire MCP OAuth Tokens (for testing)", + "title": "%cline.command.expireMcpOAuthTokens%", "category": "Cline", "when": "cline.isDevMode" }, { "command": "cline.addToChat", - "title": "Add to Cline", + "title": "%cline.command.addToChat%", "category": "Cline" }, { "command": "cline.addTerminalOutputToChat", - "title": "Add to Cline", + "title": "%cline.command.addTerminalToChat%", "category": "Cline" }, { "command": "cline.focusChatInput", - "title": "Jump to Chat Input", + "title": "%cline.command.focusChatInput%", "category": "Cline" }, { "command": "cline.generateGitCommitMessage", - "title": "Generate Commit Message with Cline", + "title": "%cline.command.generateCommitMessage%", "category": "Cline", "icon": "$(cline-icon)" }, { "command": "cline.abortGitCommitMessage", - "title": "Generate Commit Message with Cline - Stop", + "title": "%cline.command.abortCommitMessage%", "category": "Cline", "icon": "$(debug-stop)" }, { "command": "cline.explainCode", - "title": "Explain with Cline", + "title": "%cline.command.explainCode%", "category": "Cline" }, { "command": "cline.improveCode", - "title": "Improve with Cline", + "title": "%cline.command.improveCode%", "category": "Cline" }, { "command": "cline.jupyterGenerateCell", - "title": "Generate Jupyter Cell with Cline", + "title": "%cline.command.jupyterGenerate%", "category": "Cline", "icon": "$(sparkle)" }, { "command": "cline.jupyterExplainCell", - "title": "Explain Jupyter Cell with Cline", + "title": "%cline.command.jupyterExplain%", "category": "Cline", "icon": "$(question)" }, { "command": "cline.jupyterImproveCell", - "title": "Improve Jupyter Cell with Cline", + "title": "%cline.command.jupyterImprove%", "category": "Cline", "icon": "$(lightbulb)" }, { "command": "cline.openWalkthrough", - "title": "Open Walkthrough", + "title": "%cline.command.openWalkthrough%", "category": "Cline" }, { "command": "cline.reconstructTaskHistory", - "title": "Reconstruct Task History", + "title": "%cline.command.reconstructHistory%", "category": "Cline" }, { "command": "cline.reviewComment.reply", - "title": "Reply", + "title": "%cline.command.reply%", "category": "Cline", "enablement": "!commentIsEmpty" }, { "command": "cline.reviewComment.addToChat", - "title": "Add to Cline Chat", + "title": "%cline.command.addToChat%", "category": "Cline", "icon": "$(link-external)" } diff --git a/src/core/task/index.ts b/src/core/task/index.ts index 95e75771..f195d552 100644 --- a/src/core/task/index.ts +++ b/src/core/task/index.ts @@ -59,7 +59,7 @@ import { combineApiRequests } from "@shared/combineApiRequests" import { combineCommandSequences } from "@shared/combineCommandSequences" import { ClineApiReqCancelReason, ClineApiReqInfo, ClineAsk, ClineMessage, ClineSay } from "@shared/ExtensionMessage" import { HistoryItem } from "@shared/HistoryItem" -import { DEFAULT_LANGUAGE_SETTINGS, getLanguageKey, LanguageDisplay } from "@shared/Languages" +import { getLanguageKey, LanguageDisplay } from "@shared/Languages" import { USER_CONTENT_TAGS } from "@shared/messages/constants" import { convertClineMessageToProto } from "@shared/proto-conversions/cline-message" import { ClineDefaultTool, READ_ONLY_TOOLS } from "@shared/tools" @@ -1882,9 +1882,31 @@ export class Task { const supportsBrowserUse = modelSupportsBrowserUse && !disableBrowserTool // only enable browser use if the model supports it and the user hasn't disabled it const preferredLanguageRaw = this.stateManager.getGlobalSettingsKey("preferredLanguage") const preferredLanguage = getLanguageKey(preferredLanguageRaw as LanguageDisplay) + const languageInstructionMap: Record = { + "zh-CN": "Simplified Chinese (简体中文)", + "zh-TW": "Traditional Chinese (繁體中文)", + ja: "Japanese (日本語)", + ko: "Korean (한국어)", + fr: "French (Français)", + de: "German (Deutsch)", + es: "Spanish (Español)", + "pt-BR": "Brazilian Portuguese (Português Brasileiro)", + "pt-PT": "Portuguese (Português)", + it: "Italian (Italiano)", + ru: "Russian (Русский)", + ar: "Arabic (العربية)", + hi: "Hindi (हिन्दी)", + cs: "Czech (Čeština)", + hu: "Hungarian (Magyar)", + pl: "Polish (Polski)", + tr: "Turkish (Türkçe)", + en: "English", + } const preferredLanguageInstructions = - preferredLanguage && preferredLanguage !== DEFAULT_LANGUAGE_SETTINGS - ? `# Preferred Language\n\nSpeak in ${preferredLanguage}.` + preferredLanguage && preferredLanguage !== "en" + ? `# Preferred Language + +Speak in ${languageInstructionMap[preferredLanguage] || preferredLanguage}.` : "" const { globalToggles, localToggles } = await refreshClineRulesToggles(this.controller, this.cwd) diff --git a/src/shared/Languages.ts b/src/shared/Languages.ts index 8b933ccc..06a08426 100644 --- a/src/shared/Languages.ts +++ b/src/shared/Languages.ts @@ -38,7 +38,7 @@ export type LanguageDisplay = | "Traditional Chinese - 繁體中文" | "Turkish - Türkçe" -export const DEFAULT_LANGUAGE_SETTINGS: LanguageKey = "en" +export const DEFAULT_LANGUAGE_SETTINGS: LanguageKey = "zh-CN" export const languageOptions: { key: LanguageKey; display: LanguageDisplay }[] = [ { key: "en", display: "English" }, diff --git a/webview-ui/package-lock.json b/webview-ui/package-lock.json index 1ef0047f..b9d2a48f 100644 --- a/webview-ui/package-lock.json +++ b/webview-ui/package-lock.json @@ -33,12 +33,14 @@ "framer-motion": "^12.7.4", "fuse.js": "^7.0.0", "fzf": "^0.5.2", + "i18next": "^24.2.2", "lucide-react": "^0.511.0", "mermaid": "11.12.3", "posthog-js": "^1.224.0", "pretty-bytes": "^6.1.1", "react": "^18.3.1", "react-dom": "^18.3.1", + "react-i18next": "^15.4.1", "react-markdown": "^10.1.0", "react-remark": "^2.1.0", "react-textarea-autosize": "^8.5.7", @@ -9008,6 +9010,15 @@ "dev": true, "license": "MIT" }, + "node_modules/html-parse-stringify": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", + "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", + "license": "MIT", + "dependencies": { + "void-elements": "3.1.0" + } + }, "node_modules/html-url-attributes": { "version": "3.0.1", "license": "MIT", @@ -9056,6 +9067,37 @@ "version": "1.1.0", "license": "BSD-3-Clause" }, + "node_modules/i18next": { + "version": "24.2.3", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-24.2.3.tgz", + "integrity": "sha512-lfbf80OzkocvX7nmZtu7nSTNbrTYR52sLWxPtlXX1zAhVw8WEnFk4puUkCR4B1dNQwbSpEHHHemcZu//7EcB7A==", + "funding": [ + { + "type": "individual", + "url": "https://locize.com" + }, + { + "type": "individual", + "url": "https://locize.com/i18next.html" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + } + ], + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.26.10" + }, + "peerDependencies": { + "typescript": "^5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "license": "MIT", @@ -12019,6 +12061,32 @@ "react": "^18.3.1" } }, + "node_modules/react-i18next": { + "version": "15.7.4", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.7.4.tgz", + "integrity": "sha512-nyU8iKNrI5uDJch0z9+Y5XEr34b0wkyYj3Rp+tfbahxtlswxSCjcUL9H0nqXo9IR3/t5Y5PKIA3fx3MfUyR9Xw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.27.6", + "html-parse-stringify": "^3.0.1" + }, + "peerDependencies": { + "i18next": ">= 23.4.0", + "react": ">= 16.8.0", + "typescript": "^5" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, "node_modules/react-is": { "version": "17.0.2", "dev": true, @@ -13486,7 +13554,7 @@ }, "node_modules/typescript": { "version": "5.9.2", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -14033,6 +14101,15 @@ "dev": true, "license": "MIT" }, + "node_modules/void-elements": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", + "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/vscode-jsonrpc": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", diff --git a/webview-ui/package.json b/webview-ui/package.json index 231951ad..7b36a214 100644 --- a/webview-ui/package.json +++ b/webview-ui/package.json @@ -45,8 +45,10 @@ "mermaid": "11.12.3", "posthog-js": "^1.224.0", "pretty-bytes": "^6.1.1", + "i18next": "^24.2.2", "react": "^18.3.1", "react-dom": "^18.3.1", + "react-i18next": "^15.4.1", "react-markdown": "^10.1.0", "react-remark": "^2.1.0", "react-textarea-autosize": "^8.5.7", diff --git a/webview-ui/src/components/account/AccountView.tsx b/webview-ui/src/components/account/AccountView.tsx index 26efb4b4..4d2e0d05 100644 --- a/webview-ui/src/components/account/AccountView.tsx +++ b/webview-ui/src/components/account/AccountView.tsx @@ -5,6 +5,7 @@ import { EmptyRequest } from "@shared/proto/cline/common" import { VSCodeButton, VSCodeDivider, VSCodeDropdown, VSCodeOption, VSCodeTag } from "@vscode/webview-ui-toolkit/react" import deepEqual from "fast-deep-equal" import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useInterval } from "react-use" import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip" import { type ClineUser, handleSignOut } from "@/context/ClineAuthContext" @@ -43,11 +44,12 @@ type CachedData = { const ClineEnvOptions = ["Production", "Staging", "Local"] as const const AccountView = ({ onDone, clineUser, organizations, activeOrganization }: AccountViewProps) => { + const { t } = useTranslation("settings") const { environment } = useExtensionState() return (
- +
{clineUser?.uid ? ( { + const { t } = useTranslation("settings") const { email, displayName, appBaseUrl, uid } = clineUser const { remoteConfigSettings, environment } = useExtensionState() @@ -338,11 +341,11 @@ export const ClineAccountView = ({ clineUser, userOrganizations, activeOrganizat {activeOrganization && ( - + {getMainRole(activeOrganization.roles)} )} @@ -390,7 +393,7 @@ export const ClineAccountView = ({ clineUser, userOrganizations, activeOrganizat {isClineTester && environment !== "selfHosted" && (
-
Cline Environment
+
{t("account.clineEnvironment")}
// export const AccountWelcomeView = () => { + const { t } = useTranslation("settings") const { environment } = useExtensionState() const { isLoginLoading, handleSignIn } = useClineSignIn() @@ -14,23 +16,21 @@ export const AccountWelcomeView = () => {
-

- Sign up for an account to get access to the latest models, billing dashboard to view usage and credits, and more - upcoming features. -

+

{t("account.signUpDescription")}

Sign up with Cline {isLoginLoading && ( - + )}

- By continuing, you agree to the Terms of Service and{" "} - Privacy Policy. + {t("account.agreeToTerms")} {t("account.termsOfService")}{" "} + {t("settingsSections.privacyPolicy").replace("privacy policy", "")}{" "} + {t("account.privacyPolicyAnd")}

) diff --git a/webview-ui/src/components/account/CreditBalance.tsx b/webview-ui/src/components/account/CreditBalance.tsx index 613e0dca..cfb62d5c 100644 --- a/webview-ui/src/components/account/CreditBalance.tsx +++ b/webview-ui/src/components/account/CreditBalance.tsx @@ -1,4 +1,5 @@ import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" +import { useTranslation } from "react-i18next" import VSCodeButtonLink from "../common/VSCodeButtonLink" import { StyledCreditDisplay } from "./StyledCreditDisplay" @@ -11,11 +12,14 @@ type CreditBalanceProps = { } export const CreditBalance = ({ balance, fetchCreditBalance, creditUrl, lastFetchTime, isLoading }: CreditBalanceProps) => { + const { t } = useTranslation("settings") return (
-
CURRENT BALANCE
+
+ {t("account.currentBalance")} +
{balance === null ? ---- : } @@ -24,7 +28,7 @@ export const CreditBalance = ({ balance, fetchCreditBalance, creditUrl, lastFetc className={`mt-1 ${isLoading ? "animate-spin" : ""}`} disabled={isLoading} onClick={fetchCreditBalance}> - +
diff --git a/webview-ui/src/components/account/RemoteConfigToggle.tsx b/webview-ui/src/components/account/RemoteConfigToggle.tsx index aa1132fa..b87bb9c5 100644 --- a/webview-ui/src/components/account/RemoteConfigToggle.tsx +++ b/webview-ui/src/components/account/RemoteConfigToggle.tsx @@ -1,11 +1,13 @@ import { UpdateSettingsRequest, UserOrganization } from "@shared/proto/index.cline" import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react" import { useRef } from "react" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { StateServiceClient } from "@/services/grpc-client" import { isAdminOrOwner } from "./helpers" export function RemoteConfigToggle({ activeOrganization }: { activeOrganization: UserOrganization | null }) { + const { t } = useTranslation("settings") const { optOutOfRemoteConfig } = useExtensionState() const hadOptedOutOfRemoteConfig = useRef(optOutOfRemoteConfig) diff --git a/webview-ui/src/components/account/StyledCreditDisplay.tsx b/webview-ui/src/components/account/StyledCreditDisplay.tsx index d610643b..1e2c5c2b 100644 --- a/webview-ui/src/components/account/StyledCreditDisplay.tsx +++ b/webview-ui/src/components/account/StyledCreditDisplay.tsx @@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from "react" import { formatCreditsBalance } from "@/utils/format" // Custom hook for animated credit display with styled decimals -const useAnimatedCredits = (targetValue: number, duration: number = 660) => { +const useAnimatedCredits = (targetValue: number, duration = 660) => { const [currentValue, setCurrentValue] = useState(0) const animationRef = useRef() const startTimeRef = useRef() diff --git a/webview-ui/src/components/browser/BrowserSettingsMenu.tsx b/webview-ui/src/components/browser/BrowserSettingsMenu.tsx index 72e06d05..71dfb650 100644 --- a/webview-ui/src/components/browser/BrowserSettingsMenu.tsx +++ b/webview-ui/src/components/browser/BrowserSettingsMenu.tsx @@ -1,6 +1,7 @@ import { EmptyRequest } from "@shared/proto/cline/common" import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import { useEffect, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { BrowserServiceClient } from "../../services/grpc-client" @@ -11,6 +12,7 @@ interface ConnectionInfo { } export const BrowserSettingsMenu = () => { + const { t } = useTranslation("misc") const { browserSettings, navigateToSettings } = useExtensionState() const containerRef = useRef(null) const [showInfoPopover, setShowInfoPopover] = useState(false) @@ -92,20 +94,19 @@ export const BrowserSettingsMenu = () => { const getIconClass = () => { if (connectionInfo.isRemote) { return "codicon-remote" - } else { - return connectionInfo.isConnected ? "codicon-vm-running" : "codicon-info" } + return connectionInfo.isConnected ? "codicon-vm-running" : "codicon-info" } // Determine icon color based on connection state const getIconColor = () => { if (connectionInfo.isRemote) { return connectionInfo.isConnected ? "var(--vscode-charts-blue)" : "var(--vscode-foreground)" - } else if (connectionInfo.isConnected) { - return "var(--vscode-charts-green)" - } else { - return "var(--vscode-foreground)" } + if (connectionInfo.isConnected) { + return "var(--vscode-charts-green)" + } + return "var(--vscode-foreground)" } // Check connection status every second to keep icon in sync using gRPC @@ -140,7 +141,7 @@ export const BrowserSettingsMenu = () => { className="browser-info-icon" onClick={toggleInfoPopover} style={{ marginRight: "4px" }} - title="Browser connection info"> + title={t("browser.connectionInfo")}> { border: "1px solid var(--vscode-widget-border)", boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)", }}> -

Browser Connection

+

{t("browser.browserConnection")}

{/* InfoRow - Status row container */}
{/* InfoLabel - Fixed-width label */} -
Status:
+
{t("browser.status")}
{/* InfoValue - Flexible value container */}
{ ? "var(--vscode-charts-green)" : "var(--vscode-errorForeground)", }}> - {connectionInfo.isConnected ? "Connected" : "Disconnected"} + {connectionInfo.isConnected ? t("browser.connected") : t("browser.disconnected")}
{connectionInfo.isConnected && ( // InfoRow - Type row container
{/* InfoLabel - Fixed-width label */} -
Type:
+
{t("browser.type")}
{/* InfoValue - Flexible value container */} -
{connectionInfo.isRemote ? "Remote" : "Local"}
+
+ {connectionInfo.isRemote ? t("browser.remote") : t("browser.local")} +
)} {connectionInfo.isConnected && connectionInfo.isRemote && connectionInfo.host && ( // InfoRow - Remote host row container
{/* InfoLabel - Fixed-width label */} -
Remote Host:
+
{t("browser.remoteHost")}
{/* InfoValue - Flexible value container */}
{connectionInfo.host}
diff --git a/webview-ui/src/components/chat/BrowserSessionRow.tsx b/webview-ui/src/components/chat/BrowserSessionRow.tsx index 2a449cf4..4728f6d9 100644 --- a/webview-ui/src/components/chat/BrowserSessionRow.tsx +++ b/webview-ui/src/components/chat/BrowserSessionRow.tsx @@ -5,6 +5,7 @@ import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import deepEqual from "fast-deep-equal" import { ChevronDownIcon, ChevronRightIcon } from "lucide-react" import React, { CSSProperties, memo, useCallback, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useSize } from "react-use" import styled from "styled-components" import { BrowserSettingsMenu } from "@/components/browser/BrowserSettingsMenu" @@ -107,6 +108,8 @@ const headerStyle: CSSProperties = { const BrowserSessionRow = memo((props: BrowserSessionRowProps) => { const { messages, isLast, onHeightChange, lastModifiedMessage, onSetQuote } = props const { browserSettings } = useExtensionState() + tconst + t = useTranslation("common") const prevHeightRef = useRef(0) const [maxActionHeight, setMaxActionHeight] = useState(0) const [consoleLogsExpanded, setConsoleLogsExpanded] = useState(false) @@ -305,7 +308,7 @@ const BrowserSessionRow = memo((props: BrowserSessionRowProps) => { ) useEffect(() => { - if (actionHeight === 0 || actionHeight === Infinity) { + if (actionHeight === 0 || actionHeight === Number.POSITIVE_INFINITY) { return } if (actionHeight > maxActionHeight) { @@ -357,10 +360,10 @@ const BrowserSessionRow = memo((props: BrowserSessionRowProps) => { {isBrowsing && !isLastMessageResume ? ( ) : ( - + )} - {isAutoApproved ? "Cline is using the browser:" : "Cline wants to use the browser:"} + {isAutoApproved ? t("browserSession.clineUsingBrowser") : t("browserSession.clineWantsBrowser")}
{ }}> {displayState.screenshot ? ( Browser screenshot FileServiceClient.openImage(StringRequest.create({ value: displayState.screenshot })).catch( (err) => console.error("Failed to open image:", err), @@ -417,8 +420,8 @@ const BrowserSessionRow = memo((props: BrowserSessionRowProps) => { @@ -440,10 +443,12 @@ const BrowserSessionRow = memo((props: BrowserSessionRowProps) => { padding: `9px 8px ${consoleLogsExpanded ? 0 : 8}px 8px`, }}> {consoleLogsExpanded ? : } - Console Logs + {t("browserSession.consoleLogs")}
{consoleLogsExpanded && ( - + )}
@@ -454,19 +459,17 @@ const BrowserSessionRow = memo((props: BrowserSessionRowProps) => { {/* Pagination moved to bottom */} {pages.length > 1 && (
-
- Step {currentPageIndex + 1} of {pages.length} -
+
{t("browserSession.step", { current: currentPageIndex + 1, total: pages.length })}
setCurrentPageIndex((i) => i - 1)}> - Previous + {t("browserSession.previous")} setCurrentPageIndex((i) => i + 1)}> - Next + {t("browserSession.next")}
@@ -479,7 +482,7 @@ const BrowserSessionRow = memo((props: BrowserSessionRowProps) => { // Height change effect useEffect(() => { const isInitialRender = prevHeightRef.current === 0 - if (isLast && height !== 0 && height !== Infinity && height !== prevHeightRef.current) { + if (isLast && height !== 0 && height !== Number.POSITIVE_INFINITY && height !== prevHeightRef.current) { if (!isInitialRender) { onHeightChange(height > prevHeightRef.current) } @@ -517,7 +520,7 @@ const BrowserSessionRowContent = memo( return ( <>
- Browser Session Started + {t("browserSession.sessionStarted")}
@@ -571,20 +574,21 @@ const BrowserSessionRowContent = memo( ) const BrowserActionBox = ({ action, coordinate, text }: { action: BrowserAction; coordinate?: string; text?: string }) => { + const { t } = useTranslation("common") const getBrowserActionText = (action: BrowserAction, coordinate?: string, text?: string) => { switch (action) { case "launch": - return `Launch browser at ${text}` + return t("browserSession.launchBrowser", { url: text }) case "click": - return `Click (${coordinate?.replace(",", ", ")})` + return t("browserSession.click", { coordinate: coordinate?.replace(",", ", ") }) case "type": - return `Type "${text}"` + return t("browserSession.type", { text }) case "scroll_down": - return "Scroll down" + return t("browserSession.scrollDown") case "scroll_up": - return "Scroll up" + return t("browserSession.scrollUp") case "close": - return "Close browser" + return t("browserSession.closeBrowser") default: return action } @@ -594,7 +598,7 @@ const BrowserActionBox = ({ action, coordinate, text }: { action: BrowserAction;
- Browse Action: + {t("browserSession.browseAction")} {getBrowserActionText(action, coordinate, text)}
diff --git a/webview-ui/src/components/chat/ChatErrorBoundary.tsx b/webview-ui/src/components/chat/ChatErrorBoundary.tsx index 083a0cce..5f071d9e 100644 --- a/webview-ui/src/components/chat/ChatErrorBoundary.tsx +++ b/webview-ui/src/components/chat/ChatErrorBoundary.tsx @@ -1,3 +1,4 @@ +import i18next from "i18next" import React from "react" interface ChatErrorBoundaryProps { @@ -47,8 +48,11 @@ export class ChatErrorBoundary extends React.Component -

{errorTitle || "Something went wrong displaying this content"}

-

{errorBody || `Error: ${this.state.error?.message || "Unknown error"}`}

+

{errorTitle || i18next.t("chatErrorBoundary.defaultTitle")}

+

+ {errorBody || + `${i18next.t("chatErrorBoundary.errorPrefix")}${this.state.error?.message || i18next.t("chatErrorBoundary.unknownError")}`} +

) } @@ -121,7 +125,10 @@ export class ErrorAfterDelay extends React.Component - Error in {this.state.tickCount}/{this.props.numSecondsToWait ?? 5} seconds + {i18next.t("chatErrorBoundary.errorIn", { + current: this.state.tickCount, + total: this.props.numSecondsToWait ?? 5, + })}
) } diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index bd380c00..5c1be3f0 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -37,6 +37,7 @@ import { TriangleAlertIcon, } from "lucide-react" import { MouseEvent, memo, useCallback, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useSize } from "react-use" import { OptionsButtons } from "@/components/chat/OptionsButtons" import { CheckmarkControl } from "@/components/common/CheckmarkControl" @@ -148,6 +149,7 @@ export const ChatRowContent = memo( reasoningContent, responseStarted, }: ChatRowContentProps) => { + const { t } = useTranslation("common") const { backgroundEditEnabled, mcpServers, @@ -315,17 +317,17 @@ export const ChatRowContent = memo( case "error": return [ , - Error, + {t("chatRow.error")}, ] case "mistake_limit_reached": return [ , - Cline is having trouble..., + {t("chatRow.mistakeLimit")}, ] case "command": return [ , - Cline wants to execute this command:, + {t("chatRow.wantsToExecute")}, ] case "use_mcp_server": const mcpServerUse = JSON.parse(message.text || "{}") as ClineAskUseMcpServer @@ -336,17 +338,20 @@ export const ChatRowContent = memo( ), - Cline wants to {mcpServerUse.type === "use_mcp_tool" ? "use a tool" : "access a resource"} on the{" "} + {mcpServerUse.type === "use_mcp_tool" + ? t("chatRow.wantsToUseTool") + : t("chatRow.wantsToAccessResource")}{" "} + {t("chatRow.onTheServer")}{" "} {getMcpServerDisplayName(mcpServerUse.serverName, mcpMarketplaceCatalog)} {" "} - MCP server: + {t("chatRow.mcpServer")} , ] case "completion_result": return [ , - Task Completed, + {t("chatRow.taskCompleted")}, ] case "api_req_started": // API request rows no longer render the request payload/cost accordion. @@ -355,7 +360,7 @@ export const ChatRowContent = memo( case "followup": return [ , - Cline has a question:, + {t("chatRow.hasQuestion")}, ] default: return [null, null] @@ -369,6 +374,7 @@ export const ChatRowContent = memo( apiReqCancelReason, isMcpServerResponding, message.text, + t, ]) const tool = useMemo(() => { @@ -404,7 +410,7 @@ export const ChatRowContent = memo( const names = conditionalRulesInfo.rules.map((r: { name: string }) => r.name).join(", ") return (
- Conditional rules applied: + {t("chatRow.conditionalRules")} {names}
) @@ -432,15 +438,13 @@ export const ChatRowContent = memo( case "editedExistingFile": const content = tool?.content || "" const isApplyingPatch = content?.startsWith("%%bash") && !content.endsWith("*** End Patch\nEOF") - const editToolTitle = isApplyingPatch - ? "Cline is creating patches to edit this file:" - : "Cline wants to edit this file:" + const editToolTitle = isApplyingPatch ? t("chatRow.creatingPatches") : t("chatRow.wantsToEdit") return (
{tool.operationIsLocatedInWorkspace === false && - toolIcon("sign-out", "yellow", -90, "This file is outside of your workspace")} + toolIcon("sign-out", "yellow", -90, t("chatRow.outsideWorkspace"))} {editToolTitle}
{backgroundEditEnabled && tool.path && tool.content ? ( @@ -467,8 +471,8 @@ export const ChatRowContent = memo(
{tool.operationIsLocatedInWorkspace === false && - toolIcon("sign-out", "yellow", -90, "This file is outside of your workspace")} - Cline wants to delete this file: + toolIcon("sign-out", "yellow", -90, t("chatRow.outsideWorkspace"))} + {t("chatRow.wantsToDelete")}
{tool.operationIsLocatedInWorkspace === false && - toolIcon("sign-out", "yellow", -90, "This file is outside of your workspace")} - Cline wants to create a new file: + toolIcon("sign-out", "yellow", -90, t("chatRow.outsideWorkspace"))} + {t("chatRow.wantsToCreate")}
{backgroundEditEnabled && tool.path && tool.content ? ( @@ -508,8 +512,8 @@ export const ChatRowContent = memo(
{isImage ? : } {tool.operationIsLocatedInWorkspace === false && - toolIcon("sign-out", "yellow", -90, "This file is outside of your workspace")} - Cline wants to read this file: + toolIcon("sign-out", "yellow", -90, t("chatRow.outsideWorkspace"))} + {t("chatRow.wantsToRead")}
{toolIcon("folder-opened")} {tool.operationIsLocatedInWorkspace === false && - toolIcon("sign-out", "yellow", -90, "This is outside of your workspace")} + toolIcon("sign-out", "yellow", -90, t("chatRow.outsideOfWorkspace"))} - {message.type === "ask" - ? "Cline wants to view the top level files in this directory:" - : "Cline viewed the top level files in this directory:"} + {message.type === "ask" ? t("chatRow.wantsToViewTopLevel") : t("chatRow.viewedTopLevel")}
{toolIcon("folder-opened")} {tool.operationIsLocatedInWorkspace === false && - toolIcon("sign-out", "yellow", -90, "This is outside of your workspace")} + toolIcon("sign-out", "yellow", -90, t("chatRow.outsideOfWorkspace"))} - {message.type === "ask" - ? "Cline wants to recursively view all files in this directory:" - : "Cline recursively viewed all files in this directory:"} + {message.type === "ask" ? t("chatRow.wantsToViewRecursive") : t("chatRow.viewedRecursive")}
{toolIcon("file-code")} {tool.operationIsLocatedInWorkspace === false && - toolIcon("sign-out", "yellow", -90, "This file is outside of your workspace")} + toolIcon("sign-out", "yellow", -90, t("chatRow.outsideWorkspace"))} {message.type === "ask" - ? "Cline wants to view source code definition names used in this directory:" - : "Cline viewed source code definition names used in this directory:"} + ? t("chatRow.wantsToViewDefinitions") + : t("chatRow.viewedDefinitions")}
{toolIcon("search")} {tool.operationIsLocatedInWorkspace === false && - toolIcon("sign-out", "yellow", -90, "This is outside of your workspace")} + toolIcon("sign-out", "yellow", -90, t("chatRow.outsideOfWorkspace"))} - Cline wants to search this directory for {tool.regex}: + {t("chatRow.wantsToSearch")} {tool.regex}:
- Cline is condensing the conversation: + {t("chatRow.condensing")}
{ @@ -648,7 +648,7 @@ export const ChatRowContent = memo( {isExpanded ? (
- Summary: + {t("chatRow.summary")}
@@ -672,11 +672,9 @@ export const ChatRowContent = memo(
{tool.operationIsLocatedInWorkspace === false && - toolIcon("sign-out", "yellow", -90, "This URL is external")} + toolIcon("sign-out", "yellow", -90, t("chatRow.urlExternal"))} - {message.type === "ask" - ? "Cline wants to fetch content from this URL:" - : "Cline fetched content from this URL:"} + {message.type === "ask" ? t("chatRow.wantsToFetch") : t("chatRow.fetched")}
{tool.operationIsLocatedInWorkspace === false && - toolIcon("sign-out", "yellow", -90, "This search is external")} + toolIcon("sign-out", "yellow", -90, t("chatRow.searchExternal"))} - {message.type === "ask" - ? "Cline wants to search the web for:" - : "Cline searched the web for:"} + {message.type === "ask" ? t("chatRow.wantsToSearchWeb") : t("chatRow.searchedWeb")}
@@ -720,7 +716,7 @@ export const ChatRowContent = memo(
- Cline loaded the skill: + {t("chatRow.loadedSkill")}
{tool.path} @@ -823,7 +819,7 @@ export const ChatRowContent = memo(
{useMcpServer.arguments && useMcpServer.arguments !== "{}" && (
-
Arguments
+
{t("chatRow.arguments")}
- MCP Notification: + {t("chatRow.mcpNotification")} {message.text}
@@ -908,7 +904,7 @@ export const ChatRowContent = memo( reasoningContent={message.text} showChevron={!isReasoningStreaming || hasReasoningText} showTitle={true} - title={isReasoningStreaming ? "Thinking..." : "Thinking"} + title={isReasoningStreaming ? t("chatRow.thinkingDots") : t("chatRow.thinking")} /> {isReasoningStreaming && showFeatureTips !== false && }
@@ -948,7 +944,7 @@ export const ChatRowContent = memo( return (
- Loading MCP documentation + {t("chatRow.loadingMcpDocs")}
) case "generate_explanation": { @@ -989,12 +985,12 @@ export const ChatRowContent = memo( )} {isGenerating - ? "Generating explanation" + ? t("chatRow.generatingExplanation") : isError - ? "Failed to generate explanation" + ? t("chatRow.failedExplanation") : wasCancelled - ? "Explanation cancelled" - : "Generated explanation"} + ? t("chatRow.explanationCancelled") + : t("chatRow.generatedExplanation")}
{isError && explanationInfo.error && ( @@ -1010,7 +1006,7 @@ export const ChatRowContent = memo( - {explanationInfo.toRef || "working directory"} + {explanationInfo.toRef || t("chatRow.workingDirectory")}
)} @@ -1042,17 +1038,20 @@ export const ChatRowContent = memo(
- Shell Integration Unavailable + + {t("chatRow.shellIntegrationUnavailable")} +
- Cline may have trouble viewing the command's output. Please update VSCode ( - CMD/CTRL + Shift + P → "Update") and make sure you're using a supported shell: - zsh, bash, fish, or PowerShell (CMD/CTRL + Shift + P → "Terminal: Select Default - Profile"). + {t("chatRow.shellIntegrationMessage")} + CMD/CTRL + Shift + P → {t("chatRow.shellIntegrationUpdate")}) and make sure + you're using a supported shell: zsh, bash, fish, or PowerShell ( + CMD/CTRL + Shift + P → {t("chatRow.shellIntegrationProfile")} + ). - Still having trouble? + {t("chatRow.shellIntegrationStillTrouble")}
@@ -1076,19 +1075,20 @@ export const ChatRowContent = memo( )} - {isFailed ? "Auto-Retry Failed" : "Auto-Retry in Progress"} + {isFailed ? t("chatRow.autoRetryFailed") : t("chatRow.autoRetryInProgress")}
{isFailed ? ( - Auto-retry failed after {maxAttempts} attempts. Manual - intervention required. + {t("chatRow.autoRetryFailedAfter")} {maxAttempts}{" "} + {t("chatRow.attempts")} ) : ( - Attempt {attempt} of {maxAttempts} - - Retrying in {delaySeconds} seconds... + {t("chatRow.attemptOf")} {attempt} {t("chatRow.of")}{" "} + {maxAttempts} -{t("chatRow.retryingIn")} {delaySeconds}{" "} + {t("chatRow.seconds")} )}
@@ -1116,11 +1116,10 @@ export const ChatRowContent = memo(
- Shell integration issues + {t("chatRow.shellIntegrationIssues")}
- Since you're experiencing repeated shell integration issues, we recommend switching to - Background Terminal mode for better reliability. + {t("chatRow.shellIntegrationRecommendation")}
) @@ -1244,7 +1243,7 @@ export const ChatRowContent = memo(
- Cline wants to start a new task: + {t("chatRow.wantsToStartNewTask")}
@@ -1254,7 +1253,7 @@ export const ChatRowContent = memo(
- Cline wants to condense your conversation: + {t("chatRow.wantsToCondense")}
@@ -1264,7 +1263,7 @@ export const ChatRowContent = memo(
- Cline wants to create a Github issue: + {t("chatRow.wantsToCreateIssue")}
diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index 3907a356..d2928958 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -8,6 +8,7 @@ import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import { AtSignIcon, PlusIcon } from "lucide-react" import type React from "react" import { forwardRef, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import DynamicTextArea from "react-textarea-autosize" import styled from "styled-components" import ContextMenu from "@/components/chat/ContextMenu" @@ -224,6 +225,7 @@ const ChatTextArea = forwardRef( navigateToSettingsModelPicker, mcpServers, } = useExtensionState() + const { t } = useTranslation("common") const [isTextAreaFocused, setIsTextAreaFocused] = useState(false) const [isDraggingOver, setIsDraggingOver] = useState(false) const [gitCommits, setGitCommits] = useState([]) @@ -1372,12 +1374,12 @@ const ChatTextArea = forwardRef( onDrop={onDrop}> {showDimensionError && (
- Image dimensions exceed 7500px + {t("chat.imageDimensionError")}
)} {showUnsupportedFileError && (
- Files other than images are currently disabled + {t("chat.unsupportedFileError")}
)} {showSlashCommandsMenu && ( @@ -1512,7 +1514,7 @@ const ChatTextArea = forwardRef( /> {!inputValue && selectedImages.length === 0 && selectedFiles.length === 0 && (
- Type @ for context, / for slash commands & workflows, hold shift to drag in files/images + {t("chat.contextHint")}
)} {(selectedImages.length > 0 || selectedFiles.length > 0) && ( @@ -1555,11 +1557,11 @@ const ChatTextArea = forwardRef( {/* ButtonGroup - always in DOM but visibility controlled */} - Add Context + {t("chat.addContext")} @@ -1571,11 +1573,11 @@ const ChatTextArea = forwardRef( - Add Files & Images + {t("chat.addFilesImages")} ( onClick={handleModelButtonClick} role="button" tabIndex={0} - title="Open API Settings"> + title={t("chat.openApiSettings")}> {modelDisplayName} @@ -1615,15 +1617,21 @@ const ChatTextArea = forwardRef( className="text-xs px-2 flex flex-col gap-1" hidden={shownTooltipMode === null} side="top"> - {`In ${shownTooltipMode === "act" ? "Act" : "Plan"} mode, Cline will ${shownTooltipMode === "act" ? "complete the task immediately" : "gather information to architect a plan"}`} + {t("chat.planActTooltip", { + mode: shownTooltipMode === "act" ? t("chat.actMode") : t("chat.planMode"), + action: + shownTooltipMode === "act" + ? t("chat.planActTooltipActAction") + : t("chat.planActTooltipPlanAction"), + })}

- Toggle w/ {togglePlanActKeys} + {t("chat.planActTooltipToggle", { keys: togglePlanActKeys })}

- {["Plan", "Act"].map((m) => ( + {[t("chat.planMode"), t("chat.actMode")].map((m) => (
{ + const { t } = useTranslation("common") const showNavbar = useShowNavbar() const { version, @@ -325,9 +327,9 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie const scrollBehavior = useScrollBehavior(messages, visibleMessages, groupedMessages, expandedRows, setExpandedRows) const placeholderText = useMemo(() => { - const text = task ? "Type a message..." : "Type your task here..." + const text = task ? t("chat.typeMessage") : t("chat.typeTask") return text - }, [task]) + }, [task, t]) return ( diff --git a/webview-ui/src/components/chat/CommandOutputRow.tsx b/webview-ui/src/components/chat/CommandOutputRow.tsx index ddc29a9c..580cc7cd 100644 --- a/webview-ui/src/components/chat/CommandOutputRow.tsx +++ b/webview-ui/src/components/chat/CommandOutputRow.tsx @@ -2,6 +2,7 @@ import { COMMAND_OUTPUT_STRING, COMMAND_REQ_APP_STRING } from "@shared/combineCo import { ClineMessage } from "@shared/ExtensionMessage" import { StringRequest } from "@shared/proto/cline/common" import { memo, useEffect, useRef } from "react" +import { useTranslation } from "react-i18next" import { Button } from "@/components/ui/button" import { cn } from "@/lib/utils" import { FileServiceClient } from "@/services/grpc-client" @@ -46,7 +47,7 @@ export const CommandOutputContent = memo( } // Check if output contains a log file path indicator - const logFilePathMatch = output.match(/📋 Output is being logged to: ([^\n]+)/) + const logFilePathMatch = output.match(/📋 Output logged to ([^\n]+)/) const logFilePath = logFilePathMatch ? logFilePathMatch[1].trim() : null // Render output with clickable log file path @@ -56,7 +57,7 @@ export const CommandOutputContent = memo( } // Split output into parts: before log path, log path line, after log path - const logPathLineStart = output.indexOf("📋 Output is being logged to:") + const logPathLineStart = output.indexOf("📋 Output logged to") const logPathLineEnd = output.indexOf("\n", logPathLineStart) const beforeLogPath = output.substring(0, logPathLineStart) const afterLogPath = logPathLineEnd !== -1 ? output.substring(logPathLineEnd) : "" @@ -75,7 +76,7 @@ export const CommandOutputContent = memo( ) }} title={`Click to open: ${logFilePath}`}> - 📋 Output is being logged to: + 📋 {t("commandOutput.outputLoggedTo")} {fileName}
{afterLogPath && } @@ -130,6 +131,7 @@ export const CommandOutputRow = memo( isOutputFullyExpanded: boolean setIsOutputFullyExpanded: (expanded: boolean) => void }) => { + const { t } = useTranslation("common") const splitMessage = (text: string) => { const outputIndex = text.indexOf(COMMAND_OUTPUT_STRING) if (outputIndex === -1) { @@ -214,7 +216,7 @@ export const CommandOutputRow = memo( }} size="sm" variant="secondary"> - {isBackgroundExec ? "cancel" : "stop"} + {isBackgroundExec ? t("commandOutput.cancel") : t("commandOutput.stop")} )}
@@ -237,7 +239,7 @@ export const CommandOutputRow = memo( {requestsApproval && (
- The model has determined this command requires explicit approval. + {t("commandOutput.requiresApproval")}
)} @@ -247,14 +249,14 @@ export const CommandOutputRow = memo( CommandOutputRow.displayName = "CommandOutputRow" -const CommandStatusMap = { - executing: "Running", - pending: "Pending", - completed: "Completed", - skipped: "Skipped", -} - function getCommandStatusText(isExecuting: boolean, isPending: boolean, isCompleted: boolean): string { + const { t } = useTranslation("common") + const CommandStatusMap = { + executing: t("commandOutput.running"), + pending: t("commandOutput.pending"), + completed: t("commandOutput.completed"), + skipped: t("commandOutput.skipped"), + } if (isExecuting) { return CommandStatusMap.executing } diff --git a/webview-ui/src/components/chat/CompletionOutputRow.tsx b/webview-ui/src/components/chat/CompletionOutputRow.tsx index a81f7081..995d0beb 100644 --- a/webview-ui/src/components/chat/CompletionOutputRow.tsx +++ b/webview-ui/src/components/chat/CompletionOutputRow.tsx @@ -1,13 +1,14 @@ -import { memo } from "react" -import { cn } from "@/lib/utils" -import { MarkdownRow } from "./MarkdownRow" import { Int64Request } from "@shared/proto/cline/common" import { CheckIcon } from "lucide-react" +import { memo } from "react" +import { useTranslation } from "react-i18next" import { PLATFORM_CONFIG, PlatformType } from "@/config/platform.config" +import { cn } from "@/lib/utils" import { TaskServiceClient } from "@/services/grpc-client" import { CopyButton } from "../common/CopyButton" import SuccessButton from "../common/SuccessButton" import { QuoteButtonState } from "./ChatRow" +import { MarkdownRow } from "./MarkdownRow" import QuoteButton from "./QuoteButton" interface CompletionOutputRowProps { @@ -36,6 +37,7 @@ export const CompletionOutputRow = memo( messageTs, handleQuoteClick, }: CompletionOutputRowProps) => { + const { t } = useTranslation("common") return (
@@ -43,7 +45,7 @@ export const CompletionOutputRow = memo(
- Task Completed + {t("completionOutput.taskCompleted")}
@@ -88,6 +90,7 @@ const CompletionOutputActionRow = memo( setExplainChangesDisabled: (value: boolean) => void messageTs: number }) => { + const { t } = useTranslation("common") return (
- {explainChangesDisabled ? "Explaining..." : "Explain Changes"} + {explainChangesDisabled ? t("completionOutput.explainingChanges") : t("completionOutput.explainChanges")} )}
diff --git a/webview-ui/src/components/chat/ContextMenu.tsx b/webview-ui/src/components/chat/ContextMenu.tsx index c82b7cb9..742c6029 100644 --- a/webview-ui/src/components/chat/ContextMenu.tsx +++ b/webview-ui/src/components/chat/ContextMenu.tsx @@ -95,10 +95,10 @@ const ContextMenu: React.FC = ({ // Shared label definitions for simple option types const SIMPLE_OPTION_LABELS: Partial> = { - [ContextMenuOptionType.Problems]: "Problems", - [ContextMenuOptionType.Terminal]: "Terminal", - [ContextMenuOptionType.URL]: "Paste URL to fetch contents", - [ContextMenuOptionType.NoResults]: "No results found", + [ContextMenuOptionType.Problems]: t("contextMenu.problems"), + [ContextMenuOptionType.Terminal]: t("contextMenu.terminal"), + [ContextMenuOptionType.URL]: t("contextMenu.pasteUrl"), + [ContextMenuOptionType.NoResults]: t("contextMenu.noResults"), } // Get accessible label for an option (used for screen readers and aria-label) @@ -114,13 +114,13 @@ const ContextMenu: React.FC = ({ if (option.value) { return `${option.label}${option.description ? `, ${option.description}` : ""}` } - return "Git Commits" + return t("contextMenu.gitCommits") case ContextMenuOptionType.File: case ContextMenuOptionType.Folder: if (option.value) { return option.label || option.value } - return `Add ${option.type === ContextMenuOptionType.File ? "File" : "Folder"}` + return option.type === ContextMenuOptionType.File ? t("contextMenu.addFile") : t("contextMenu.addFolder") default: return option.label || option.value || "" } @@ -156,7 +156,7 @@ const ContextMenu: React.FC = ({
) } - return Git Commits + return {t("contextMenu.gitCommits")} case ContextMenuOptionType.File: case ContextMenuOptionType.Folder: if (option.value) { @@ -182,7 +182,11 @@ const ContextMenu: React.FC = ({ ) } - return Add {option.type === ContextMenuOptionType.File ? "File" : "Folder"} + return ( + + {option.type === ContextMenuOptionType.File ? t("contextMenu.addFile") : t("contextMenu.addFolder")} + + ) default: return null } @@ -251,7 +255,7 @@ const ContextMenu: React.FC = ({ ? `context-menu-item-${selectedIndex}` : undefined } - aria-label="Context mentions" + aria-label={t("contextMenu.ariaLabel")} ref={menuRef} role="listbox" style={{ @@ -276,7 +280,7 @@ const ContextMenu: React.FC = ({ opacity: 0.7, }}> - Searching... + {t("contextMenu.searching")}
)} {filteredOptions.map((option, index) => { diff --git a/webview-ui/src/components/chat/CreditLimitError.tsx b/webview-ui/src/components/chat/CreditLimitError.tsx index b1d19d1f..4612f3e5 100644 --- a/webview-ui/src/components/chat/CreditLimitError.tsx +++ b/webview-ui/src/components/chat/CreditLimitError.tsx @@ -1,6 +1,7 @@ import { AskResponseRequest } from "@shared/proto/cline/task" import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import React, { useEffect, useMemo, useState } from "react" +import { useTranslation } from "react-i18next" import VSCodeButtonLink from "@/components/common/VSCodeButtonLink" import { useClineAuth } from "@/context/ClineAuthContext" import { AccountServiceClient, TaskServiceClient } from "@/services/grpc-client" @@ -19,12 +20,13 @@ const DEFAULT_BUY_CREDITS_URL = { } const CreditLimitError: React.FC = ({ - message = "You have run out of credits.", + message, buyCreditsUrl, currentBalance, totalPromotions, totalSpent, }) => { + const { t } = useTranslation("common") const { activeOrganization } = useClineAuth() const [fullBuyCreditsUrl, setFullBuyCreditsUrl] = useState("") @@ -52,23 +54,32 @@ const CreditLimitError: React.FC = ({ return (
-
{message}
+
{message || t("creditLimit.defaultMessage")}
{currentBalance ? (
- Current Balance: {currentBalance.toFixed(2)} + {t("creditLimit.currentBalance")} + {currentBalance.toFixed(2)} +
+ ) : null} + {totalSpent ? ( +
+ {t("creditLimit.totalSpent")} + {totalSpent.toFixed(2)}
) : null} - {totalSpent ?
Total Spent: {totalSpent.toFixed(2)}
: null} {totalPromotions ? ( -
Total Promotions: {totalPromotions.toFixed(2)}
+
+ {t("creditLimit.totalPromotions")} + {totalPromotions.toFixed(2)} +
) : null}
- Buy Credits + {t("creditLimit.buyCredits")} = ({ } }}> - Retry Request + {t("creditLimit.retryRequest")}
) diff --git a/webview-ui/src/components/chat/DiffEditRow.tsx b/webview-ui/src/components/chat/DiffEditRow.tsx index adb5bd21..041853a5 100644 --- a/webview-ui/src/components/chat/DiffEditRow.tsx +++ b/webview-ui/src/components/chat/DiffEditRow.tsx @@ -1,6 +1,7 @@ import { StringRequest } from "@shared/proto/cline/common" import { FilePlus, FileText, FileX, SquareArrowOutUpRightIcon } from "lucide-react" import { memo, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { cn } from "@/lib/utils" import { FileServiceClient } from "@/services/grpc-client" @@ -37,6 +38,8 @@ interface DiffEditRowProps { } export const DiffEditRow = memo(({ patch, path, isLoading, startLineNumbers }) => { + tconst + t = useTranslation("common") const { parsedFiles, isStreaming } = useMemo(() => { const parsed = parsePatch(patch, path) return { @@ -148,7 +151,7 @@ const FileBlock = memo<{ file: Patch; isStreaming: boolean; startLineNumber?: nu + title={t("diffEdit.openFileInEditor")}> {file.path}
@@ -158,7 +161,7 @@ const FileBlock = memo<{ file: Patch; isStreaming: boolean; startLineNumber?: nu + title={t("diffEdit.openFileInEditor")}> diff --git a/webview-ui/src/components/chat/ErrorBlockTitle.tsx b/webview-ui/src/components/chat/ErrorBlockTitle.tsx index 11e458ff..95827d5d 100644 --- a/webview-ui/src/components/chat/ErrorBlockTitle.tsx +++ b/webview-ui/src/components/chat/ErrorBlockTitle.tsx @@ -15,11 +15,11 @@ interface ErrorBlockTitleProps { } export const ErrorBlockTitle = ({ - cost, apiReqCancelReason, apiRequestFailedMessage, retryStatus, }: ErrorBlockTitleProps): [React.ReactElement, React.ReactElement] => { + const { t } = useTranslation("common") const getIconSpan = (iconName: string, colorClass: string) => (
@@ -43,31 +43,31 @@ export const ErrorBlockTitle = ({ const title = (() => { // Default loading state - const details = { title: "API Request...", classNames: ["font-bold"] } + const details = { title: t("errorBlock.apiRequestLoading"), classNames: ["font-bold"] } // Handle cancellation states first if (apiReqCancelReason === "user_cancelled") { - details.title = "API Request Cancelled" + details.title = t("errorBlock.apiRequestCancelled") details.classNames.push("text-(--vscode-foreground)") } else if (apiReqCancelReason != null) { - details.title = "API Request Failed" + details.title = t("errorBlock.apiRequestFailed") details.classNames.push("text-(--vscode-errorForeground)") } else if (cost != null) { // Handle completed request - details.title = "API Request" + details.title = t("errorBlock.apiRequest") details.classNames.push("text-(--vscode-foreground)") } else if (apiRequestFailedMessage) { // Handle failed request const clineError = ClineError.parse(apiRequestFailedMessage) const titleText = clineError?.isErrorType(ClineErrorType.Balance) - ? "Credit Limit Reached" + ? t("errorBlock.creditLimitReached") : clineError?.isErrorType(ClineErrorType.SpendLimit) - ? "Spend Limit Reached" - : "API Request Failed" + ? t("errorBlock.spendLimitReached") + : t("errorBlock.apiRequestFailed") details.title = titleText details.classNames.push("font-bold text-(--vscode-errorForeground)") } else if (retryStatus) { // Handle retry state - details.title = "API Request" + details.title = t("errorBlock.apiRequest") details.classNames.push("text-(--vscode-foreground)") } diff --git a/webview-ui/src/components/chat/ErrorRow.tsx b/webview-ui/src/components/chat/ErrorRow.tsx index c2c807d3..3bed9abe 100644 --- a/webview-ui/src/components/chat/ErrorRow.tsx +++ b/webview-ui/src/components/chat/ErrorRow.tsx @@ -1,5 +1,6 @@ import { ClineMessage } from "@shared/ExtensionMessage" import { memo } from "react" +import { useTranslation } from "react-i18next" import CreditLimitError from "@/components/chat/CreditLimitError" import SpendLimitError from "@/components/chat/SpendLimitError" import { Button } from "@/components/ui/button" @@ -16,6 +17,8 @@ interface ErrorRowProps { } const ErrorRow = memo(({ message, errorType, apiRequestFailedMessage, apiReqStreamingFailedMessage }: ErrorRowProps) => { + tconst + t = useTranslation("common") const { clineUser } = useClineAuth() const rawApiError = apiRequestFailedMessage || apiReqStreamingFailedMessage @@ -80,7 +83,7 @@ const ErrorRow = memo(({ message, errorType, apiRequestFailedMessage, apiReqStre // User is using Cline provider and is not logged in
- Whoops looks like you're logged out – click below to sign in + {t("error.loggedOut")}
) diff --git a/webview-ui/src/components/chat/HookMessage.tsx b/webview-ui/src/components/chat/HookMessage.tsx index dcbc7917..f5ddae54 100644 --- a/webview-ui/src/components/chat/HookMessage.tsx +++ b/webview-ui/src/components/chat/HookMessage.tsx @@ -1,6 +1,7 @@ import { ClineMessage } from "@shared/ExtensionMessage" import { EmptyRequest } from "@shared/proto/cline/common" import { memo, useMemo, useState } from "react" +import { useTranslation } from "react-i18next" import { TaskServiceClient } from "@/services/grpc-client" import { CHAT_ROW_EXPANDED_BG_COLOR } from "../common/CodeBlock" import { HOOK_OUTPUT_STRING } from "./constants" @@ -81,6 +82,8 @@ interface HookMetadata { * - Running hooks: Always shows pending tool info */ const HookMessage = memo(({ message, CommandOutput }: HookMessageProps) => { + tconst + t = useTranslation("common") // Parse hook metadata and output const { metadata, output } = useMemo(() => { const splitMessage = (text: string) => { @@ -147,8 +150,9 @@ const HookMessage = memo(({ message, CommandOutput }: HookMessageProps) => { style={{ color: normalColor, marginBottom: "-1.5px", - }}>
- Hook: + }} + /> + {t("hookMessage.hook")} {metadata.hookName} {metadata.toolName && ( ({metadata.toolName}) @@ -258,7 +262,7 @@ const HookMessage = memo(({ message, CommandOutput }: HookMessageProps) => { fontSize: "13px", color: "var(--vscode-descriptionForeground)", }}> - Took longer than 30 seconds. Check for infinite loops or add timeouts to network requests. + t("hookMessage.timeoutError")
)} @@ -270,7 +274,7 @@ const HookMessage = memo(({ message, CommandOutput }: HookMessageProps) => { fontSize: "13px", color: "var(--vscode-descriptionForeground)", }}> - Hook returned invalid JSON. See error details below for more information. + t("hookMessage.validationError") )} diff --git a/webview-ui/src/components/chat/NewTaskPreview.tsx b/webview-ui/src/components/chat/NewTaskPreview.tsx index 378bee5f..96af1cfa 100644 --- a/webview-ui/src/components/chat/NewTaskPreview.tsx +++ b/webview-ui/src/components/chat/NewTaskPreview.tsx @@ -6,9 +6,11 @@ interface NewTaskPreviewProps { } const NewTaskPreview: React.FC = ({ context }) => { + tconst + t = useTranslation("common") return (
- Task + {t("newTaskPreview.task")}
) diff --git a/webview-ui/src/components/chat/PlanCompletionOutputRow.tsx b/webview-ui/src/components/chat/PlanCompletionOutputRow.tsx index b6c2af9e..908bf276 100644 --- a/webview-ui/src/components/chat/PlanCompletionOutputRow.tsx +++ b/webview-ui/src/components/chat/PlanCompletionOutputRow.tsx @@ -1,5 +1,6 @@ import { NotepadTextIcon } from "lucide-react" import { memo } from "react" +import { useTranslation } from "react-i18next" import { CopyButton } from "@/components/common/CopyButton" import MarkdownBlock from "@/components/common/MarkdownBlock" import { cn } from "@/lib/utils" @@ -15,13 +16,15 @@ interface PlanCompletionOutputProps { * Uses grayscale colors to distinguish from Act Mode's green success theme */ const PlanCompletionOutputRow = memo(({ text, headClassNames }: PlanCompletionOutputProps) => { + tconst + t = useTranslation("common") return (
{/* Header */}
- Plan Created + {t("planCompletion.planCreated")}
diff --git a/webview-ui/src/components/chat/QuoteButton.tsx b/webview-ui/src/components/chat/QuoteButton.tsx index 1ce7f8dc..462a4360 100644 --- a/webview-ui/src/components/chat/QuoteButton.tsx +++ b/webview-ui/src/components/chat/QuoteButton.tsx @@ -21,18 +21,20 @@ const ButtonContainer = styled.div` ` const QuoteButton: React.FC = ({ top, left, onClick }) => { + tconst + t = useTranslation("common") return ( // Pass transient props to the styled component diff --git a/webview-ui/src/components/chat/QuotedMessagePreview.tsx b/webview-ui/src/components/chat/QuotedMessagePreview.tsx index 235ddfe6..1a3876a1 100644 --- a/webview-ui/src/components/chat/QuotedMessagePreview.tsx +++ b/webview-ui/src/components/chat/QuotedMessagePreview.tsx @@ -70,16 +70,18 @@ interface QuotedMessagePreviewProps { } const QuotedMessagePreview: React.FC = ({ text, onDismiss, isFocused }) => { + tconst + t = useTranslation("common") const _cardClassName = `reply-card ${isFocused ? "reply-card--focused" : ""}` return ( {/* Removed Label */} - + {text} - - + + diff --git a/webview-ui/src/components/chat/ReportBugPreview.tsx b/webview-ui/src/components/chat/ReportBugPreview.tsx index 17ccfedc..335c6b8a 100644 --- a/webview-ui/src/components/chat/ReportBugPreview.tsx +++ b/webview-ui/src/components/chat/ReportBugPreview.tsx @@ -6,6 +6,8 @@ interface ReportBugPreviewProps { } const ReportBugPreview: React.FC = ({ data }) => { + tconst + t = useTranslation("common") // Parse the JSON data from the context string const bugData = React.useMemo(() => { try { @@ -18,61 +20,61 @@ const ReportBugPreview: React.FC = ({ data }) => { return (
-

{bugData.title || "Bug Report"}

+

{bugData.title || t("reportBug.title")}

{bugData.what_happened && (
-
What Happened?
+
{t("reportBug.whatHappened")}
)} {bugData.steps_to_reproduce && (
-
Steps to Reproduce
+
{t("reportBug.stepsToReproduce")}
)} {bugData.api_request_output && (
-
Relevant API Request Output
+
{t("reportBug.apiOutput")}
)} {bugData.provider_and_model && (
-
Provider/Model
+
{t("reportBug.providerModel")}
)} {bugData.operating_system && (
-
Operating System
+
{t("reportBug.operatingSystem")}
)} {bugData.system_info && (
-
System Info
+
{t("reportBug.systemInfo")}
)} {bugData.cline_version && (
-
Cline Version
+
{t("reportBug.clineVersion")}
)} {bugData.additional_context && (
-
Additional Context
+
{t("reportBug.additionalContext")}
)} diff --git a/webview-ui/src/components/chat/RequestStartRow.tsx b/webview-ui/src/components/chat/RequestStartRow.tsx index 4324136a..23f1b226 100644 --- a/webview-ui/src/components/chat/RequestStartRow.tsx +++ b/webview-ui/src/components/chat/RequestStartRow.tsx @@ -42,10 +42,10 @@ const getActivityText = (tool: ClineSayTool): string | null => { const cleanedPath = cleanPathPrefix(tool.path || "") switch (tool.tool) { case "readFile": - return tool.path ? `Reading ${cleanedPath}...` : null + return tool.path ? t("requestStart.reading", { path: cleanPathPrefix(tool.path || "") }) : null case "listFilesTopLevel": case "listFilesRecursive": - return tool.path ? `Exploring ${cleanedPath}/...` : null + return tool.path ? t("requestStart.exploring", { path: cleanedPath }) : null case "searchFiles": return tool.regex && tool.path ? `Searching ${formatSearchRegex(tool.regex, tool.path, tool.filePattern)}...` : null case "listCodeDefinitionNames": diff --git a/webview-ui/src/components/chat/SearchResultsDisplay.tsx b/webview-ui/src/components/chat/SearchResultsDisplay.tsx index 4eabdb81..4e10035e 100644 --- a/webview-ui/src/components/chat/SearchResultsDisplay.tsx +++ b/webview-ui/src/components/chat/SearchResultsDisplay.tsx @@ -90,7 +90,7 @@ const SearchResultsDisplay: React.FC = ({ border: "1px solid var(--vscode-editorGroup-border)", }}>
{ if (e.key === "Enter" || e.key === " ") { @@ -121,7 +121,7 @@ const SearchResultsDisplay: React.FC = ({ }}> {path + (filePattern ? `/(${filePattern})` : "")} -
+
{isExpanded ? ( ) : ( @@ -162,7 +162,8 @@ const SearchResultsDisplay: React.FC = ({ style={{ fontSize: "14px", color: "var(--vscode-symbolIcon-folderForeground)", - }}> + }} + /> { + tconst + t = useTranslation("common") const { mcpServers, navigateToMcp, setMcpServers } = useExtensionState() const [isVisible, setIsVisible] = useState(false) const buttonRef = useRef(null) @@ -55,11 +58,11 @@ const ServersToggleModal: React.FC = () => {
- {!isVisible && Manage MCP Servers} + {!isVisible && {t("serversToggle.manage")}} setIsVisible(!isVisible)}> @@ -72,15 +75,15 @@ const ServersToggleModal: React.FC = () => {
-
MCP Servers
+
{t("serversToggle.title")}
{ setIsVisible(false) navigateToMcp("configure") }}> - +
diff --git a/webview-ui/src/components/chat/SlashCommandMenu.tsx b/webview-ui/src/components/chat/SlashCommandMenu.tsx index ed951a1f..4b2dbf27 100644 --- a/webview-ui/src/components/chat/SlashCommandMenu.tsx +++ b/webview-ui/src/components/chat/SlashCommandMenu.tsx @@ -1,8 +1,8 @@ import type { McpServer } from "@shared/mcp" -import type { SlashCommand } from "@/utils/slash-commands" import React, { useCallback, useEffect, useRef } from "react" import ScreenReaderAnnounce from "@/components/common/ScreenReaderAnnounce" import { useMenuAnnouncement } from "@/hooks/useMenuAnnouncement" +import type { SlashCommand } from "@/utils/slash-commands" import { getMatchingSlashCommands } from "@/utils/slash-commands" interface SlashCommandMenuProps { @@ -131,25 +131,32 @@ const SlashCommandMenu: React.FC = ({
0 ? `slash-command-menu-item-${selectedIndex}` : undefined} - aria-label="Slash commands" + aria-label={t("slashCommandMenu.ariaLabel")} className="bg-(--vscode-dropdown-background) border border-(--vscode-editorGroup-border) rounded-[3px] shadow-[0_4px_10px_rgba(0,0,0,0.25)] flex flex-col overflow-y-auto" ref={menuRef} role="listbox" style={{ maxHeight: "min(200px, calc(50vh))", overscrollBehavior: "contain" }}> {filteredCommands.length > 0 ? ( <> - {renderCommandSection(defaultCommands, "Default Commands", 0, true)} - {renderCommandSection(workflowCommands, "Workflow Commands", defaultCommands.length, false)} + {renderCommandSection(defaultCommands, t("slashCommandMenu.defaultCommands"), 0, true)} + {renderCommandSection( + workflowCommands, + t("slashCommandMenu.workflowCommands"), + defaultCommands.length, + false, + )} {renderCommandSection( mcpCommands, - "MCP Prompts", + t("slashCommandMenu.mcpPrompts"), defaultCommands.length + workflowCommands.length, true, )} ) : (
-
No matching commands found
+
+ {t("slashCommandMenu.noMatching")} +
)}
diff --git a/webview-ui/src/components/chat/SpendLimitError.tsx b/webview-ui/src/components/chat/SpendLimitError.tsx index 88e48b3d..67654a33 100644 --- a/webview-ui/src/components/chat/SpendLimitError.tsx +++ b/webview-ui/src/components/chat/SpendLimitError.tsx @@ -1,5 +1,6 @@ import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import React, { useEffect, useState } from "react" +import { useTranslation } from "react-i18next" import { AccountServiceClient } from "@/services/grpc-client" const COOLDOWN_MS = 5 * 60 * 1000 // 5 minutes @@ -37,6 +38,8 @@ interface SpendLimitErrorProps { } const SpendLimitError: React.FC = ({ message, budgetPeriod, limitUsd, spentUsd, resetsAt }) => { + tconst + t = useTranslation("common") const displayMessage = limitUsd != null && budgetPeriod ? `$${limitUsd.toFixed(2)} ${budgetPeriod} limit has been reached.` : message @@ -96,7 +99,7 @@ const SpendLimitError: React.FC = ({ message, budgetPeriod
{spentUsd != null && limitUsd != null && (
- {periodLabel ? `${periodLabel} usage` : "Usage"}:{" "} + {periodLabel ? `${periodLabel} ${t("spendLimit.usage")}` : t("spendLimit.usage")}:{" "} ${spentUsd.toFixed(2)} / ${limitUsd.toFixed(2)} @@ -111,7 +114,7 @@ const SpendLimitError: React.FC = ({ message, budgetPeriod
- Limits set by your organization. + {t("spendLimit.limitsByOrg")}
diff --git a/webview-ui/src/components/chat/SubagentStatusRow.tsx b/webview-ui/src/components/chat/SubagentStatusRow.tsx index af043edc..af445a48 100644 --- a/webview-ui/src/components/chat/SubagentStatusRow.tsx +++ b/webview-ui/src/components/chat/SubagentStatusRow.tsx @@ -16,6 +16,7 @@ import { NetworkIcon, } from "lucide-react" import { useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import MarkdownBlock from "../common/MarkdownBlock" interface SubagentStatusRowProps { @@ -120,6 +121,7 @@ function parseSubagentRowData(message: ClineMessage): SubagentRowData | null { } function SubagentPromptText({ prompt, isExpanded, onShowMore }: SubagentPromptTextProps) { + const { t } = useTranslation("common") const promptRef = useRef(null) const [showMoreVisible, setShowMoreVisible] = useState(false) @@ -160,7 +162,7 @@ function SubagentPromptText({ prompt, isExpanded, onShowMore }: SubagentPromptTe
{!isExpanded && showMoreVisible && (
diff --git a/webview-ui/src/components/chat/auto-approve-menu/AutoApproveBar.tsx b/webview-ui/src/components/chat/auto-approve-menu/AutoApproveBar.tsx index 917d275e..a88224dd 100644 --- a/webview-ui/src/components/chat/auto-approve-menu/AutoApproveBar.tsx +++ b/webview-ui/src/components/chat/auto-approve-menu/AutoApproveBar.tsx @@ -1,5 +1,6 @@ import { ChevronDownIcon, ChevronRightIcon } from "lucide-react" import { useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { getAsVar, VSC_TITLEBAR_INACTIVE_FOREGROUND } from "@/utils/vscStyles" import AutoApproveModal from "./AutoApproveModal" @@ -10,6 +11,8 @@ interface AutoApproveBarProps { } const AutoApproveBar = ({ style }: AutoApproveBarProps) => { + tconst + t = useTranslation("common") const { autoApprovalSettings, yoloModeToggled, navigateToSettings } = useExtensionState() const [isModalVisible, setIsModalVisible] = useState(false) @@ -47,7 +50,7 @@ const AutoApproveBar = ({ style }: AutoApproveBarProps) => { }) if (actionsToShow.length === 0) { - return None + return {t("autoApprove.none")} } return ( @@ -100,7 +103,7 @@ const AutoApproveBar = ({ style }: AutoApproveBarProps) => { />
-
Auto-approve: YOLO
+
{t("autoApprove.yolo")}
YOLO mode is enabled.{" "} @@ -144,7 +147,7 @@ const AutoApproveBar = ({ style }: AutoApproveBarProps) => { />
{ setIsModalVisible((prev) => !prev) @@ -159,7 +162,7 @@ const AutoApproveBar = ({ style }: AutoApproveBarProps) => { ref={buttonRef} tabIndex={0}>
- Auto-approve: + {t("autoApprove.label")} {getEnabledActionsText()}
{isModalVisible ? : } diff --git a/webview-ui/src/components/chat/auto-approve-menu/AutoApproveMenuItem.tsx b/webview-ui/src/components/chat/auto-approve-menu/AutoApproveMenuItem.tsx index 9ed1766c..e38c60ea 100644 --- a/webview-ui/src/components/chat/auto-approve-menu/AutoApproveMenuItem.tsx +++ b/webview-ui/src/components/chat/auto-approve-menu/AutoApproveMenuItem.tsx @@ -44,7 +44,7 @@ const AutoApproveMenuItem = ({ action, isChecked, onToggle, showIcon = true, dis
- {showIcon && } + {showIcon && } {action.label}
diff --git a/webview-ui/src/components/chat/auto-approve-menu/AutoApproveModal.tsx b/webview-ui/src/components/chat/auto-approve-menu/AutoApproveModal.tsx index 1b71525c..46e8ab63 100644 --- a/webview-ui/src/components/chat/auto-approve-menu/AutoApproveModal.tsx +++ b/webview-ui/src/components/chat/auto-approve-menu/AutoApproveModal.tsx @@ -1,5 +1,6 @@ import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react" import React, { useEffect, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useClickAway } from "react-use" import { useExtensionState } from "@/context/ExtensionStateContext" import { useAutoApproveActions } from "@/hooks/useAutoApproveActions" @@ -18,6 +19,7 @@ interface AutoApproveModalProps { } const AutoApproveModal: React.FC = ({ isVisible, setIsVisible, buttonRef, ACTION_METADATA }) => { + const { t } = useTranslation("common") const { autoApprovalSettings } = useExtensionState() const { isChecked, updateAction } = useAutoApproveActions() const modalRef = useRef(null) @@ -129,12 +131,10 @@ const AutoApproveModal: React.FC = ({ isVisible, setIsVis enableNotifications: checked, }) }}> - Enable notifications + {t("autoApprove.enableNotifications")}
-
- Notifications may show abbreviated tool details for safety and privacy. -
+
{t("autoApprove.notificationsDescription")}
) diff --git a/webview-ui/src/components/chat/chat-view/components/layout/ActionButtons.tsx b/webview-ui/src/components/chat/chat-view/components/layout/ActionButtons.tsx index 694ce241..71c95e31 100644 --- a/webview-ui/src/components/chat/chat-view/components/layout/ActionButtons.tsx +++ b/webview-ui/src/components/chat/chat-view/components/layout/ActionButtons.tsx @@ -132,7 +132,7 @@ export const ActionButtons: React.FC = ({
{ diff --git a/webview-ui/src/components/chat/chat-view/components/layout/WelcomeSection.tsx b/webview-ui/src/components/chat/chat-view/components/layout/WelcomeSection.tsx index ff05b6a4..512c1a24 100644 --- a/webview-ui/src/components/chat/chat-view/components/layout/WelcomeSection.tsx +++ b/webview-ui/src/components/chat/chat-view/components/layout/WelcomeSection.tsx @@ -4,6 +4,7 @@ import type { Worktree } from "@shared/proto/cline/worktree" import { TrackWorktreeViewOpenedRequest } from "@shared/proto/cline/worktree" import { GitBranch } from "lucide-react" import React, { useCallback, useEffect, useMemo, useState } from "react" +import { useTranslation } from "react-i18next" import BannerCarousel from "@/components/common/BannerCarousel" import WhatsNewModal from "@/components/common/WhatsNewModal" import HistoryPreview from "@/components/history/HistoryPreview" @@ -31,6 +32,7 @@ export const WelcomeSection: React.FC = ({ taskHistory, shouldShowQuickWins, }) => { + const { t } = useTranslation("common") const { lastDismissedInfoBannerVersion, lastDismissedCliBannerVersion, lastDismissedModelBannerVersion, dismissedBanners } = useExtensionState() @@ -295,7 +297,7 @@ export const WelcomeSection: React.FC = ({
- Current:{" "} + {t("taskHeader.currentBranch")}{" "} {currentWorktree.branch || "detached HEAD"}
@@ -304,9 +306,7 @@ export const WelcomeSection: React.FC = ({ - - View and manage git worktrees. Great for running parallel Cline tasks. - + {t("taskHeader.viewManageWorktrees")} )}
diff --git a/webview-ui/src/components/chat/chat-view/components/messages/ToolGroupRenderer.tsx b/webview-ui/src/components/chat/chat-view/components/messages/ToolGroupRenderer.tsx index fb9f2b3f..2edb01c8 100644 --- a/webview-ui/src/components/chat/chat-view/components/messages/ToolGroupRenderer.tsx +++ b/webview-ui/src/components/chat/chat-view/components/messages/ToolGroupRenderer.tsx @@ -1,5 +1,6 @@ import { ClineMessage, ClineSayTool } from "@shared/ExtensionMessage" import { StringRequest } from "@shared/proto/cline/common" +import i18next from "i18next" import { memo, useCallback, useMemo, useState } from "react" import { TypewriterText } from "@/components/chat/TypewriterText" import { cleanPathPrefix } from "@/components/common/CodeAccordian" @@ -35,8 +36,8 @@ const getActivityText = (tool: ClineSayTool): string | null => { .filter(Boolean) .join(" | ") return filePattern && filePattern !== "*" - ? `"${terms}" in ${cleanedPath}/ (${filePattern})` - : `"${terms}" in ${cleanedPath}/` + ? i18next.t("toolGroup.searchInPathWithPattern", { terms, path: cleanedPath, pattern: filePattern }) + : i18next.t("toolGroup.searchInPath", { terms, path: cleanedPath }) } switch (tool.tool) { @@ -45,16 +46,20 @@ const getActivityText = (tool: ClineSayTool): string | null => { return null } const lineHint = - tool.readLineStart != null && tool.readLineEnd != null ? ` (lines ${tool.readLineStart}-${tool.readLineEnd})` : "" - return `Reading ${cleanedPath}${lineHint}...` + tool.readLineStart != null && tool.readLineEnd != null + ? i18next.t("toolGroup.lines", { start: tool.readLineStart, end: tool.readLineEnd }) + : "" + return i18next.t("toolGroup.reading", { path: cleanedPath, lineHint }) } case "listFilesTopLevel": case "listFilesRecursive": - return tool.path ? `Exploring ${cleanedPath}/...` : null + return tool.path ? i18next.t("toolGroup.exploring", { path: cleanedPath }) : null case "searchFiles": - return tool.regex && tool.path ? `Searching ${formatSearchRegex(tool.regex, tool.path, tool.filePattern)}...` : null + return tool.regex && tool.path + ? i18next.t("toolGroup.searching", { query: formatSearchRegex(tool.regex, tool.path, tool.filePattern) }) + : null case "listCodeDefinitionNames": - return tool.path ? `Analyzing ${cleanedPath}/...` : null + return tool.path ? i18next.t("toolGroup.analyzing", { path: cleanedPath }) : null default: return null } @@ -301,7 +306,7 @@ function getToolDisplayInfo(tool: ClineSayTool) { switch (tool.tool) { case "readFile": { const lineNote = - tool.readLineStart != null && tool.readLineEnd != null ? `lines ${tool.readLineStart}-${tool.readLineEnd}` : null + tool.readLineStart != null && tool.readLineEnd != null ? `${tool.readLineStart}-${tool.readLineEnd}` : null return { icon, path: filePath, @@ -337,14 +342,16 @@ function formatSearchDisplay(regex: string, path: string, filePattern?: string): .map((t) => t.trim().replace(/\\b/g, "").replace(/\\s\?/g, " ")) .filter(Boolean) - const termDisplay = terms.length > 3 ? `${terms.length} patterns` : `"${terms.join(" | ")}"` - let result = `${termDisplay} in ${cleanPathPrefix(path)}/` + const termDisplay = + terms.length > 3 ? i18next.t("toolGroup.patternsCount", { count: terms.length }) : `"${terms.join(" | ")}"` - if (filePattern && filePattern !== "*") { - result += ` (${filePattern})` - } - - return result + return filePattern && filePattern !== "*" + ? i18next.t("toolGroup.searchInPathWithPattern", { + terms: termDisplay, + path: cleanPathPrefix(path), + pattern: filePattern, + }) + : i18next.t("toolGroup.searchInPath", { terms: termDisplay, path: cleanPathPrefix(path) }) } /** @@ -372,20 +379,24 @@ export function getToolGroupSummaryFromParsedTools(tools: ClineSayTool[]): strin } const parts: string[] = [] - const action = counts.read > 0 || counts.list > 0 ? " read " : " " + const action = counts.read > 0 || counts.list > 0 ? i18next.t("toolGroup.read") : " " if (counts.read > 0) { - parts.push(`${counts.read} file${counts.read > 1 ? "s" : ""}`) + parts.push(`${counts.read} ${i18next.t(counts.read > 1 ? "toolGroup.files" : "toolGroup.file")}`) } if (counts.list > 0) { - parts.push(`${counts.list} folder${counts.list > 1 ? "s" : ""}`) + parts.push(`${counts.list} ${i18next.t(counts.list > 1 ? "toolGroup.folders" : "toolGroup.folder")}`) } if (counts.def > 0) { - parts.push(`${counts.def} definition${counts.def > 1 ? "s" : ""}`) + parts.push(`${counts.def} ${i18next.t(counts.def > 1 ? "toolGroup.definitions" : "toolGroup.definition")}`) } if (counts.search > 0) { - parts.push(`performed ${counts.search} search${counts.search > 1 ? "es" : ""}`) + parts.push( + `${i18next.t("toolGroup.performed")} ${counts.search} ${i18next.t(counts.search > 1 ? "toolGroup.searches" : "toolGroup.search")}`, + ) } - return parts.length === 0 ? "Context" : "Cline" + action + parts.join(", ") + return parts.length === 0 + ? i18next.t("toolGroup.context") + : i18next.t("toolGroup.summaryClineAction", { action, parts: parts.join(i18next.t("toolGroup.summaryPartsSeparator")) }) } diff --git a/webview-ui/src/components/chat/task-header/ContextWindow.tsx b/webview-ui/src/components/chat/task-header/ContextWindow.tsx index e63a43c2..2e171372 100644 --- a/webview-ui/src/components/chat/task-header/ContextWindow.tsx +++ b/webview-ui/src/components/chat/task-header/ContextWindow.tsx @@ -1,6 +1,7 @@ import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import debounce from "debounce" import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card" import { Progress } from "@/components/ui/progress" import { formatLargeNumber as formatTokenNumber } from "@/utils/format" @@ -26,30 +27,33 @@ interface ContextWindowProgressProps extends ContextWindowInfoProps { const ConfirmationDialog = memo<{ onConfirm: (e: React.MouseEvent) => void onCancel: (e: React.MouseEvent) => void -}>(({ onConfirm, onCancel }) => ( -
- Compact the current task? - - - Cancel - - - Yes - - -
-)) +}>(({ onConfirm, onCancel }) => { + const { t } = useTranslation("common") + return ( +
+ {t("taskHeader.compactQuestion")}? + + + Cancel + + + Yes + + +
+ ) +}) ConfirmationDialog.displayName = "ConfirmationDialog" const ContextWindow: React.FC = ({ @@ -62,6 +66,7 @@ const ContextWindow: React.FC = ({ cacheWrites, cacheReads, }) => { + const { t } = useTranslation("common") const [isOpened, setIsOpened] = useState(false) const [confirmationNeeded, setConfirmationNeeded] = useState(false) const progressBarRef = useRef(null) @@ -166,7 +171,7 @@ const ContextWindow: React.FC = ({ onFocus={handleFocus} ref={progressBarRef}> diff --git a/webview-ui/src/components/chat/task-header/ContextWindowSummary.tsx b/webview-ui/src/components/chat/task-header/ContextWindowSummary.tsx index c4c07730..74a9dd2c 100644 --- a/webview-ui/src/components/chat/task-header/ContextWindowSummary.tsx +++ b/webview-ui/src/components/chat/task-header/ContextWindowSummary.tsx @@ -1,5 +1,6 @@ import { ChevronDownIcon, ChevronRightIcon } from "lucide-react" import React, { memo, useCallback, useMemo, useState } from "react" +import { useTranslation } from "react-i18next" import { formatLargeNumber as formatTokenNumber } from "@/utils/format" interface TokenUsageInfoProps { @@ -58,28 +59,32 @@ const AccordionItem = memo<{ }) AccordionItem.displayName = "AccordionItem" -// Constants -const TOKEN_DETAILS_CONFIG: Omit[] = [ - { title: "Prompt Tokens", icon: "codicon-arrow-up" }, - { title: "Completion Tokens", icon: "codicon-arrow-down" }, - { title: "Cache Writes", icon: "codicon-arrow-left" }, - { title: "Cache Reads", icon: "codicon-arrow-right" }, -] +const useTokenDetailTitles = () => { + const { t } = useTranslation("common") + return [ + { title: t("contextWindow.promptTokens"), icon: "codicon-arrow-up" }, + { title: t("contextWindow.completionTokens"), icon: "codicon-arrow-down" }, + { title: t("contextWindow.cacheWrites"), icon: "codicon-arrow-left" }, + { title: t("contextWindow.cacheReads"), icon: "codicon-arrow-right" }, + ] +} const TokenUsageDetails = memo(({ tokensIn, tokensOut, cacheWrites, cacheReads }) => { + const { t } = useTranslation("common") + const TOKEN_DETAILS_CONFIG = useTokenDetailTitles() const contextTokenDetails = useMemo(() => { const values = [tokensIn, tokensOut, cacheWrites || 0, cacheReads || 0] return TOKEN_DETAILS_CONFIG.map((config, index) => ({ ...config, value: values[index] })).filter((item) => item.value) - }, [tokensIn, tokensOut, cacheWrites, cacheReads]) + }, [tokensIn, tokensOut, cacheWrites, cacheReads, TOKEN_DETAILS_CONFIG]) if (!tokensIn) { - return
No token usage data available
+ return
{t("contextWindow.noTokenData")}
} return (
{contextTokenDetails.map((item) => ( -
+
{item.title} {formatTokenNumber(item.value || 0)}
@@ -99,6 +104,7 @@ export const ContextWindowSummary: React.FC = ({ percentage, autoCompactThreshold = 0, }) => { + const { t } = useTranslation("common") // Accordion state const [expandedSections, setExpandedSections] = useState>(new Set()) @@ -126,7 +132,7 @@ export const ContextWindowSummary: React.FC = ({ toggleSection("threshold", event)} - title="Auto Condense Threshold" + title={t("contextWindow.autoCondenseThreshold")} value={{`${(autoCompactThreshold * 100).toFixed(0)}%`}}>

@@ -142,19 +148,19 @@ export const ContextWindowSummary: React.FC = ({ toggleSection("context", event)} - title="Context Window" + title={t("contextWindow.contextWindow")} value={percentage ? `${percentage.toFixed(1)}%` : formatTokenNumber(contextWindow)}>

- Used: + {t("contextWindow.used")} {formatTokenNumber(tokenUsed)}
- Total: + {t("contextWindow.total")} {formatTokenNumber(contextWindow)}
- Remaining: + {t("contextWindow.remaining")} {formatTokenNumber(contextWindow - tokenUsed)}
@@ -164,7 +170,7 @@ export const ContextWindowSummary: React.FC = ({ toggleSection("tokens", event)} - title="Token Usage" + title={t("contextWindow.tokenUsage")} value={`${formatTokenNumber(totalTokens)}`}> { // Main component with aggressive optimization export const FocusChain: React.FC = memo( ({ currentTaskItemId, lastProgressMessageText, showPlaceholderWhenEmpty }) => { + const { t } = useTranslation("common") const [isExpanded, setIsExpanded] = useState(false) // Parse todo info with caching @@ -194,7 +197,7 @@ export const FocusChain: React.FC = memo( 0/0 - TODOs + {t("focusChain.todos")}
) } @@ -207,7 +210,7 @@ export const FocusChain: React.FC = memo( return (
{ diff --git a/webview-ui/src/components/chat/task-header/StickyUserMessage.tsx b/webview-ui/src/components/chat/task-header/StickyUserMessage.tsx index 3ce11adb..32054dec 100644 --- a/webview-ui/src/components/chat/task-header/StickyUserMessage.tsx +++ b/webview-ui/src/components/chat/task-header/StickyUserMessage.tsx @@ -1,5 +1,6 @@ import { ClineMessage } from "@shared/ExtensionMessage" import React, { memo, useCallback } from "react" +import { useTranslation } from "react-i18next" import { cn } from "@/lib/utils" import { highlightText } from "./Highlights" @@ -15,6 +16,8 @@ interface StickyUserMessageProps { */ export const StickyUserMessage: React.FC = memo( ({ lastUserMessage, onScrollToMessage, isVisible }) => { + const { t } = useTranslation("common") + const handleClick = useCallback(() => { if (onScrollToMessage) { onScrollToMessage() @@ -42,7 +45,7 @@ export const StickyUserMessage: React.FC = memo( return (
= memo( borderRadius: "3px", }} tabIndex={0} - title="Click to scroll to your message"> + title={t("stickyUserMessage.clickToScroll")}> {/* Message text (truncated via CSS text-ellipsis) */}
= ({ }}> {/* Task Title */}
{ diff --git a/webview-ui/src/components/chat/task-header/util.ts b/webview-ui/src/components/chat/task-header/util.ts index dd8d9ad7..583e6219 100644 --- a/webview-ui/src/components/chat/task-header/util.ts +++ b/webview-ui/src/components/chat/task-header/util.ts @@ -29,13 +29,15 @@ export const getColor = (message: ClineMessage): string => { toolData.tool === "searchFiles" ) { return COLOR_BEIGE // Beige for file read operations - } else if ( + } + if ( toolData.tool === "editedExistingFile" || toolData.tool === "newFileCreated" || toolData.tool === "deletedFile" ) { return COLOR_BLUE // Blue for file edit/create operations - } else if (toolData.tool === "webFetch" || toolData.tool === "webSearch") { + } + if (toolData.tool === "webFetch" || toolData.tool === "webSearch") { return COLOR_PURPLE // Purple for web fetch/search operations } } catch (_e) { @@ -54,7 +56,8 @@ export const getColor = (message: ClineMessage): string => { default: return COLOR_DARK_GRAY // Dark gray for unknown } - } else if (message.type === "ask") { + } + if (message.type === "ask") { switch (message.ask) { case "followup": return COLOR_GRAY // Gray for user messages @@ -73,13 +76,15 @@ export const getColor = (message: ClineMessage): string => { toolData.tool === "searchFiles" ) { return COLOR_BEIGE // Beige for file read operations - } else if ( + } + if ( toolData.tool === "editedExistingFile" || toolData.tool === "newFileCreated" || toolData.tool === "deletedFile" ) { return COLOR_BLUE // Blue for file edit/create operations - } else if (toolData.tool === "webFetch" || toolData.tool === "webSearch") { + } + if (toolData.tool === "webFetch" || toolData.tool === "webSearch") { return COLOR_PURPLE // Purple for web fetch/search operations } } catch (_e) { diff --git a/webview-ui/src/components/cline-rules/ClineRulesToggleModal.tsx b/webview-ui/src/components/cline-rules/ClineRulesToggleModal.tsx index 3767b627..a6189bbb 100644 --- a/webview-ui/src/components/cline-rules/ClineRulesToggleModal.tsx +++ b/webview-ui/src/components/cline-rules/ClineRulesToggleModal.tsx @@ -13,6 +13,7 @@ import { } from "@shared/proto/cline/file" import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react" import React, { useEffect, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useClickAway, useWindowSize } from "react-use" import styled from "styled-components" import PopupModalContainer from "@/components/common/PopupModalContainer" @@ -52,6 +53,7 @@ const ClineRulesToggleModal: React.FC = () => { setRemoteRulesToggles, setRemoteWorkflowToggles, } = useExtensionState() + const { t } = useTranslation("misc") const [globalHooks, setGlobalHooks] = useState>([]) const [workspaceHooks, setWorkspaceHooks] = useState< Array<{ workspaceName: string; hooks: Array<{ name: string; enabled: boolean; absolutePath: string }> }> @@ -437,11 +439,11 @@ const ClineRulesToggleModal: React.FC = () => {
- {!isVisible && Manage Cline Rules & Workflows} + {!isVisible && {t("rules.manageRules")}} setIsVisible(!isVisible)}> @@ -470,18 +472,18 @@ const ClineRulesToggleModal: React.FC = () => { flexWrap: "wrap", }}> setCurrentView("rules")}> - Rules + {t("rules.tabs.rules")} setCurrentView("workflows")}> - Workflows + {t("rules.tabs.workflows")} {hooksEnabled && ( setCurrentView("hooks")}> - Hooks + {t("rules.tabs.hooks")} )} setCurrentView("skills")}> - Skills + {t("rules.tabs.skills")}
@@ -491,9 +493,7 @@ const ClineRulesToggleModal: React.FC = () => {
- {currentView === "rules" - ? "Your organization manages some rules" - : "Your organization manages some workflows"} + {currentView === "rules" ? t("rules.orgManagesRules") : t("rules.orgManagesWorkflows")}
) : null} @@ -502,37 +502,33 @@ const ClineRulesToggleModal: React.FC = () => {
{currentView === "rules" ? (

- Rules allow you to provide Cline with system-level guidance. Think of them as a persistent way - to include context and preferences for your projects or globally for every conversation.{" "} + {t("rules.rulesDescription")} - Docs + {t("rules.docs")}

) : currentView === "workflows" ? (

- Workflows allow you to define a series of steps to guide Cline through a repetitive set of - tasks, such as deploying a service or submitting a PR. To invoke a workflow, type{" "} - /workflow-name in the chat.{" "} + {t("rules.workflowsDescription")} + /workflow-name + {t("rules.workflowsInvoke")}{" "} - Docs + {t("rules.docs")}

) : currentView === "skills" ? (

- Skills are reusable instruction sets that Cline can activate on-demand. When a task matches a - skill's description, Cline uses the use_skill tool to load - the full instructions. + {t("rules.skillsDescription")} + use_skill + {t("rules.skillsTool")}

) : ( -

- Hooks allow you to execute custom scripts at specific points in Cline's execution lifecycle, - enabling automation and integration with external tools. -

+

{t("rules.hooksDescription")}

)}
@@ -544,7 +540,7 @@ const ClineRulesToggleModal: React.FC = () => { {/* Remote Rules Section */} {hasRemoteRules && (
-
Enterprise Rules
+
{t("rules.enterpriseRules")}
{remoteGlobalRules.map((rule) => { const enabled = rule.alwaysEnabled || remoteRulesToggles[rule.name] === true @@ -567,7 +563,7 @@ const ClineRulesToggleModal: React.FC = () => { {/* Global Rules Section */}
-
Global Rules
+
{t("rules.globalRules")}
{/* File-based Global Rules */} { {/* Local Rules Section */}
-
Workspace Rules
+
{t("rules.workspaceRules")}
{ {/* Remote Workflows Section */} {hasRemoteWorkflows && (
-
Enterprise Workflows
+
{t("rules.enterpriseWorkflows")}
{remoteGlobalWorkflows.map((workflow) => { const enabled = @@ -652,7 +648,7 @@ const ClineRulesToggleModal: React.FC = () => { {/* Global Workflows Section */}
-
Global Workflows
+
{t("rules.globalWorkflows")}
{/* File-based Global Workflows */} { {/* Local Workflows Section */}
-
Workspace Workflows
+
{t("rules.workspaceWorkflows")}
{ <>

- {isWindows - ? "On Windows, hooks execute whenever the hook file exists." - : "Toggle to enable/disable (chmod +x/-x)."}{" "} + {isWindows ? t("rules.hookWindowsToggle") : t("rules.hookUnixToggle")}{" "} - Docs + {t("rules.docs")}

@@ -700,17 +694,13 @@ const ClineRulesToggleModal: React.FC = () => { {isWindows && (
- - Hook toggling is not yet supported on Windows in this foundation PR. Hooks can be - created, edited, and deleted, and execute whenever the hook file exists. Coming next: - JSON-backed hook enabled/disabled state across platforms. - + {t("rules.hookWindowsWarning")}
)} {/* Global Hooks */}
-
Global Hooks
+
{t("rules.globalHooks")}
{globalHooks .sort((a, b) => a.name.localeCompare(b.name)) @@ -785,7 +775,7 @@ const ClineRulesToggleModal: React.FC = () => { {/* Enterprise Skills Section (remote) */} {globalSkills.some((s) => s.path.startsWith("remote:")) && (
-
Enterprise Skills
+
{t("rules.enterpriseSkills")}
{globalSkills .filter((s) => s.path.startsWith("remote:")) @@ -808,7 +798,7 @@ const ClineRulesToggleModal: React.FC = () => { {/* Global Skills Section */}
-
Global Skills
+
{t("rules.globalSkills")}
{globalSkills .filter((s) => !s.path.startsWith("remote:")) @@ -829,7 +819,7 @@ const ClineRulesToggleModal: React.FC = () => { {/* Workspace Skills Section */}
-
Workspace Skills
+
{t("rules.workspaceSkills")}
{localSkills .sort((a, b) => a.name.localeCompare(b.name)) diff --git a/webview-ui/src/components/cline-rules/HookRow.tsx b/webview-ui/src/components/cline-rules/HookRow.tsx index e36532ae..c0840429 100644 --- a/webview-ui/src/components/cline-rules/HookRow.tsx +++ b/webview-ui/src/components/cline-rules/HookRow.tsx @@ -1,6 +1,7 @@ import { StringRequest } from "@shared/proto/cline/common" import { DeleteHookRequest, HooksToggles } from "@shared/proto/cline/file" import { PenIcon, Trash2Icon } from "lucide-react" +import { useTranslation } from "react-i18next" import { Button } from "@/components/ui/button" import { Switch } from "@/components/ui/switch" import { FileServiceClient } from "@/services/grpc-client" @@ -26,6 +27,8 @@ const HookRow: React.FC = ({ onToggle, onDelete, }) => { + const { t } = useTranslation("misc") + const handleEditClick = () => { FileServiceClient.openFile(StringRequest.create({ value: absolutePath })).catch((err) => console.error("Failed to open file:", err), @@ -57,12 +60,7 @@ const HookRow: React.FC = ({ {/* Toggle Switch */}
-
+
= ({ style={isWindows ? { opacity: 0.5, cursor: "not-allowed" } : undefined} />
- diff --git a/webview-ui/src/components/cline-rules/NewRuleRow.tsx b/webview-ui/src/components/cline-rules/NewRuleRow.tsx index 776f59aa..0afb67f6 100644 --- a/webview-ui/src/components/cline-rules/NewRuleRow.tsx +++ b/webview-ui/src/components/cline-rules/NewRuleRow.tsx @@ -1,6 +1,7 @@ import { CreateHookRequest, CreateSkillRequest, RuleFileRequest } from "@shared/proto/index.cline" import { PlusIcon } from "lucide-react" import { useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useClickAway } from "react-use" import { Button } from "@/components/ui/button" import { cn } from "@/lib/utils" @@ -14,17 +15,18 @@ interface NewRuleRowProps { } const HOOK_TYPES = [ - { name: "TaskStart", description: "Executes when a new task begins" }, - { name: "TaskResume", description: "Executes when a task is resumed" }, - { name: "TaskCancel", description: "Executes when a task is cancelled" }, - { name: "TaskComplete", description: "Executes when a task completes" }, - { name: "PreToolUse", description: "Executes before any tool is used" }, - { name: "PostToolUse", description: "Executes after any tool is used" }, - { name: "UserPromptSubmit", description: "Executes when user submits a prompt" }, - { name: "PreCompact", description: "Executes before conversation compaction" }, + { name: "TaskStart", descriptionKey: "rules.hookTypes.taskStart" }, + { name: "TaskResume", descriptionKey: "rules.hookTypes.taskResume" }, + { name: "TaskCancel", descriptionKey: "rules.hookTypes.taskCancel" }, + { name: "TaskComplete", descriptionKey: "rules.hookTypes.taskComplete" }, + { name: "PreToolUse", descriptionKey: "rules.hookTypes.preToolUse" }, + { name: "PostToolUse", descriptionKey: "rules.hookTypes.postToolUse" }, + { name: "UserPromptSubmit", descriptionKey: "rules.hookTypes.userPromptSubmit" }, + { name: "PreCompact", descriptionKey: "rules.hookTypes.preCompact" }, ] const NewRuleRow: React.FC = ({ isGlobal, ruleType, existingHooks = [], workspaceName }) => { + const { t } = useTranslation("misc") const [isExpanded, setIsExpanded] = useState(false) const [filename, setFilename] = useState("") const inputRef = useRef(null) @@ -88,7 +90,7 @@ const NewRuleRow: React.FC = ({ isGlobal, ruleType, existingHoo if (ruleType === "skill") { // Validate skill name - only allow alphanumeric, dashes, underscores if (!/^[a-zA-Z0-9_-]+$/.test(trimmedFilename)) { - setError("Skill name can only contain letters, numbers, dashes, and underscores") + setError(t("rules.newRule.skillNameInvalid")) return } @@ -111,7 +113,7 @@ const NewRuleRow: React.FC = ({ isGlobal, ruleType, existingHoo const extension = getExtension(trimmedFilename) if (!isValidExtension(extension)) { - setError("Only .md, .txt, or no file extension allowed") + setError(t("rules.newRule.extensionInvalid")) return } @@ -164,15 +166,14 @@ const NewRuleRow: React.FC = ({ isGlobal, ruleType, existingHoo {ruleType === "hook" ? ( <> - Choose a hook type to create. Hooks execute at specific points in Cline's lifecycle. Available:{" "} - {availableHookTypes.map((h) => h.name).join(", ")} + {t("rules.newRule.chooseHookType")} {availableHookTypes.map((h) => h.name).join(", ")} })} {searchTerm.length > 0 && searchedModels.length === 0 && ( -

No result found for "{searchTerm}"

+

+ {t("modelPicker.noResultFound", { term: searchTerm })} +

)}
@@ -195,7 +198,7 @@ type UserTypeSelectionProps = { const UserTypeSelectionStep = ({ userType, onSelectUserType }: UserTypeSelectionProps) => (
- {USER_TYPE_SELECTIONS.map((option) => { + {getUserTypeSelections(t).map((option) => { const isSelected = userType === option.type return ( @@ -266,6 +269,7 @@ const OnboardingStepContent = ({ } const OnboardingViewContent = ({ onboardingModels }: { onboardingModels: OnboardingModelGroup }) => { + const { t } = useTranslation("settings") const { handleFieldsChange } = useApiConfigurationHandlers() const { openRouterModels, hideSettings, hideAccount, setShowWelcome } = useExtensionState() @@ -362,10 +366,10 @@ const OnboardingViewContent = ({ onboardingModels }: { onboardingModels: Onboard ) const stepDisplayInfo = useMemo(() => { - const step = stepNumber === 0 || stepNumber === 2 ? STEP_CONFIG[stepNumber] : null - const title = step ? step.title : userType ? STEP_CONFIG[userType].title : STEP_CONFIG[0].title + const step = stepNumber === 0 || stepNumber === 2 ? getStepConfig(t)[stepNumber] : null + const title = step ? step.title : userType ? getStepConfig(t)[userType].title : getStepConfig(t)[0].title const description = step ? step.description : null - const buttons = step ? step.buttons : userType ? STEP_CONFIG[userType].buttons : STEP_CONFIG[0].buttons + const buttons = step ? step.buttons : userType ? getStepConfig(t)[userType].buttons : getStepConfig(t)[0].buttons return { title, description, buttons } }, [stepNumber, userType]) @@ -411,7 +415,7 @@ const OnboardingViewContent = ({ onboardingModels }: { onboardingModels: Onboard {stepNumber !== 2 && (
- You can change this later in settings + {t("onboarding.canChangeLater")}
)} diff --git a/webview-ui/src/components/onboarding/data-steps.ts b/webview-ui/src/components/onboarding/data-steps.ts index 84f629e0..14236585 100644 --- a/webview-ui/src/components/onboarding/data-steps.ts +++ b/webview-ui/src/components/onboarding/data-steps.ts @@ -1,3 +1,5 @@ +import type { TFunction } from "i18next" + export enum NEW_USER_TYPE { FREE = "free", POWER = "power", @@ -10,45 +12,45 @@ type UserTypeSelection = { type: NEW_USER_TYPE } -export const STEP_CONFIG = { +export const getStepConfig = (t: TFunction) => ({ 0: { - title: "How will you use Cline?", - description: "Select an option below to get started.", + title: t("onboarding.howWillYouUse"), + description: t("onboarding.selectOption"), buttons: [ - { text: "Continue", action: "next", variant: "default" }, - { text: "Login to Cline", action: "signin", variant: "secondary" }, + { text: t("onboarding.continue"), action: "next", variant: "default" }, + { text: t("onboarding.loginToCline"), action: "signin", variant: "secondary" }, ], }, [NEW_USER_TYPE.FREE]: { - title: "Select a free model", + title: t("onboarding.selectFreeModel"), buttons: [ - { text: "Create my Account", action: "signup", variant: "default" }, - { text: "Back", action: "back", variant: "secondary" }, + { text: t("onboarding.createMyAccount"), action: "signup", variant: "default" }, + { text: t("onboarding.back"), action: "back", variant: "secondary" }, ], }, [NEW_USER_TYPE.POWER]: { - title: "Select your model", + title: t("onboarding.selectYourModel"), buttons: [ - { text: "Create my Account", action: "signup", variant: "default" }, - { text: "Back", action: "back", variant: "secondary" }, + { text: t("onboarding.createMyAccount"), action: "signup", variant: "default" }, + { text: t("onboarding.back"), action: "back", variant: "secondary" }, ], }, [NEW_USER_TYPE.BYOK]: { - title: "Configure your provider", + title: t("onboarding.configureYourProvider"), buttons: [ - { text: "Continue", action: "done", variant: "default" }, - { text: "Back", action: "back", variant: "secondary" }, + { text: t("onboarding.continue"), action: "done", variant: "default" }, + { text: t("onboarding.back"), action: "back", variant: "secondary" }, ], }, 2: { - title: "Almost there!", - description: "Complete account creation in your browser. Then come back here to finish up.", - buttons: [{ text: "Back", action: "back", variant: "secondary" }], + title: t("onboarding.almostThere"), + description: t("onboarding.completeInBrowser"), + buttons: [{ text: t("onboarding.back"), action: "back", variant: "secondary" }], }, -} as const +}) -export const USER_TYPE_SELECTIONS: UserTypeSelection[] = [ - { title: "Absolutely Free", description: "Get started at no cost", type: NEW_USER_TYPE.FREE }, - { title: "Frontier Model", description: "Claude, GPT Codex, Gemini, etc.", type: NEW_USER_TYPE.POWER }, - { title: "Bring my own API key", description: "Use Cline with your provider of choice", type: NEW_USER_TYPE.BYOK }, +export const getUserTypeSelections = (t: TFunction): UserTypeSelection[] => [ + { title: t("onboarding.absolutelyFree"), description: t("onboarding.getStartedNoCost"), type: NEW_USER_TYPE.FREE }, + { title: t("onboarding.frontierModel"), description: t("onboarding.frontierModelDescription"), type: NEW_USER_TYPE.POWER }, + { title: t("onboarding.bringOwnKey"), description: t("onboarding.bringOwnKeyDescription"), type: NEW_USER_TYPE.BYOK }, ] diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index 37e81905..9fa3eedb 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -4,6 +4,7 @@ import { Mode } from "@shared/storage/types" import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import Fuse from "fuse.js" import { KeyboardEvent, useCallback, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useInterval } from "react-use" import styled from "styled-components" import { normalizeApiConfiguration } from "@/components/settings/utils/providerUtils" @@ -97,6 +98,7 @@ const ApiOptions = ({ currentMode, initialModelTab, }: ApiOptionsProps) => { + const { t } = useTranslation("settings") // Use full context state for immediate save payload const { apiConfiguration, remoteConfigSettings } = useExtensionState() @@ -282,16 +284,16 @@ const ApiOptions = ({
- Provider options are managed by your organization's remote configuration + {t("settings.providerManagedByOrg")} ) : ( )} @@ -307,7 +309,7 @@ const ApiOptions = ({ setIsDropdownVisible(true) }} onKeyDown={handleKeyDown} - placeholder="Search and select provider..." + placeholder={t("settings.searchSelectProvider")} role="combobox" style={{ width: "100%", @@ -318,7 +320,7 @@ const ApiOptions = ({ value={searchTerm}> {searchTerm && searchTerm !== currentProviderLabel && (
{ setSearchTerm("") diff --git a/webview-ui/src/components/settings/BasetenModelPicker.tsx b/webview-ui/src/components/settings/BasetenModelPicker.tsx index 945afd5e..825056c2 100644 --- a/webview-ui/src/components/settings/BasetenModelPicker.tsx +++ b/webview-ui/src/components/settings/BasetenModelPicker.tsx @@ -3,6 +3,7 @@ import { Mode } from "@shared/storage/types" import { VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import Fuse from "fuse.js" import React, { KeyboardEvent, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useExtensionState } from "../../context/ExtensionStateContext" import { highlight } from "../history/HistoryView" import { ModelInfoView } from "./common/ModelInfoView" @@ -15,6 +16,7 @@ export interface BasetenModelPickerProps { } const BasetenModelPicker: React.FC = ({ isPopup, currentMode }) => { + const { t } = useTranslation("settings") const { apiConfiguration, basetenModels: dynamicBasetenModels } = useExtensionState() const { handleModeFieldsChange } = useApiConfigurationHandlers() const modeFields = getModeSpecificFields(apiConfiguration, currentMode) @@ -195,7 +197,7 @@ const BasetenModelPicker: React.FC = ({ isPopup, curren
= ({ isPopup, curren setIsDropdownVisible(true) }} onKeyDown={handleKeyDown} - placeholder="Search and select a model..." + placeholder={t("settings.searchSelectModel")} role="combobox" style={{ width: "100%", diff --git a/webview-ui/src/components/settings/ClineAccountInfoCard.tsx b/webview-ui/src/components/settings/ClineAccountInfoCard.tsx index 86fe88da..052664fe 100644 --- a/webview-ui/src/components/settings/ClineAccountInfoCard.tsx +++ b/webview-ui/src/components/settings/ClineAccountInfoCard.tsx @@ -1,11 +1,13 @@ import { EmptyRequest } from "@shared/proto/cline/common" import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import { useState } from "react" +import { useTranslation } from "react-i18next" import { useClineAuth } from "@/context/ClineAuthContext" import { useExtensionState } from "@/context/ExtensionStateContext" import { AccountServiceClient } from "@/services/grpc-client" export const ClineAccountInfoCard = () => { + const { t } = useTranslation("settings") const { clineUser } = useClineAuth() const { navigateToAccount } = useExtensionState() const [isLoading, setIsLoading] = useState(false) @@ -29,15 +31,15 @@ export const ClineAccountInfoCard = () => {
{user ? ( - View Billing & Usage + {t("settings.viewBillingUsage")} ) : (
- Sign Up with Cline + {t("settings.signUpWithCline")} {isLoading && ( - + )} diff --git a/webview-ui/src/components/settings/ClineModelPicker.tsx b/webview-ui/src/components/settings/ClineModelPicker.tsx index 7b642e22..333e2a5b 100644 --- a/webview-ui/src/components/settings/ClineModelPicker.tsx +++ b/webview-ui/src/components/settings/ClineModelPicker.tsx @@ -6,8 +6,10 @@ import type { Mode } from "@shared/storage/types" import { isClaudeOpusAdaptiveThinkingModel, resolveClaudeOpusAdaptiveThinking } from "@shared/utils/reasoning-support" import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import Fuse from "fuse.js" +import i18next from "i18next" import type React from "react" import { type KeyboardEvent, useCallback, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useMount } from "react-use" import styled from "styled-components" import { useExtensionState } from "@/context/ExtensionStateContext" @@ -79,7 +81,9 @@ function toFeaturedModelCardEntry( return { id: model.id, - description: model.description || (fallbackLabel === "FREE" ? "Free model" : "Recommended model"), + description: + model.description || + (fallbackLabel === "FREE" ? i18next.t("settings.freeModel") : i18next.t("settings.recommendedModel")), label: normalizedLabel || fallbackLabel, } } @@ -93,6 +97,7 @@ const FREE_MODELS_FALLBACK: FeaturedModelCardEntry[] = CLINE_RECOMMENDED_MODELS_ .filter((model): model is FeaturedModelCardEntry => model !== null) const ClineModelPicker: React.FC = ({ isPopup, currentMode, showProviderRouting, initialTab }) => { + const { t } = useTranslation("settings") const { handleModeFieldsChange, handleFieldChange } = useApiConfigurationHandlers() const { apiConfiguration, favoritedModelIds, clineModels, refreshClineModels } = useExtensionState() const modeFields = getModeSpecificFields(apiConfiguration, currentMode) @@ -391,7 +396,7 @@ const ClineModelPicker: React.FC = ({ isPopup, currentMod
<> @@ -452,7 +457,7 @@ const ClineModelPicker: React.FC = ({ isPopup, currentMod setIsDropdownVisible(true) }} onKeyDown={handleKeyDown} - placeholder="Search and select a model..." + placeholder={t("settings.searchSelectModel")} role="combobox" style={{ width: "100%", @@ -571,11 +576,7 @@ const ClineModelPicker: React.FC = ({ isPopup, currentMod } currentMode={currentMode} defaultEffort={showAdaptiveThinkingEffort ? adaptiveThinkingDefaultEffort : "medium"} - description={ - showAdaptiveThinkingEffort - ? "Use None to disable adaptive thinking. Higher effort increases response detail and token usage." - : undefined - } + description={showAdaptiveThinkingEffort ? t("settings.adaptiveThinkingDescription") : undefined} label={showAdaptiveThinkingEffort ? "Adaptive Thinking" : undefined} /> )} @@ -596,8 +597,7 @@ const ClineModelPicker: React.FC = ({ isPopup, currentMod marginTop: 0, color: "var(--vscode-descriptionForeground)", }}> - The extension automatically fetches the latest Cline model list. If you're unsure which model to choose, Cline - works best with anthropic/claude-sonnet-4.5. + {t("settings.autoFetchModelList")} anthropic/claude-sonnet-4.5.

)}
diff --git a/webview-ui/src/components/settings/GroqModelPicker.tsx b/webview-ui/src/components/settings/GroqModelPicker.tsx index ee2886ab..6f5ce00a 100644 --- a/webview-ui/src/components/settings/GroqModelPicker.tsx +++ b/webview-ui/src/components/settings/GroqModelPicker.tsx @@ -5,6 +5,7 @@ import { Mode } from "@shared/storage/types" import { VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import Fuse from "fuse.js" import React, { KeyboardEvent, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useMount } from "react-use" import { useExtensionState } from "../../context/ExtensionStateContext" import { ModelsServiceClient } from "../../services/grpc-client" @@ -19,6 +20,7 @@ export interface GroqModelPickerProps { } const GroqModelPicker: React.FC = ({ isPopup, currentMode }) => { + const { t } = useTranslation("settings") const { apiConfiguration, groqModels: dynamicGroqModels, setGroqModels } = useExtensionState() const { handleModeFieldsChange } = useApiConfigurationHandlers() const modeFields = getModeSpecificFields(apiConfiguration, currentMode) @@ -192,7 +194,7 @@ const GroqModelPicker: React.FC = ({ isPopup, currentMode
= ({ isPopup, currentMode setIsDropdownVisible(true) }} onKeyDown={handleKeyDown} - placeholder="Search and select a model..." + placeholder={t("settings.searchSelectModel")} role="combobox" style={{ width: "100%", diff --git a/webview-ui/src/components/settings/HicapModelPicker.tsx b/webview-ui/src/components/settings/HicapModelPicker.tsx index ed1cbce8..b2d2b4b8 100644 --- a/webview-ui/src/components/settings/HicapModelPicker.tsx +++ b/webview-ui/src/components/settings/HicapModelPicker.tsx @@ -3,6 +3,7 @@ import { Mode } from "@shared/storage/types" import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import Fuse from "fuse.js" import React, { KeyboardEvent, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useMount } from "react-use" import { useExtensionState } from "@/context/ExtensionStateContext" import { StateServiceClient } from "@/services/grpc-client" @@ -29,6 +30,7 @@ export interface HicapModelPickerProps { } const HicapModelPicker: React.FC = ({ isPopup, currentMode }) => { + const { t } = useTranslation("settings") const { handleModeFieldsChange } = useApiConfigurationHandlers() const { apiConfiguration, favoritedModelIds, hicapModels, refreshHicapModels } = useExtensionState() @@ -165,7 +167,7 @@ const HicapModelPicker: React.FC = ({ isPopup, currentMod
@@ -179,7 +181,7 @@ const HicapModelPicker: React.FC = ({ isPopup, currentMod setIsDropdownVisible(true) }} onKeyDown={handleKeyDown} - placeholder="Search and select a model..." + placeholder={t("settings.searchSelectModel")} role="combobox" style={{ zIndex: HICAP_MODEL_PICKER_Z_INDEX }} value={searchTerm}> diff --git a/webview-ui/src/components/settings/HuggingFaceModelPicker.tsx b/webview-ui/src/components/settings/HuggingFaceModelPicker.tsx index 4d542c26..b1c62052 100644 --- a/webview-ui/src/components/settings/HuggingFaceModelPicker.tsx +++ b/webview-ui/src/components/settings/HuggingFaceModelPicker.tsx @@ -4,6 +4,7 @@ import { Mode } from "@shared/storage/types" import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import Fuse from "fuse.js" import React, { KeyboardEvent, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useMount } from "react-use" import { useExtensionState } from "../../context/ExtensionStateContext" import { ModelsServiceClient } from "../../services/grpc-client" @@ -18,6 +19,7 @@ export interface HuggingFaceModelPickerProps { } const HuggingFaceModelPicker: React.FC = ({ isPopup, currentMode }) => { + const { t } = useTranslation("settings") const { apiConfiguration, huggingFaceModels: dynamicModels, setHuggingFaceModels } = useExtensionState() const { handleModeFieldsChange } = useApiConfigurationHandlers() const modeFields = getModeSpecificFields(apiConfiguration, currentMode) @@ -180,7 +182,7 @@ const HuggingFaceModelPicker: React.FC = ({ isPopup setSelectedIndex(-1) }} onKeyDown={handleKeyDown} - placeholder="Search models..." + placeholder={t("modelPicker.searchModel")} role="combobox" value={searchTerm}> {searchTerm && ( diff --git a/webview-ui/src/components/settings/ModelDescriptionMarkdown.tsx b/webview-ui/src/components/settings/ModelDescriptionMarkdown.tsx index 7f1aea61..1c38b4f5 100644 --- a/webview-ui/src/components/settings/ModelDescriptionMarkdown.tsx +++ b/webview-ui/src/components/settings/ModelDescriptionMarkdown.tsx @@ -1,4 +1,5 @@ import { memo, useEffect, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useRemark } from "react-remark" import { Button } from "@/components/ui/button" import { cn } from "@/lib/utils" @@ -10,6 +11,7 @@ interface ModelDescriptionMarkdownProps { } export const ModelDescriptionMarkdown = memo(({ markdown, key, isPopup }: ModelDescriptionMarkdownProps) => { + const { t } = useTranslation("settings") // Update the markdown content when the prop changes const [reactContent, setMarkdown] = useRemark() const contentRef = useRef(null) @@ -51,7 +53,7 @@ export const ModelDescriptionMarkdown = memo(({ markdown, key, isPopup }: ModelD })} onClick={() => setIsExpanded(!isExpanded)} variant="link"> - {isExpanded ? "See less" : "See more"} + {isExpanded ? t("settings.seeLess") : t("settings.seeMore")}
)} diff --git a/webview-ui/src/components/settings/OllamaModelPicker.tsx b/webview-ui/src/components/settings/OllamaModelPicker.tsx index 5fe7a1ee..b1c07e0d 100644 --- a/webview-ui/src/components/settings/OllamaModelPicker.tsx +++ b/webview-ui/src/components/settings/OllamaModelPicker.tsx @@ -1,6 +1,7 @@ import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import Fuse from "fuse.js" import React, { KeyboardEvent, memo, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import styled from "styled-components" import { highlight } from "../history/HistoryView" @@ -13,12 +14,9 @@ export interface OllamaModelPickerProps { placeholder?: string } -const OllamaModelPicker: React.FC = ({ - ollamaModels, - selectedModelId, - onModelChange, - placeholder = "Search and select a model...", -}) => { +const OllamaModelPicker: React.FC = ({ ollamaModels, selectedModelId, onModelChange, placeholder }) => { + const { t } = useTranslation("settings") + const resolvedPlaceholder = placeholder ?? t("settings.searchSelectModel") const [searchTerm, setSearchTerm] = useState(selectedModelId || "") const [isDropdownVisible, setIsDropdownVisible] = useState(false) const [selectedIndex, setSelectedIndex] = useState(-1) @@ -138,7 +136,7 @@ const OllamaModelPicker: React.FC = ({ setIsDropdownVisible(true) }} onKeyDown={handleKeyDown} - placeholder={placeholder} + placeholder={resolvedPlaceholder} role="combobox" style={{ width: "100%", diff --git a/webview-ui/src/components/settings/OpenRouterModelPicker.tsx b/webview-ui/src/components/settings/OpenRouterModelPicker.tsx index 740d9f41..c172269d 100644 --- a/webview-ui/src/components/settings/OpenRouterModelPicker.tsx +++ b/webview-ui/src/components/settings/OpenRouterModelPicker.tsx @@ -6,6 +6,7 @@ import { VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import Fuse from "fuse.js" import type React from "react" import { type KeyboardEvent, useEffect, useMemo, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { useMount } from "react-use" import styled from "styled-components" import { useExtensionState } from "@/context/ExtensionStateContext" @@ -25,6 +26,7 @@ import { useApiConfigurationHandlers } from "./utils/useApiConfigurationHandlers // Star icon for favorites const StarIcon = ({ isFavorite, onClick }: { isFavorite: boolean; onClick: (e: React.MouseEvent) => void }) => { + const { t } = useTranslation("settings") return (
= ({ isPopup, setIsDropdownVisible(true) }} onKeyDown={handleKeyDown} - placeholder="Search and select a model..." + placeholder={t("settings.searchSelectModel")} role="combobox" style={{ width: "100%", diff --git a/webview-ui/src/components/settings/PreferredLanguageSetting.tsx b/webview-ui/src/components/settings/PreferredLanguageSetting.tsx index e4b75515..cc35d7db 100644 --- a/webview-ui/src/components/settings/PreferredLanguageSetting.tsx +++ b/webview-ui/src/components/settings/PreferredLanguageSetting.tsx @@ -1,9 +1,11 @@ import { VSCodeDropdown, VSCodeOption } from "@vscode/webview-ui-toolkit/react" import React from "react" +import { useTranslation } from "react-i18next" import { useExtensionState } from "@/context/ExtensionStateContext" import { updateSetting } from "./utils/settingsHandlers" const PreferredLanguageSetting: React.FC = () => { + const { t } = useTranslation("settings") const { preferredLanguage } = useExtensionState() const handleLanguageChange = (newLanguage: string) => { @@ -13,7 +15,7 @@ const PreferredLanguageSetting: React.FC = () => { return (
{ Traditional Chinese - 繁體中文 Turkish - Türkçe -

The language that Cline should use for communication.

+

{t("settings.preferredLanguageDescription")}

) } diff --git a/webview-ui/src/components/settings/ReasoningEffortSelector.tsx b/webview-ui/src/components/settings/ReasoningEffortSelector.tsx index 32181820..e100736a 100644 --- a/webview-ui/src/components/settings/ReasoningEffortSelector.tsx +++ b/webview-ui/src/components/settings/ReasoningEffortSelector.tsx @@ -1,5 +1,6 @@ import { isOpenaiReasoningEffort, Mode, OPENAI_REASONING_EFFORT_OPTIONS, OpenaiReasoningEffort } from "@shared/storage/types" import { memo } from "react" +import { useTranslation } from "react-i18next" import { Label } from "@/components/ui/label" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { useExtensionState } from "@/context/ExtensionStateContext" @@ -16,11 +17,14 @@ interface ReasoningEffortSelectorProps { const ReasoningEffortSelector = ({ currentMode, - label = "Reasoning Effort", - description = "Higher effort improves depth, but uses more tokens.", + label, + description, allowedEfforts = OPENAI_REASONING_EFFORT_OPTIONS, defaultEffort = "medium", }: ReasoningEffortSelectorProps) => { + const { t } = useTranslation("settings") + const resolvedLabel = label ?? t("settings.reasoningEffort") + const resolvedDescription = description ?? t("settings.reasoningEffortDescription") const { apiConfiguration } = useExtensionState() const { handleModeFieldChange } = useApiConfigurationHandlers() const modeFields = getModeSpecificFields(apiConfiguration, currentMode) @@ -31,7 +35,7 @@ const ReasoningEffortSelector = ({ return (
- + updateSetting("mcpDisplayMode", v)} value={mcpDisplayMode}> - Plain Text - Rich Display - Markdown + {t("featureSettings.plainText")} + {t("featureSettings.richDisplay")} + {t("featureSettings.markdown")}
diff --git a/webview-ui/src/components/settings/sections/GeneralSettingsSection.tsx b/webview-ui/src/components/settings/sections/GeneralSettingsSection.tsx index e38660a6..72e51db2 100644 --- a/webview-ui/src/components/settings/sections/GeneralSettingsSection.tsx +++ b/webview-ui/src/components/settings/sections/GeneralSettingsSection.tsx @@ -1,4 +1,5 @@ import { VSCodeCheckbox, VSCodeLink } from "@vscode/webview-ui-toolkit/react" +import { useTranslation } from "react-i18next" import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip" import { useExtensionState } from "@/context/ExtensionStateContext" import PreferredLanguageSetting from "../PreferredLanguageSetting" @@ -10,6 +11,7 @@ interface GeneralSettingsSectionProps { } const GeneralSettingsSection = ({ renderSectionHeader }: GeneralSettingsSectionProps) => { + const { t } = useTranslation("settings") const { telemetrySetting, remoteConfigSettings } = useExtensionState() return ( @@ -21,7 +23,7 @@ const GeneralSettingsSection = ({ renderSectionHeader }: GeneralSettingsSectionP
@@ -50,14 +52,13 @@ const GeneralSettingsSection = ({ renderSectionHeader }: GeneralSettingsSectionP style={{ fontSize: "inherit", textDecoration: "underline" }}> telemetry overview {" "} - and{" "} + {t("settingsSections.telemetryDescription").split(".")[1] ? "" : ""}{" "} privacy policy {" "} - for more details.

diff --git a/webview-ui/src/components/settings/sections/RemoteConfigSection.tsx b/webview-ui/src/components/settings/sections/RemoteConfigSection.tsx index 40b3fb70..36e02ad2 100644 --- a/webview-ui/src/components/settings/sections/RemoteConfigSection.tsx +++ b/webview-ui/src/components/settings/sections/RemoteConfigSection.tsx @@ -1,6 +1,7 @@ import { EmptyRequest } from "@shared/proto/index.cline" import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react" import { useEffect, useRef, useState } from "react" +import { useTranslation } from "react-i18next" import { RemoteConfigToggle } from "@/components/account/RemoteConfigToggle" import { useClineAuth } from "@/context/ClineAuthContext" import { useExtensionState } from "@/context/ExtensionStateContext" @@ -23,6 +24,7 @@ function BaseRemoteConfigSection({ renderSectionHeader, children }: React.PropsW const AUTOMATIC_DELAY_MS = 30000 function RefreshButton() { + const { t } = useTranslation("settings") const [isLoading, setIsLoading] = useState(false) const [retryIn, setRetryIn] = useState(null) const intervalRef = useRef() @@ -69,12 +71,17 @@ interface SettingRowProps { } function SettingRow({ label, value, isSecret }: SettingRowProps) { + const { t } = useTranslation("settings") const displayValue = (() => { if (value === undefined || value === null) { - return Not configured + return {t("remoteConfig.notConfigured")} } if (typeof value === "boolean") { - return value ? Enabled : Disabled + return value ? ( + {t("remoteConfig.enabled")} + ) : ( + {t("remoteConfig.disabled")} + ) } if (isSecret && typeof value === "string" && value.length > 0) { return {"•".repeat(Math.min(value.length, 20))} @@ -108,6 +115,7 @@ interface TestButtonProps { } function TestButton({ label, onClick, disabled, successMessage }: TestButtonProps) { + const { t } = useTranslation("settings") const [isLoading, setIsLoading] = useState(false) const [result, setResult] = useState<{ success: boolean; message: string } | null>(null) const timeoutRef = useRef() @@ -125,9 +133,9 @@ function TestButton({ label, onClick, disabled, successMessage }: TestButtonProp setResult(null) try { await onClick() - setResult({ success: true, message: successMessage || "Success!" }) + setResult({ success: true, message: successMessage || t("remoteConfig.success") }) } catch (error) { - setResult({ success: false, message: error instanceof Error ? error.message : "Failed" }) + setResult({ success: false, message: error instanceof Error ? error.message : t("remoteConfig.failed") }) } finally { setIsLoading(false) timeoutRef.current = setTimeout(() => setResult(null), 5000) @@ -141,7 +149,7 @@ function TestButton({ label, onClick, disabled, successMessage }: TestButtonProp className={isLoading ? "animate-pulse" : ""} disabled={disabled || isLoading} onClick={handleClick}> - {isLoading ? "Testing..." : label} + {isLoading ? t("remoteConfig.testing") : label} {result && {result.message}}
@@ -149,6 +157,7 @@ function TestButton({ label, onClick, disabled, successMessage }: TestButtonProp } function OtelSettingsSection() { + const { t } = useTranslation("settings") const { remoteConfigSettings } = useExtensionState() const otelEnabled = remoteConfigSettings?.openTelemetryEnabled @@ -176,40 +185,55 @@ function OtelSettingsSection() { OpenTelemetry Configuration
- - - - - + + + + + {remoteConfigSettings?.openTelemetryOtlpMetricsEndpoint && ( - + )} {remoteConfigSettings?.openTelemetryOtlpLogsEndpoint && ( - + )} {remoteConfigSettings?.openTelemetryOtlpHeaders && ( )} {remoteConfigSettings?.openTelemetryMetricExportInterval && ( )} {remoteConfigSettings?.openTelemetryOtlpInsecure !== undefined && ( - + )} {remoteConfigSettings?.openTelemetryLogBatchSize && ( - + )} {remoteConfigSettings?.openTelemetryLogBatchTimeout && ( - + )} {remoteConfigSettings?.openTelemetryLogMaxQueueSize && ( - + )}
@@ -217,9 +241,9 @@ function OtelSettingsSection() {
)} @@ -228,6 +252,7 @@ function OtelSettingsSection() { } function PromptUploadingSection() { + const { t } = useTranslation("settings") const { remoteConfigSettings } = useExtensionState() const blobStoreConfig = remoteConfigSettings?.blobStoreConfig @@ -249,26 +274,37 @@ function PromptUploadingSection() { Prompt Uploading Configuration
- - - - {blobStoreConfig.endpoint && } - {blobStoreConfig.accountId && } - - - {blobStoreConfig.intervalMs && } - {blobStoreConfig.batchSize && } - {blobStoreConfig.maxRetries && } - {blobStoreConfig.maxQueueSize && } - + + + + {blobStoreConfig.endpoint && } + {blobStoreConfig.accountId && ( + + )} + + + {blobStoreConfig.intervalMs && ( + + )} + {blobStoreConfig.batchSize && ( + + )} + {blobStoreConfig.maxRetries && ( + + )} + {blobStoreConfig.maxQueueSize && ( + + )} +
- +
) } export function RemoteConfigSection({ renderSectionHeader }: RemoteConfigSectionProps) { + const { t } = useTranslation("settings") const { remoteConfigSettings, optOutOfRemoteConfig } = useExtensionState() const { activeOrganization } = useClineAuth() @@ -276,7 +312,7 @@ export function RemoteConfigSection({ renderSectionHeader }: RemoteConfigSection return (
-

You have opted out of remote config. Opt back in to apply it and see it here.

+

{t("remoteConfig.optedOut")}

@@ -290,7 +326,10 @@ export function RemoteConfigSection({ renderSectionHeader }: RemoteConfigSection

You haven't configured remote config yet. Do so through our{" "} - dashboard. + + {t("remoteConfig.dashboard")} + + .

@@ -302,9 +341,7 @@ export function RemoteConfigSection({ renderSectionHeader }: RemoteConfigSection return (
-

- These settings are managed by your organization's remote configuration. -

+

{t("remoteConfig.settingsManagedByOrg")}

diff --git a/webview-ui/src/components/settings/sections/TerminalSettingsSection.tsx b/webview-ui/src/components/settings/sections/TerminalSettingsSection.tsx index 1aced59c..c9bfaa47 100644 --- a/webview-ui/src/components/settings/sections/TerminalSettingsSection.tsx +++ b/webview-ui/src/components/settings/sections/TerminalSettingsSection.tsx @@ -1,6 +1,7 @@ import { UpdateTerminalConnectionTimeoutResponse } from "@shared/proto/index.cline" import { VSCodeCheckbox, VSCodeDropdown, VSCodeOption, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import React, { useState } from "react" +import { useTranslation } from "react-i18next" import { PlatformType } from "@/config/platform.config" import { useExtensionState } from "@/context/ExtensionStateContext" import { usePlatform } from "@/context/PlatformContext" @@ -14,6 +15,7 @@ interface TerminalSettingsSectionProps { } export const TerminalSettingsSection: React.FC = ({ renderSectionHeader }) => { + const { t } = useTranslation("settings") const { shellIntegrationTimeout, terminalReuseEnabled, @@ -33,9 +35,9 @@ export const TerminalSettingsSection: React.FC = ( setInputValue(value) - const seconds = parseFloat(value) + const seconds = Number.parseFloat(value) if (Number.isNaN(seconds) || seconds <= 0) { - setInputError("Please enter a positive number") + setInputError(t("settingsSections.enterPositiveNumber")) return } @@ -107,19 +109,19 @@ export const TerminalSettingsSection: React.FC = ( ))}

- Select the default terminal Cline will use. 'Default' uses your VSCode global setting. + {t("settingsSections.defaultTerminalProfileDescription")}

- +
handleTimeoutChange(event as Event)} - placeholder="Enter timeout in seconds" + placeholder={t("settingsSections.shellIntegrationPlaceholder")} value={inputValue} />
@@ -154,11 +156,11 @@ export const TerminalSettingsSection: React.FC = ( id="terminal-execution-mode" onChange={(event) => handleExecutionModeChange(event as Event)} value={vscodeTerminalExecutionMode ?? "vscodeTerminal"}> - VS Code Terminal - Background Exec + {t("settingsSections.vsCodeTerminal")} + {t("settingsSections.backgroundExec")}

- Choose whether Cline runs commands in the VS Code terminal or a background process. + {t("settingsSections.terminalExecutionModeDescription")}

)} diff --git a/webview-ui/src/components/settings/utils/pricingUtils.ts b/webview-ui/src/components/settings/utils/pricingUtils.ts index d86af2ef..3d014893 100644 --- a/webview-ui/src/components/settings/utils/pricingUtils.ts +++ b/webview-ui/src/components/settings/utils/pricingUtils.ts @@ -67,6 +67,6 @@ export const parsePrice = (value: string, defaultValue: number): number => { if (value === "" || value === ".") { return defaultValue } - const num = parseFloat(value) + const num = Number.parseFloat(value) return isNaN(num) ? defaultValue : num } diff --git a/webview-ui/src/components/settings/utils/useDebouncedInput.ts b/webview-ui/src/components/settings/utils/useDebouncedInput.ts index d096f6ce..0f380089 100644 --- a/webview-ui/src/components/settings/utils/useDebouncedInput.ts +++ b/webview-ui/src/components/settings/utils/useDebouncedInput.ts @@ -10,11 +10,7 @@ import { useDebounceEffect } from "@/utils/useDebounceEffect" * @param debounceMs - Debounce delay in milliseconds (default: 500ms) * @returns A tuple of [currentValue, setValue] similar to useState */ -export function useDebouncedInput( - initialValue: T, - onChange: (value: T) => void, - debounceMs: number = 100, -): [T, (value: T) => void] { +export function useDebouncedInput(initialValue: T, onChange: (value: T) => void, debounceMs = 100): [T, (value: T) => void] { // Local state to prevent jumpy input - initialize once const [localValue, setLocalValue] = useState(initialValue) diff --git a/webview-ui/src/components/ui/button.tsx b/webview-ui/src/components/ui/button.tsx index b31b7467..4ec79dca 100644 --- a/webview-ui/src/components/ui/button.tsx +++ b/webview-ui/src/components/ui/button.tsx @@ -24,14 +24,14 @@ const buttonVariants = cva( "bg-success/10 text-success border-[#176f2c] text-white hover:bg-[#197f31] hover:border-[#197f31] active:bg-[#156528] active:border-[#156528] hover:text-white", danger: "bg-[#c42b2b] border-[#c42b2b]! text-white! hover:bg-[#a82424]! hover:border-[#a82424]! active:bg-[#8f1f1f]! active:border-[#8f1f1f]!", }, - size: { - default: "py-1.5 px-4 [&_svg]:size-3", - sm: "py-1 px-3 text-sm [&_svg]:size-2", - xs: "p-1 text-xs [&_svg]:size-2", - lg: "py-4 px-8 [&_svg]:size-4 font-medium", - icon: "px-0.5 m-0 [&_svg]:size-2", - header: "py-1 px-4 [&_svg]:size-2.5", - }, + size: { + default: "py-1.5 px-4 [&_svg]:size-3", + sm: "py-1 px-3 text-sm [&_svg]:size-2", + xs: "p-1 text-xs [&_svg]:size-2", + lg: "py-4 px-8 [&_svg]:size-4 font-medium", + icon: "px-0.5 m-0 [&_svg]:size-2", + header: "py-1 px-4 [&_svg]:size-2.5", + }, }, defaultVariants: { variant: "default", diff --git a/webview-ui/src/components/ui/hooks/useOpenRouterKeyInfo.ts b/webview-ui/src/components/ui/hooks/useOpenRouterKeyInfo.ts index 14585ac3..46d5466a 100644 --- a/webview-ui/src/components/ui/hooks/useOpenRouterKeyInfo.ts +++ b/webview-ui/src/components/ui/hooks/useOpenRouterKeyInfo.ts @@ -86,7 +86,7 @@ export const useOpenRouterKeyInfo = (apiKey?: string) => { } const now = Date.now() - const cacheAge = moduleLastFetchTime ? now - moduleLastFetchTime : Infinity + const cacheAge = moduleLastFetchTime ? now - moduleLastFetchTime : Number.POSITIVE_INFINITY const isCacheStale = cacheAge >= CACHE_DURATION_MS const hasCache = !!moduleCachedData diff --git a/webview-ui/src/components/welcome/HomeHeader.tsx b/webview-ui/src/components/welcome/HomeHeader.tsx index d95bf543..8cdd7f37 100644 --- a/webview-ui/src/components/welcome/HomeHeader.tsx +++ b/webview-ui/src/components/welcome/HomeHeader.tsx @@ -1,4 +1,5 @@ import { EmptyRequest } from "@shared/proto/cline/common" +import { useTranslation } from "react-i18next" import ClineLogoSanta from "@/assets/ClineLogoSanta" import ClineLogoTired from "@/assets/ClineLogoTired" import ClineLogoVariable from "@/assets/ClineLogoVariable" @@ -11,6 +12,7 @@ interface HomeHeaderProps { const HomeHeader = ({ shouldShowQuickWins = false }: HomeHeaderProps) => { const { environment, lazyTeammateModeEnabled } = useExtensionState() + const { t } = useTranslation("common") const handleTakeATour = async () => { try { @@ -23,7 +25,7 @@ const HomeHeader = ({ shouldShowQuickWins = false }: HomeHeaderProps) => { // Lazy Teammate Mode takes priority, then December festive logo, then default const isDecember = new Date().getMonth() === 11 // 11 = December (0-indexed) const LogoComponent = lazyTeammateModeEnabled ? ClineLogoTired : isDecember ? ClineLogoSanta : ClineLogoVariable - const headingText = lazyTeammateModeEnabled ? "I guess I'm here to help" : "What can I do for you?" + const headingText = lazyTeammateModeEnabled ? t("homeHeader.lazyTeammateHeading") : t("homeHeader.defaultHeading") return (
@@ -39,7 +41,7 @@ const HomeHeader = ({ shouldShowQuickWins = false }: HomeHeaderProps) => { className="flex items-center gap-2 px-4 py-2 rounded-full border border-border-panel bg-white/2 hover:bg-list-background-hover transition-colors duration-150 ease-in-out text-code-foreground text-sm font-medium cursor-pointer" onClick={handleTakeATour} type="button"> - Take a Tour + {t("homeHeader.takeATour")}
diff --git a/webview-ui/src/components/welcome/QuickWinCard.tsx b/webview-ui/src/components/welcome/QuickWinCard.tsx index 63b71f15..c1386e7f 100644 --- a/webview-ui/src/components/welcome/QuickWinCard.tsx +++ b/webview-ui/src/components/welcome/QuickWinCard.tsx @@ -8,7 +8,7 @@ interface QuickWinCardProps { const renderIcon = (iconName?: string) => { if (!iconName) { - return + return } let iconClass = "codicon-rocket" @@ -25,7 +25,7 @@ const renderIcon = (iconName?: string) => { default: break } - return + return } const QuickWinCard: React.FC = ({ task, onExecute }) => { diff --git a/webview-ui/src/components/welcome/SuggestedTasks.tsx b/webview-ui/src/components/welcome/SuggestedTasks.tsx index 02eea58c..f9926385 100644 --- a/webview-ui/src/components/welcome/SuggestedTasks.tsx +++ b/webview-ui/src/components/welcome/SuggestedTasks.tsx @@ -1,10 +1,12 @@ import { NewTaskRequest } from "@shared/proto/cline/task" import React from "react" +import { useTranslation } from "react-i18next" import { TaskServiceClient } from "@/services/grpc-client" import QuickWinCard from "./QuickWinCard" import { QuickWinTask, quickWinTasks } from "./quickWinTasks" export const SuggestedTasks: React.FC<{ shouldShowQuickWins: boolean }> = ({ shouldShowQuickWins }) => { + const { t } = useTranslation("common") const handleExecuteQuickWin = async (prompt: string) => { await TaskServiceClient.newTask(NewTaskRequest.create({ text: prompt, images: [] })) } @@ -14,7 +16,9 @@ export const SuggestedTasks: React.FC<{ shouldShowQuickWins: boolean }> = ({ sho
{" "}

- Quick [Wins] with Cline + {t("suggestedTasks.title")} + {t("suggestedTasks.titleHighlight")} + {t("suggestedTasks.titleSuffix")}

{" "} diff --git a/webview-ui/src/components/welcome/WelcomeView.tsx b/webview-ui/src/components/welcome/WelcomeView.tsx index 276f489b..436778c1 100644 --- a/webview-ui/src/components/welcome/WelcomeView.tsx +++ b/webview-ui/src/components/welcome/WelcomeView.tsx @@ -1,6 +1,7 @@ import { BooleanRequest, EmptyRequest } from "@shared/proto/cline/common" import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react" import { memo, useEffect, useState } from "react" +import { useTranslation } from "react-i18next" import ClineLogoWhite from "@/assets/ClineLogoWhite" import ApiOptions from "@/components/settings/ApiOptions" import { useExtensionState } from "@/context/ExtensionStateContext" @@ -8,6 +9,7 @@ import { AccountServiceClient, StateServiceClient } from "@/services/grpc-client import { validateApiConfiguration } from "@/utils/validate" const WelcomeView = memo(() => { + const { t } = useTranslation("common") const { apiConfiguration, mode } = useExtensionState() const [apiErrorMessage, setApiErrorMessage] = useState(undefined) const [showApiOptions, setShowApiOptions] = useState(false) @@ -39,27 +41,23 @@ const WelcomeView = memo(() => { return (
-

Hi, I'm Cline

+

{t("welcome.title")}

- I can do all kinds of tasks thanks to breakthroughs in{" "} + {t("welcome.description")}{" "} - Claude 4.6 Sonnet's + {t("welcome.descriptionLink")} - agentic coding capabilities and access to tools that let me create & edit files, explore complex projects, use - a browser, and execute terminal commands (with your permission, of course). I can even use MCP to - create new tools and extend my own capabilities. + {t("welcome.descriptionCapabilities")} {t("welcome.descriptionPermission")}.{" "} + {t("welcome.descriptionMcp")}

-

- Sign up for an account to get started for free, or use an API key that provides access to models like Claude - Sonnet. -

+

{t("welcome.signupPrompt")}

- Get Started for Free + {t("welcome.getStartedFree")} {isLoading && ( @@ -72,7 +70,7 @@ const WelcomeView = memo(() => { appearance="secondary" className="mt-2.5 w-full" onClick={() => setShowApiOptions(!showApiOptions)}> - Use your own API key + {t("welcome.useOwnApiKey")} )} @@ -81,7 +79,7 @@ const WelcomeView = memo(() => {
- Let's go! + {t("welcome.letsGo")}
)} diff --git a/webview-ui/src/components/welcome/quickWinTasks.ts b/webview-ui/src/components/welcome/quickWinTasks.ts index 6d1ffb8b..9825999e 100644 --- a/webview-ui/src/components/welcome/quickWinTasks.ts +++ b/webview-ui/src/components/welcome/quickWinTasks.ts @@ -1,3 +1,5 @@ +import { useTranslation } from "react-i18next" + export interface QuickWinTask { id: string title: string @@ -8,6 +10,41 @@ export interface QuickWinTask { buttonText?: string } +const useQuickWinTasks = () => { + const { t } = useTranslation("common") + const quickWinTasks: QuickWinTask[] = [ + { + id: "nextjs_notetaking_app", + title: t("suggestedTasks.buildNextjsApp"), + description: t("suggestedTasks.buildNextjsAppDesc"), + icon: "WebAppIcon", + actionCommand: "cline/createNextJsApp", + prompt: "Make a beautiful Next.js notetaking app, using Tailwind CSS for styling. Set up the basic structure and a simple UI for adding and viewing notes.", + buttonText: ">", + }, + { + id: "terminal_cli_tool", + title: t("suggestedTasks.craftCliTool"), + description: t("suggestedTasks.craftCliToolDesc"), + icon: "TerminalIcon", + actionCommand: "cline/createCliTool", + prompt: "Make a terminal CLI tool using Node.js that organizes files in a directory by type, size, or date. It should have options to sort files into folders, show file statistics, find duplicates, and clean up empty directories. Include colorful output and progress indicators.", + buttonText: ">", + }, + { + id: "snake_game", + title: t("suggestedTasks.developGame"), + description: t("suggestedTasks.developGameDesc"), + icon: "GameIcon", + actionCommand: "cline/createSnakeGame", + prompt: "Make a classic Snake game using HTML, CSS, and JavaScript. The game should be playable in the browser, with keyboard controls for the snake, a scoring system, and a game over state.", + buttonText: ">", + }, + ] + return quickWinTasks +} + +// For backward compatibility, keep the static export (translations won't work here but this maintains the interface) export const quickWinTasks: QuickWinTask[] = [ { id: "nextjs_notetaking_app", @@ -37,3 +74,5 @@ export const quickWinTasks: QuickWinTask[] = [ buttonText: ">", }, ] + +export { useQuickWinTasks } diff --git a/webview-ui/src/components/worktrees/CreateWorktreeModal.tsx b/webview-ui/src/components/worktrees/CreateWorktreeModal.tsx index facd40f6..4b67d00f 100644 --- a/webview-ui/src/components/worktrees/CreateWorktreeModal.tsx +++ b/webview-ui/src/components/worktrees/CreateWorktreeModal.tsx @@ -3,6 +3,7 @@ import { CreateWorktreeRequest, SwitchWorktreeRequest } from "@shared/proto/clin import { VSCodeButton, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import { AlertCircle, AlertTriangle, Loader2, X } from "lucide-react" import { memo, useCallback, useEffect, useState } from "react" +import { useTranslation } from "react-i18next" import { WorktreeServiceClient } from "@/services/grpc-client" interface CreateWorktreeModalProps { @@ -15,6 +16,7 @@ interface CreateWorktreeModalProps { } const CreateWorktreeModal = ({ open, onClose, openAfterCreate = false, onSuccess }: CreateWorktreeModalProps) => { + const { t } = useTranslation("misc") const [newWorktreePath, setNewWorktreePath] = useState("") const [newBranchName, setNewBranchName] = useState("") const [isCreating, setIsCreating] = useState(false) @@ -98,12 +100,10 @@ const CreateWorktreeModal = ({ open, onClose, openAfterCreate = false, onSuccess return null } - const title = openAfterCreate ? "New Worktree" : "Create New Worktree" - const buttonText = openAfterCreate ? "Create & Open" : "Create Worktree" - const creatingText = openAfterCreate ? "Creating & Opening..." : "Creating..." - const description = openAfterCreate - ? "This will create a copy of your project on a new branch and open in a separate window." - : "This will create a copy of your project on a new branch." + const title = openAfterCreate ? t("worktrees.create.titleOpen") : t("worktrees.create.title") + const buttonText = openAfterCreate ? t("worktrees.create.createOpen") : t("worktrees.create.createWorktree") + const creatingText = openAfterCreate ? t("worktrees.create.creatingOpening") : t("worktrees.create.creating") + const description = openAfterCreate ? t("worktrees.create.descriptionOpen") : t("worktrees.create.description") return (

- No .worktreeinclude detected.{" "} + {t("worktrees.create.noWorktreeInclude")}{" "} - Learn more + {t("worktrees.learnMore")}

)}
- + setNewBranchName((e.target as HTMLInputElement).value)} - placeholder="feature/my-feature" + placeholder={t("worktrees.create.branchNamePlaceholder")} value={newBranchName}> {newBranchName && (

- Your new copy will be checked out to this branch. + {t("worktrees.create.branchNameHint")}

- + setNewWorktreePath((e.target as HTMLInputElement).value)} - placeholder="../my-feature-worktree" + placeholder={t("worktrees.create.folderPathPlaceholder")} value={newWorktreePath}> {newWorktreePath && (

- Where the project will be copied for the worktree. + {t("worktrees.create.folderPathHint")}

{createError && ( @@ -207,7 +207,7 @@ const CreateWorktreeModal = ({ open, onClose, openAfterCreate = false, onSuccess {isLoadingDefaults ? ( <> - Loading... + {t("worktrees.create.loading")} ) : isCreating ? ( <> diff --git a/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx b/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx index cc5ef4ea..ceeb81b8 100644 --- a/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx +++ b/webview-ui/src/components/worktrees/DeleteWorktreeModal.tsx @@ -1,6 +1,7 @@ import { VSCodeButton, VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react" import { AlertTriangle, Loader2, X } from "lucide-react" import { memo, useCallback, useState } from "react" +import { useTranslation } from "react-i18next" import { Button } from "@/components/ui/button" interface DeleteWorktreeModalProps { @@ -12,6 +13,7 @@ interface DeleteWorktreeModalProps { } const DeleteWorktreeModal = ({ open, onClose, onConfirm, worktreePath, branchName }: DeleteWorktreeModalProps) => { + const { t } = useTranslation("misc") const [isDeleting, setIsDeleting] = useState(false) const [deleteBranch, setDeleteBranch] = useState(false) @@ -51,12 +53,12 @@ const DeleteWorktreeModal = ({ open, onClose, onConfirm, worktreePath, branchNam {/* Title row with icon */}
-

Delete Worktree

+

{t("worktrees.delete.title")}

{/* Content */}

- This will delete the worktree directory at{" "} + {t("worktrees.delete.description")} {worktreePath}

@@ -66,29 +68,30 @@ const DeleteWorktreeModal = ({ open, onClose, onConfirm, worktreePath, branchNam onChange={(e) => setDeleteBranch((e.target as HTMLInputElement).checked)} /> - Also delete branch {branchName} + {t("worktrees.delete.alsoDeleteBranch")} + {branchName} {deleteBranch && (

- Warning: Unpushed commits on this branch will be lost. + {t("worktrees.delete.warningUnpushed")}

)} {/* Buttons */}
- Cancel + {t("worktrees.delete.cancel")}
diff --git a/webview-ui/src/components/worktrees/WorktreesView.tsx b/webview-ui/src/components/worktrees/WorktreesView.tsx index 432545f3..d44f45a1 100644 --- a/webview-ui/src/components/worktrees/WorktreesView.tsx +++ b/webview-ui/src/components/worktrees/WorktreesView.tsx @@ -10,6 +10,7 @@ import { import { VSCodeButton, VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react" import { AlertCircle, Check, ExternalLink, FolderOpen, GitBranch, GitMerge, Loader2, Plus, Trash2, X } from "lucide-react" import { memo, useCallback, useEffect, useState } from "react" +import { useTranslation } from "react-i18next" import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip" import { useExtensionState } from "@/context/ExtensionStateContext" import { FileServiceClient, TaskServiceClient, WorktreeServiceClient } from "@/services/grpc-client" @@ -22,6 +23,7 @@ type WorktreesViewProps = { } const WorktreesView = ({ onDone }: WorktreesViewProps) => { + const { t } = useTranslation("misc") const { environment } = useExtensionState() const [worktrees, setWorktrees] = useState([]) const [isLoading, setIsLoading] = useState(true) @@ -241,24 +243,23 @@ Please help me resolve these merge conflicts, then complete the merge, and delet {/* Sticky Header with title and Done button */}

- Worktrees + {t("worktrees.title")}

- Done + {t("worktrees.done")}
{/* Scrollable Content */}
{/* Description */}

- Git worktrees let you work on multiple branches at the same time, each in its own folder. Open worktrees in - their own windows so Cline can work on multiple tasks in parallel.{" "} + {t("worktrees.description")} - Learn more + {t("worktrees.learnMore")}

@@ -273,35 +274,35 @@ Please help me resolve these merge conflicts, then complete the merge, and delet {hasWorktreeInclude ? (

- .worktreeinclude detected.{" "} + {t("worktrees.worktreeIncludeDetected")}{" "} - Learn more + {t("worktrees.learnMore")}

) : (

- Tip: Create a{" "} + {t("worktrees.tipCreateFile")} .worktreeinclude {" "} - file to automatically copy files like{" "} + {t("worktrees.fileToAutoCopy")} node_modules/ {" "} - to new worktrees, so you don't have to reinstall dependencies.{" "} + {t("worktrees.toNewWorktrees")} - Learn more + {t("worktrees.learnMore")}

{hasGitignore && ( @@ -312,10 +313,10 @@ Please help me resolve these merge conflicts, then complete the merge, and delet {isCreatingWorktreeInclude ? ( <> - Creating... + {t("worktrees.creating")} ) : ( - "Create from .gitignore" + t("worktrees.createFromGitignore") )} )} @@ -328,25 +329,19 @@ Please help me resolve these merge conflicts, then complete the merge, and delet {isLoading ? (
- Loading... + {t("worktrees.loading")}
) : isMultiRoot ? (
-

Multi-folder workspace detected

-

- Worktrees are not supported when multiple folders are open in the same workspace. Please open a single - repository folder to use this feature. -

+

{t("worktrees.multiFolderDetected")}

+

{t("worktrees.multiFolderDesc")}

) : isSubfolder ? (
-

Subfolder of a git repository

-

- You have a subfolder open instead of the repository root. Please open the root folder to use - worktrees: -

+

{t("worktrees.subfolderDetected")}

+

{t("worktrees.subfolderDesc")}

{gitRootPath} @@ -354,22 +349,20 @@ Please help me resolve these merge conflicts, then complete the merge, and delet ) : !isGitRepo ? (
-

- Worktrees require a git repository. Please initialize git to use worktrees. -

+

{t("worktrees.requireGit")}

) : error ? (

{error}

- Retry + {t("worktrees.retry")}
) : worktrees.length === 0 ? (
-

No worktrees found.

+

{t("worktrees.noWorktrees")}

) : ( <> @@ -390,36 +383,35 @@ Please help me resolve these merge conflicts, then complete the merge, and delet
- {worktree.branch || (worktree.isDetached ? "HEAD (detached)" : "unknown")} + {worktree.branch || + (worktree.isDetached + ? t("worktrees.headDetached") + : t("worktrees.unknown"))}
{isMainWorktree(worktree) && ( - Primary + {t("worktrees.primary")} - - The original worktree where your .git directory lives. - + {t("worktrees.primaryTooltip")} )} {worktree.isCurrent && ( - Current + {t("worktrees.current")} - - This is the worktree currently open in this window. - + {t("worktrees.currentTooltip")} )} {worktree.isLocked && ( - Locked + {t("worktrees.locked")} )}
@@ -435,7 +427,9 @@ Please help me resolve these merge conflicts, then complete the merge, and delet - Open in current window + + {t("worktrees.openCurrentWindow")} + @@ -445,7 +439,9 @@ Please help me resolve these merge conflicts, then complete the merge, and delet - Open in new window + + {t("worktrees.openNewWindow")} + )} @@ -460,7 +456,7 @@ Please help me resolve these merge conflicts, then complete the merge, and delet - Merge into {getMainBranch()} + {t("worktrees.mergeInto", { branch: getMainBranch() })} @@ -471,7 +467,9 @@ Please help me resolve these merge conflicts, then complete the merge, and delet - Delete this worktree + + {t("worktrees.deleteWorktree")} + )} @@ -497,7 +495,7 @@ Please help me resolve these merge conflicts, then complete the merge, and delet }}> setShowCreateForm(true)} style={{ width: "100%" }}> - New Worktree + {t("worktrees.newWorktree")}
)} @@ -535,7 +533,7 @@ Please help me resolve these merge conflicts, then complete the merge, and delet
-

Merge Worktree

+

{t("worktrees.merge.title")}

{/* Success state */} @@ -546,7 +544,7 @@ Please help me resolve these merge conflicts, then complete the merge, and delet

{mergeResult.message}

- Done + {t("worktrees.merge.done")}
) : mergeResult?.hasConflicts ? ( @@ -555,9 +553,11 @@ Please help me resolve these merge conflicts, then complete the merge, and delet
-

Merge conflicts detected

+

+ {t("worktrees.merge.mergeConflictsDetected")} +

- The following files have conflicts: + {t("worktrees.merge.followingFilesConflicts")}

    {mergeResult.conflictingFiles.slice(0, 3).map((file) => ( @@ -565,7 +565,9 @@ Please help me resolve these merge conflicts, then complete the merge, and delet ))} {mergeResult.conflictingFiles.length > 3 && (
  • - ...and {mergeResult.conflictingFiles.length - 3} more + {t("worktrees.merge.andMore", { + count: mergeResult.conflictingFiles.length - 3, + })}
  • )}
@@ -574,10 +576,10 @@ Please help me resolve these merge conflicts, then complete the merge, and delet
- Ask Cline to Resolve + {t("worktrees.merge.askClineToResolve")} - I'll Resolve Manually + {t("worktrees.merge.resolveManually")}
@@ -585,11 +587,11 @@ Please help me resolve these merge conflicts, then complete the merge, and delet /* Default state - confirm merge */

- This will merge branch{" "} + {t("worktrees.merge.willMergeBranch")} {mergeWorktree.branch} {" "} - into{" "} + {t("worktrees.merge.into")} {getMainBranch()} @@ -601,7 +603,7 @@ Please help me resolve these merge conflicts, then complete the merge, and delet checked={deleteAfterMerge} onChange={(e) => setDeleteAfterMerge((e.target as HTMLInputElement).checked)} /> - Delete worktree after successful merge + {t("worktrees.merge.deleteAfterMerge")} {mergeError && ( @@ -613,18 +615,18 @@ Please help me resolve these merge conflicts, then complete the merge, and delet

- Cancel + {t("worktrees.merge.cancel")} {isMerging ? ( <> - Merging... + {t("worktrees.merge.merging")} ) : ( <> - Merge + {t("worktrees.merge.merge")} )} diff --git a/webview-ui/src/locales/en/common-misc.json b/webview-ui/src/locales/en/common-misc.json index 891e1811..fa10b2d0 100644 --- a/webview-ui/src/locales/en/common-misc.json +++ b/webview-ui/src/locales/en/common-misc.json @@ -162,6 +162,7 @@ "arguments": "Arguments", "requestTimeout": "Request Timeout", "restarting": "Restarting...", + "serverDisabled": "Server Disabled", "restartServerBtn": "Restart Server", "requiresApiKey": "Requires API key" }, diff --git a/webview-ui/src/locales/zh-CN/common-misc.json b/webview-ui/src/locales/zh-CN/common-misc.json index e85b6401..311ab2f0 100644 --- a/webview-ui/src/locales/zh-CN/common-misc.json +++ b/webview-ui/src/locales/zh-CN/common-misc.json @@ -162,6 +162,7 @@ "arguments": "参数", "requestTimeout": "请求超时", "restarting": "正在重启...", + "serverDisabled": "服务器已禁用", "restartServerBtn": "重启服务器", "requiresApiKey": "需要 API 密钥" }, diff --git a/webview-ui/src/main.tsx b/webview-ui/src/main.tsx index 5468af79..059f3bd7 100644 --- a/webview-ui/src/main.tsx +++ b/webview-ui/src/main.tsx @@ -1,5 +1,6 @@ import { StrictMode } from "react" import { createRoot } from "react-dom/client" +import "./i18n/config" import "./main.css" import "./index.css" import App from "./App.tsx"