Skip to content

feat: expand webview i18n lint coverage and remove hardcoded strings#6283

Open
sonwr wants to merge 1 commit intoKilo-Org:mainfrom
sonwr:fix/webview-i18n-hardcoded-strings
Open

feat: expand webview i18n lint coverage and remove hardcoded strings#6283
sonwr wants to merge 1 commit intoKilo-Org:mainfrom
sonwr:fix/webview-i18n-hardcoded-strings

Conversation

@sonwr
Copy link

@sonwr sonwr commented Feb 25, 2026

Summary

Implements #6233 by expanding i18n lint coverage across webview TSX files and replacing remaining hardcoded UI strings with translation keys.

Problem

Some webview TSX files still contained hardcoded user-facing strings, and i18n lint coverage was limited to Agent Manager files only.

Scope

  • Expanded test coverage from Agent Manager TSX files to all webview TSX files.
  • Replaced hardcoded strings in the targeted webview components with language.t(...) keys.
  • Added missing i18n keys across locale files.

What changed

1) i18n lint/test coverage expansion

  • Renamed:
    • packages/kilo-vscode/tests/unit/agent-manager-i18n.test.ts
    • -> packages/kilo-vscode/tests/unit/webview-i18n.test.ts
  • Updated file collection logic to scan all webview TSX files:
    • globSync("webview-ui/**/*.tsx", { cwd: ROOT, absolute: true })

2) Hardcoded UI string removal

Replaced hardcoded literals with translation keys in:

  • KiloNotifications.tsx
  • PromptInput.tsx
  • ProvidersTab.tsx
  • DisplayTab.tsx
  • ContextTab.tsx
  • ProfileView.tsx
  • App.tsx
  • AgentBehaviourTab.tsx

3) Locale key additions

Added missing keys to locale files (en + all existing locale bundles):

  • notifications.dismiss|previous|next|empty
  • prompt.fileMention.empty
  • prompt.image.remove
  • settings.providers.selectProvider
  • settings.display.username.placeholder
  • settings.context.watcherPatterns.placeholder
  • profile.account
  • nav.marketplace
  • settings.agentBehaviour.*.placeholder and MCP command/url labels

Validation

  • Performed static verification of replacements and key presence across modified files.
  • Note: full test execution in this environment is blocked because the repo is bun-configured and bun is not available on this host.

Risk

Low-to-medium:

  • UI text/path changes only.
  • No runtime business-logic/state-machine changes.

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

<div class="kilo-notifications-nav">
<button class="kilo-notifications-nav-btn" onClick={prev} title="Previous">
<Icon name="arrow-left" size="small" />
<button class="kilo-notifications-nav-btn" onClick={prev} title={language.t("notifications.previous")}> <Icon name="arrow-left" size="small" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Formatting issue — the <Icon> component is on the same line as the button's closing >, with excessive whitespace. This appears to be a merge artifact where the line break was lost. The same issue occurs on line 57.

Suggested change
<button class="kilo-notifications-nav-btn" onClick={prev} title={language.t("notifications.previous")}> <Icon name="arrow-left" size="small" />
<button class="kilo-notifications-nav-btn" onClick={prev} title={language.t("notifications.previous")}>

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Feb 25, 2026

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 2
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/components/chat/KiloNotifications.tsx 52, 57 <Icon> component is on the same line as the button's closing > with excessive whitespace — appears to be a merge artifact where line breaks were lost

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/src/i18n/en.ts 1089 notifications.empty i18n key is added to all 15 locale files but never referenced in any component code — unused/dead key
packages/kilo-vscode/webview-ui/src/i18n/*.ts All 18 new i18n keys are added with English values in all non-English locale files (ar, br, bs, da, de, es, fr, ja, ko, no, pl, ru, th, zh, zht). This is common for initial key addition but translations should be provided
Files Reviewed (25 files)
  • packages/kilo-vscode/tests/unit/webview-i18n.test.ts - 0 issues (renamed from agent-manager-i18n.test.ts, expanded glob scope)
  • packages/kilo-vscode/webview-ui/src/App.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/ProfileView.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/KiloNotifications.tsx - 1 issue (formatting)
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/settings/AgentBehaviourTab.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/settings/ContextTab.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/settings/DisplayTab.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/settings/ProvidersTab.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ar.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/br.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/bs.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/da.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/de.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts - 1 issue (unused key)
  • packages/kilo-vscode/webview-ui/src/i18n/es.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/fr.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ja.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ko.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/no.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/pl.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ru.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/th.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zh.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zht.ts - 0 issues

Fix these issues in Kilo Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant