-
Notifications
You must be signed in to change notification settings - Fork 33.4k
fix: missing translations of remote built-in extensions #249430
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
Conversation
@microsoft-github-policy-service agree |
Can you please share more information here - what is the bug? Are there steps to reproduce? Any screenshots would be helpful. Before that please file an issue first with all this information. Thanks |
@hyrious how did you test this change, because I just tested it (by building a local build of VS Code) and it sadly does not work (I'm using a pseudolanguage pack since I know only English) ![]() |
@sandy081 your guidance would be nice here. The steps are easy to reproduce:
These strings are localized in the manifest so I'm not sure why, when there's a remote, the manifest strings would stick to English. |
@TylerLeonhardt A little tricky to test because the remote host should also be built by yourself. If you're using the official reh build in the remote host it wouldn't work. I actually tested it by manually port changes to the code-server. You may have a try:
|
|
I built an Insiders build off of this branch and can confirm that this fixes the problem :) |
try { | ||
const userScanOptions: UserExtensionsScanOptions = { includeInvalid: true, profileLocation, productVersion }; | ||
let scannedExtensions: IScannedExtension[] = []; | ||
if (type === null || type === ExtensionType.System) { | ||
let scanAllExtensionsPromise = this.scanAllExtensionPromise.get(profileLocation); | ||
if (!scanAllExtensionsPromise) { | ||
scanAllExtensionsPromise = this.extensionsScannerService.scanAllExtensions({}, userScanOptions) | ||
scanAllExtensionsPromise = this.extensionsScannerService.scanAllExtensions({ language }, userScanOptions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is not this promise should be cached by language?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh.. yes. Maybe I will just use ${profileLocation}?${language}
for key of the scanAllExtensionPromise
map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you need to change both scanned extensions promises map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sandy081 Sorry, just noticed the comment. Code updated.
@sandy081 I defer to you for final approval |
@TylerLeonhardt Approved from my side. Should we merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@hyrious this fix is going to make a lot of devs happy. Thank you for contributing! |
@BlackHole1 noticed that some translations are missing when develop in remote mode. After digging a bit, we found that only built-in extensions' NLS messages are missing. For example, the Source Control view (contributed by the built-in 'Git' extension) and built-in extensions' configurations are in English.
Despite that the remote server will download and install the corresponding language pack extension, it does not pick the language pack up because of 2 problems:
nls.keys.json
in the server build, causingclp/{hash}.{lang}/*
failed to generate.This PR fixes the 2 problems.
Note about problem 1: The original code
Promise.all([mkdir, read keys, read messages])
will fail when the keys file is missing, but the mkdir task would succeed and leave an empty folder which prevents it regenerate in the next calling. So I changed the testing logic from the folder to the file in it.Fixes #250579