Skip to content

chore(vscode): remove unused translation keys - #12602

Merged
marius-kilocode merged 2 commits into
mainfrom
identify-unused-translations
Jul 28, 2026
Merged

chore(vscode): remove unused translation keys#12602
marius-kilocode merged 2 commits into
mainfrom
identify-unused-translations

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

The VS Code translation dictionaries accumulated hundreds of keys copied from upstream or left behind by retired components. Keeping those keys synchronized across every locale creates substantial maintenance churn and obscures real translation coverage gaps.

This removes unreferenced keys from the Kilo-owned sidebar, Agent Manager, shared Kilo overrides, and autocomplete dictionaries while leaving upstream-owned packages/ui translations untouched.

A conservative unit lint now checks Kilo-owned dictionaries against production source and resource files. It recognizes exact, template, prefix, backend-provided, and explicitly protected runtime keys, and directs contributors to review external/runtime consumers instead of deleting flagged keys automatically. This keeps locale files aligned with shipped surfaces without adding upstream merge conflicts or risking protocol-driven translations.

@marius-kilocode
marius-kilocode enabled auto-merge (squash) July 28, 2026 12:57
@marius-kilocode
marius-kilocode merged commit 5d87ca5 into main Jul 28, 2026
32 checks passed
@marius-kilocode
marius-kilocode deleted the identify-unused-translations branch July 28, 2026 13:08
{ name: "host", dict: hostEn, roots: [VSCODE], runtime: [] },
] as const

const EXACT_RE = /["'`]([a-zA-Z][a-zA-Z0-9_]*(?:[.:][a-zA-Z0-9_]+)+)["'`]/g

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: Regex-based "used" detection scans raw file text, including comments/prose

EXACT_RE/PREFIX_RE/DYNAMIC_RE (lines 78-80) run over the entire raw text of every scanned file (text.matchAll(...)), not just executable string-literal positions. SOURCE_GLOB even includes .md/.mdx. This means a key or key-prefix mentioned inside a // comment, JSDoc example, or markdown prose is enough to mark it "used" and suppress the lint failure - a truly dead key can be kept alive indefinitely by a stray comment referencing its name. Since the test's explicit goal is to catch keys that "lose their last usage during refactors," it's worth noting this loophole so reviewers don't rely on a passing test as strong evidence a flagged-and-then-"fixed" key is genuinely used.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

path.join(REPO, "packages/kilo-gateway"),
]

const pools = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: packages/kilo-jetbrains is never scanned, so JetBrains-only key usage relies entirely on the manually curated runtime prefix lists

None of the roots in pools (line 63) or WEBVIEW_ROOTS (line 56) point at packages/kilo-jetbrains. Some shared protocol-style keys (e.g. plan.followup.question, settings.providers.note.*) are consumed directly from the JetBrains plugin (Kotlin/.properties), and this currently only avoids false failures because those exact prefixes already happen to be listed under runtime (lines 64/70-71/73). Any future key that's added to a Kilo-i18n dictionary and consumed only from the JetBrains side - without also adding its prefix to runtime - will be incorrectly flagged as dead and fail CI even though it's genuinely used. Consider either scanning the JetBrains source tree directly (SOURCE_GLOB on line 81 already includes kt,kts,java extensions, suggesting this was intended) or documenting that runtime must be kept in sync manually.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

---
"kilo-code": patch
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SUGGESTION: Changeset description reads as internal implementation notes rather than a user-facing summary

Removing unused i18n dictionary keys and adding an internal lint test has no user-visible effect, and the current text lists internal subsystems (Agent Manager, sidebar webview, kilo-i18n, autocomplete) and describes the added test - details end users reading release notes won't find meaningful. Per AGENTS.md, changeset text should describe what changed from a user's perspective. Consider trimming this to something like "Clean up unused translation strings" (or confirm this specific patch-only cleanup should even ship a changeset, since it has no functional/user impact).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/kilo-vscode/tests/unit/i18n-unused-keys.test.ts 78 "Used" detection scans raw file text (comments/markdown included), so a key can be kept "alive" by a stray comment mentioning its name
packages/kilo-vscode/tests/unit/i18n-unused-keys.test.ts 63 packages/kilo-jetbrains is never scanned; future JetBrains-only keys will be false-flagged unless manually added to runtime

SUGGESTION

File Line Issue
.changeset/tidy-am-i18n-keys.md 4 Changeset description reads as internal implementation notes rather than a user-facing summary
Files Reviewed (85 files)
  • packages/kilo-vscode/tests/unit/i18n-unused-keys.test.ts - 2 issues
  • .changeset/tidy-am-i18n-keys.md - 1 issue
  • packages/kilo-docs/source-links.md - no issues
  • packages/kilo-i18n/src/*.ts (20 locales) - verified all locales remove the same key set as en.ts, no orphaned keys, no syntax breakage
  • packages/kilo-vscode/src/services/i18n/autocomplete/*.ts (20 locales) - consistent removals across all locales
  • packages/kilo-vscode/webview-ui/agent-manager/i18n/*.ts (20 locales) - consistent removals across all locales
  • packages/kilo-vscode/webview-ui/src/i18n/*.ts (20 locales) - consistent removals across all locales

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-5 · Input: 40 · Output: 13.3K · Cached: 1.1M

Review guidance: REVIEW.md from base branch main

t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
* chore(vscode): remove unused translation keys

* docs(kilo-docs): refresh source links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants