diff --git a/packages/kilo-vscode/tests/unit/agent-manager-i18n.test.ts b/packages/kilo-vscode/tests/unit/webview-i18n.test.ts similarity index 97% rename from packages/kilo-vscode/tests/unit/agent-manager-i18n.test.ts rename to packages/kilo-vscode/tests/unit/webview-i18n.test.ts index 691b8a7ab67..e666cf9efb7 100644 --- a/packages/kilo-vscode/tests/unit/agent-manager-i18n.test.ts +++ b/packages/kilo-vscode/tests/unit/webview-i18n.test.ts @@ -21,12 +21,10 @@ import { describe, it, expect } from "bun:test" import { Project, SyntaxKind, Node } from "ts-morph" import path from "node:path" +import { globSync } from "glob" const ROOT = path.resolve(import.meta.dir, "../..") -const TSX_FILES = [ - path.join(ROOT, "webview-ui/agent-manager/AgentManagerApp.tsx"), - path.join(ROOT, "webview-ui/agent-manager/sortable-tab.tsx"), -] +const TSX_FILES = globSync("webview-ui/**/*.tsx", { cwd: ROOT, absolute: true }) /** * Props whose string values are user-visible and must be localized. @@ -321,10 +319,10 @@ function findTranslationShadowViolations(): ShadowViolation[] { return results } -describe("Agent Manager i18n — no hardcoded strings", () => { +describe("Webview i18n — no hardcoded strings", () => { const violations = findViolations() - it("should have no hardcoded user-facing strings in agent manager TSX files", () => { + it("should have no hardcoded user-facing strings in webview TSX files", () => { if (violations.length > 0) { const report = violations.map((v) => ` ${v.file}:${v.line} [${v.context}] "${v.text}"`).join("\n") expect(violations, `Found ${violations.length} hardcoded string(s):\n${report}`).toEqual([]) @@ -333,7 +331,7 @@ describe("Agent Manager i18n — no hardcoded strings", () => { }) }) -describe("Agent Manager i18n — no t() shadowing", () => { +describe("Webview i18n — no t() shadowing", () => { const shadows = findTranslationShadowViolations() it("should not shadow the t() translation function in callbacks", () => { diff --git a/packages/kilo-vscode/webview-ui/src/App.tsx b/packages/kilo-vscode/webview-ui/src/App.tsx index 8de7e3d14f4..86a6f8c2885 100644 --- a/packages/kilo-vscode/webview-ui/src/App.tsx +++ b/packages/kilo-vscode/webview-ui/src/App.tsx @@ -15,7 +15,7 @@ import { ServerProvider, useServer } from "./context/server" import { ProviderProvider, useProvider } from "./context/provider" import { ConfigProvider } from "./context/config" import { SessionProvider, useSession } from "./context/session" -import { LanguageProvider } from "./context/language" +import { LanguageProvider, useLanguage } from "./context/language" import { ChatView } from "./components/chat" import { KiloNotifications } from "./components/chat/KiloNotifications" import SessionList from "./components/history/SessionList" @@ -128,6 +128,7 @@ const AppContent: Component = () => { const [currentView, setCurrentView] = createSignal("newTask") const session = useSession() const server = useServer() + const language = useLanguage() const handleViewAction = (action: string) => { switch (action) { @@ -189,7 +190,7 @@ const AppContent: Component = () => { - + diff --git a/packages/kilo-vscode/webview-ui/src/components/ProfileView.tsx b/packages/kilo-vscode/webview-ui/src/components/ProfileView.tsx index 69adb90dfed..cfae207ad1b 100644 --- a/packages/kilo-vscode/webview-ui/src/components/ProfileView.tsx +++ b/packages/kilo-vscode/webview-ui/src/components/ProfileView.tsx @@ -191,7 +191,7 @@ const ProfileView: Component = (props) => { margin: "0 0 8px 0", }} > - Account + {language.t("profile.account")}