microsoft / microsoft/vscode-documentdb

Localization strategy for shell completions and internal packages with static English strings

Open
#603 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
31
Forks
22
Avg merge
2d 20h
Merged PRs (30d)
21

Description

Problem

Several internal packages and modules contain hardcoded English strings that are user-facing but cannot be easily localized with the current vscode.l10n.t() / @vscode/l10n approach:

1. Shell Completion Provider (ShellCompletionProvider.ts)

Completion candidate detail strings (e.g., 'Show databases or collections', 'Switch to a database') and method descriptions from getMethodsByTarget() are hardcoded English. These display in the terminal completion picker.

Challenge: The shell completion module is platform-neutral and doesn't import vscode.l10n. The strings come from method registries that are static data, not call-site strings. The l10n tooling (npm run l10n) extracts strings from l10n.t() calls to build the bundle — if strings are defined in a registry/constant file without l10n.t(), they won't be extracted.

2. documentdb-constants package

Contains help text, operator descriptions, and documentation strings embedded as static data. These are consumed across multiple surfaces (Collection View, Playground, Shell) but are hardcoded English.

3. documentdb-shell-api-types package

Method descriptions in the method registry are English-only.

The Core Challenge

The l10n bundle generation (npm run l10n) works by statically extracting l10n.t('...') call sites. For data that's defined as constants/registries:

  • Wrapping each constant in l10n.t() at definition site might work but needs verification that the extraction tooling handles it
  • Alternatively, localization could happen at the consumption site, but that requires knowing all the possible strings ahead of time
  • For packages consumed via workspace references, the l10n bundle is the extension's bundle.l10n.json — package-level l10n bundles aren't a thing yet

Possible Approaches

  1. Wrap static strings at definition in l10n.t() — verify extraction works for @vscode/l10n in packages
  2. Create a mapping layer at the extension boundary that localizes known strings from packages
  3. Accept English-only for terminal/shell output (shell convention) but localize picker/completion UI
  4. Defer to a future l10n infrastructure that supports package-level bundles

Decision Needed

Which strings are considered "user-facing" per project rules:

  • Terminal completion details in the picker UI?
  • Shell help text output?
  • Operator/function documentation in hover tooltips?

References

  • PR #573 review issue H2
  • src/documentdb/shell/ShellCompletionProvider.ts
  • packages/documentdb-constants/
  • packages/documentdb-shell-api-types/src/methodRegistry.ts

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/documentdb/shell/ShellCompletionProvider.ts, packages/documentdb-constants/, packages/documentdb-shell-api-types/src/methodRegistry.ts, and the npm run l10n workflow. Verify how @vscode/l10n extraction handles static registry data and determine which completion, shell, and documentation strings are user-facing. Done means a documented localization strategy and a project decision on the listed alternatives and string categories.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
localization, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.