fix: missing translations of remote built-in extensions #249430
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.
@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.