microsoft / microsoft/vscode-documentdb
Localization strategy for shell completions and internal packages with static English strings
Nobody has claimed this yet.
- 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
- Wrap static strings at definition in
l10n.t()— verify extraction works for@vscode/l10nin packages - Create a mapping layer at the extension boundary that localizes known strings from packages
- Accept English-only for terminal/shell output (shell convention) but localize picker/completion UI
- 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.tspackages/documentdb-constants/packages/documentdb-shell-api-types/src/methodRegistry.ts
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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