Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension Host (Worker) isn't localized #192808

Open
TylerLeonhardt opened this issue Sep 11, 2023 · 2 comments · May be fixed by #199258
Open

Extension Host (Worker) isn't localized #192808

TylerLeonhardt opened this issue Sep 11, 2023 · 2 comments · May be fixed by #199258
Assignees
Labels
extension-host Extension host issues feature-request Request for new features or functionality l10n-platform Localization platform issues (not wrong translations)
Milestone

Comments

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Sep 11, 2023

image

The localize call:

const name = initData.remote.isRemote ? localize('remote', "Extension Host (Remote)") : isWorker ? localize('worker', "Extension Host (Worker)") : localize('local', "Extension Host");

The webworker one is weird... because there isn't a concept of env vars so VSCODE_NLS_CONFIG isn't a thing in the web like it is in node and is used to configure the REH AMD Loader:

VSCODE_NLS_CONFIG: JSON.stringify(nlsConfig, undefined, 0)

I'm not seeing us configure the AMD loader with the language which is why that one isn't working.

function loadAMDLoader() {

Originally posted by @TylerLeonhardt in #192787 (comment)

@TylerLeonhardt TylerLeonhardt added l10n-platform Localization platform issues (not wrong translations) extension-host Extension host issues bug Issue identified by VS Code Team member as probable bug labels Sep 11, 2023
@TylerLeonhardt TylerLeonhardt added this to the Backlog milestone Sep 11, 2023
@TylerLeonhardt TylerLeonhardt added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Sep 11, 2023
@yiliang114
Copy link
Contributor

image

The localize call:

const name = initData.remote.isRemote ? localize('remote', "Extension Host (Remote)") : isWorker ? localize('worker', "Extension Host (Worker)") : localize('local', "Extension Host");

The webworker one is weird... because there isn't a concept of env vars so VSCODE_NLS_CONFIG isn't a thing in the web like it is in node and is used to configure the REH AMD Loader:

VSCODE_NLS_CONFIG: JSON.stringify(nlsConfig, undefined, 0)

I'm not seeing us configure the AMD loader with the language which is why that one isn't working.

function loadAMDLoader() {

Originally posted by @TylerLeonhardt in #192787 (comment)

After getting the current language in html, pass it to worker when initializing it. Is it OK? AMDLoader in other places needs to pass other attributes such as supported languages, but here only the current language may be enough, because the page or application will be refreshed when switching languages.

@TylerLeonhardt
Copy link
Member Author

That might do the trick... this is specifically talking about Core strings that exist in the webworker that need to be localized... in other words, not strings inside of an extension, for example.

yiliang114 added a commit to yiliang114/vscode that referenced this issue Nov 28, 2023
yiliang114 added a commit to yiliang114/vscode that referenced this issue Dec 1, 2023
@TylerLeonhardt TylerLeonhardt linked a pull request Dec 6, 2023 that will close this issue
yiliang114 added a commit to yiliang114/vscode that referenced this issue Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-host Extension host issues feature-request Request for new features or functionality l10n-platform Localization platform issues (not wrong translations)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants