feat: add Brazilian Portuguese (pt-BR) localization#202
Open
corazzione wants to merge 2 commits intoyoavbls:mainfrom
Open
feat: add Brazilian Portuguese (pt-BR) localization#202corazzione wants to merge 2 commits intoyoavbls:mainfrom
corazzione wants to merge 2 commits intoyoavbls:mainfrom
Conversation
Implements i18n support using the @vscode/l10n API (VS Code standard since v1.73) and adds a complete pt-BR translation bundle. Changes: - Add `"l10n": "./l10n"` to extension package.json so VS Code picks up locale bundles automatically - Add @vscode/l10n dependency to @pretty-ts-errors/vscode-formatter - Wrap all user-facing UI strings with l10n.t() / vscode.l10n.t(): - Tooltip titles in actions.ts (5 strings) - "⚠ Error" label in errorTitle.ts - Empty state, pinned error labels in webviewViewProvider.ts - Clipboard notification in copyError.ts - Inject translated strings into webview HTML via window.__i18n so the sandboxed webview context can also display localized text - Add apps/vscode-extension/l10n/bundle.l10n.pt-BR.json with 12 Brazilian Portuguese translations Closes yoavbls#144
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds full Brazilian Portuguese (pt-BR) i18n support using the standard
@vscode/l10nAPI (available since VS Code 1.73).Closes #144
What changed
apps/vscode-extension/package.json— added"l10n": "./l10n"so VS Code auto-loads locale bundlespackages/vscode-formatter/package.json— added@vscode/l10ndependencyapps/vscode-extension/l10n/bundle.l10n.pt-BR.json— 12 translated strings (new file)packages/vscode-formatter/src/components/actions.ts— wrapped 5 tooltip titles withl10nT()packages/vscode-formatter/src/components/errorTitle.ts— wrapped "Error" labelapps/vscode-extension/src/provider/webviewViewProvider.ts— wrapped 4 UI stringsapps/vscode-extension/src/commands/copyError.ts— wrapped clipboard notificationapps/vscode-extension/src/provider/markdownWebviewProvider.ts— injectswindow.__i18ninto webview HTML with translated stringsapps/vscode-extension/webview/index.js— reads fromwindow.__i18n(webview has no direct access to VS Code l10n API)How it works
VS Code detects the user's display language and automatically loads the matching
bundle.l10n.{locale}.jsonfrom thel10n/folder declared inpackage.json. No configuration needed by the user. Falls back to English for any other locale.Adding support for additional languages only requires a new
bundle.l10n.{locale}.jsonfile — no code changes needed.Test plan
pt-BR(Configure Display Languagecommand)