Skip to content

Replace vscode l10n-dev with local localization generator - #64454

Open
Jake Bailey (jakebailey) wants to merge 3 commits into
microsoft:mainfrom
jakebailey:lightweight-l10n
Open

Jake Bailey (jakebailey) wants to merge 3 commits into
microsoft:mainfrom
jakebailey:lightweight-l10n

Conversation

@jakebailey

Copy link
Copy Markdown
Member

The extension only needs string extraction and pseudo-localization, but @vscode/l10n-dev pulls in a large dependency tree. Generate these resources with existing repository tooling instead, which is close enough for us, I think!

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

Path-depth sorting produces platform-dependent bundle ordering on Windows.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Replaces @vscode/l10n-dev with lightweight repository tooling for extension localization.

Changes:

  • Adds static string extraction and pseudo-localization.
  • Adds generator tests and cache tracking.
  • Removes the dependency and its transitive packages.
File Description
tools/​scripts/​gen/​extensionLocalization.mts Implements localization generation.
tools/​scripts/​gen/​extensionLocalization.test.mts Tests extraction and pseudo-localization.
packages/​vscode-typescript/​package.json Uses the local generator.
package-lock.json Removes obsolete dependencies.
Herebyfile.mjs Tracks generator changes in caches.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/scripts/gen/extensionLocalization.mts Outdated
The extension only needs extraction of literal messages and pseudo-
localization, but @vscode/l10n-dev adds a large dependency tree.
Generate these resources with existing tooling and reject unsupported
VS Code import styles instead of silently omitting strings.
Source-file order does not affect localization lookup, and sorting it
requires platform-sensitive path handling. Order messages by their keys
instead for deterministic output.
SourceFile.parseDiagnostics is not part of the public TypeScript API,
so the generator fails type-checking. The extension build reports syntax
errors without depending on this internal field.

This branch has not been deployed

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

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

2 participants