-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
Uninstalling language pack for current display language does not update display language setting #82791
Comments
The problem here is that the setting still points to the removed language and that for example C++ ships with its own language bundle, hence that still wins. @sandy081 is there an event that I can listen to when an extension is uninstalled. Then I could reset the setting. |
@dbaeumer What setting is this and how this is set? Where does this setting exists? |
It is not a setting. It is in its own file |
@dbaeumer This can be done here - https://github.com/microsoft/vscode/blob/master/src/vs/workbench/contrib/localizations/browser/localizations.contribution.ts#L48 I have code to check when a lang pack is installed, we can add here to check if a lang pack extension is uninstalled and it is currently active. Let me know if you want to handle this or I can do it. |
@sandy081 feel free to do the change. Is appreciated! |
@dbaeumer just to be sure, extensions are directly reading this file? If so why are not getting locale id from us? |
No, extension never read that file. They get the language id from us. It is more around removing a language id from the file if the LP gets uninstalled. |
For some time now I'm starting getting Arduino/C/C++ error messages in Brazilian Portuguese which is my native language, which I don't want. The translations are often just incomprehensible, laughable or sheer nonsense. My VS Code is configured to use English everywhere, I want my messages in English again, I'm not sure what happened. I was redirected from this topic. |
@TylerLeonhardt Assigning it to you as you are owning language packs feature. |
As a workaround you can set your locale to English using |
My VSCode was always set to english, everything was displayed in english. Build error messages were in english. And intellisense warnings were in english. After installing PlatformIO some time ago, nothing has changed. Still everything was in english. But that was more than half of a year ago. Now I came back, opened a now-old project, VSCode with PlatformIO were unused since that time, and I was surprised with intelliSense messages showing up in my OS language, instead of english. What a 👀 I'm pretty sure I never installed any language packs, especially NOT for my native language. I truly HATE seeing my native language in technical IT contexts. I wouldn't do that. And I doubt PlatformIO installed would do that for me. Traditional first three results on a more or less random search engine pointed me to "configure display language" setting, which, frankly, told me that my UI language is english. Well, ok, nah. (Also, my native lang was not listed as 'installed/available'). After trying a to generate a solution using an quantum random genetic algorithm (*) churning through half a zilion search similar-looking internet search results, and failing, I re-visited "configure display language", thinking, "what if it just displays stale data?". I switched my VSCode to a random other language I could read enough to be able to switch it back. It installed the pack, restarted itself ... no, it didn't. It displayed an infobox "do you want to restart now?". Of course NOT, I want to now reinstall back the english. So "configure display language" and I switched back to english, "do you want to restart now?" again, of course YES this time. And in this process, actually, nothing has changed. After restarting VS, I still got native lang in intellisense. (*) an advanced multi-step one, like: pick post at random, copy, paste, mutate, tell myself I know what I'm doing, repeat. At this point I probably errorneously assumed that I succeeded switching languages, and that "configure display language" displayed correct, nonstale, data all the time. Then, after re-reading at least: I came to and idea that it MUST be "configure display language", and I must have done something wrong, maybe I misclicked and didn't switch? I sometimes read and subconsciously translate languages, and later I'm 100% sure I saw language X when it was Z. I tried once again. To be sure, I picked chinese. "do you want to restart now?", of course NOT yet. Then I switch back to english. "do you want to restart now?", of course YES. VSCode restarted itself, and nothing has changed. I still had native intellisense messages. But this got me thinking. That setting MUST be saved somewhere. And I've read somewhere that when a language pack is uninstalled, something stale may be left somewhere out there. I found the setting here in
and it looked like this: That There is a chance that I mindlessly clicked and uninstalled chinese language pack just before switching back to english (so I might have done: change to chinese, deny restart, uninstall chinese extension, change to english, restart), but I'm 100% sure that my last action before restarting was "configure display language" into english. This got me into thinking, maybe it's not flexible enough, and maybe two-changes-at-one-time is too much? Maybe restart is required each time, or else something desyncs even more? I "configure display language" to my native language pack. "do you want to restart now?". YES. It restarted, it started up in my laguage. "configure display language" to english. "do you want to restart now?". YES. It restarted, it started up in english. IntelliSense messages were now IN ENGLISH. And the argv.json contains So.. to be honest, that was just as crazy random and disorganized as I'm ashamed to admit, but I got it back to english. And I cannot 100% prove that it was the fault of "configure display language" and not-restarting the VS immediately, but to me, it looks like that. And I have no idea why this problem showed up in the first place, as, really, I wouldn't install a language pack, until the VSCode refused to cooperate (at which point I'd just uninstall it and switch to another IDE), and threatened me with deleting my projects and/or harddrive (ok sir, look here, I'm installing the language pack). However, one thing I'm sure I got it back to english by:
One thing that maybe would work much faster, and I'd try that for sure if I knew it beforehand, is changing the |
If a Language pack is installed and you wanna uninstall it , you go into the Extension folder in |
I was been having the same issue, hints were in portuguese brazilian, rest of the program in english. |
The most important part of this change is that we now listen for when extensions are uninstalled and if they uninstalled language currently set then a modal will show up prompting for restart (required to change the language back to English). This change also makes the LocaleService the thing that writes to the argv.json instead of a few places doing it and cleans up some of the wording. Fixes #82791
The most important part of this change is that we now listen for when extensions are uninstalled and if they uninstalled language currently set then a modal will show up prompting for restart (required to change the language back to English). This change also makes the LocaleService the thing that writes to the argv.json instead of a few places doing it and cleans up some of the wording. Fixes #82791
That's odd. I'm just using the jsonEditingservice. Nothing has changed on that front:
could that have been some copilot trickery? |
I deleted the locale and set it up again, and now the locale is always at the end. So it was probably already like that and the comma was added by something else editing that file. |
#82791 (comment) exports.getLocalizedString = getLocalizedString;
function getLocaleId() {
if (typeof process.env.VSCODE_NLS_CONFIG === 'string') {
const vscodeOptions = JSON.parse(process.env.VSCODE_NLS_CONFIG);
if (vscodeOptions.availableLanguages) {
const value = vscodeOptions.availableLanguages['*'];
if (typeof value === 'string') {
return value;
}
}
if (typeof vscodeOptions.locale === 'string') {
return vscodeOptions.locale.toLowerCase();
}
}
return "en";
} I forced changed Learned more about how Decided this is some VS Code fuck up: NOT FUCKING WORKING. WTF. cpptools still shows my native language. So, this must be cpptool fuck up. I can't even. I have already spend 8+ hours on this shit. I then removed VS Code completely. Both .vscode and Code folder in /user. A complete new installation of VS Code on my Zh-TW Windows OS. The MF still shows my native language on Intellisense and code warning and all .................................................... This is it... I give up. ******** Edit ************** I FUCKING FIXED IT: HERE, I don't know which one. But just set all those MF
In if (isString(process.env.VSCODE_NLS_CONFIG)) {
try {
var vscodeOptions_1 = JSON.parse(process.env.VSCODE_NLS_CONFIG);
var language = void 0;
if (vscodeOptions_1.availableLanguages) {
var value = vscodeOptions_1.availableLanguages['*'];
if (isString(value)) {
language = 'en';
}
}
if (isString(vscodeOptions_1.locale)) {
options.locale = 'en';
}
if (language === undefined) {
options.language = 'en';
}
else if (language !== 'en') {
options.language = 'en';
} ******** Edit 2 ************* So, here is a reported issue to cpptools microsoft/vscode-cpptools#10632 That issue report has more details. I hope this helps. |
This is similar to #79741 , but this is not a feature request. It's a bug. The language used in the UI becomes an inconsistent mix of 2 languages, and the current language setting remains set to something no longer valid and no longer available to the user.
Steps to repro:
Seeing: VS Code has mostly fallen back to the default language, however there are still various strings in the other language. Extensions that use vscode-nls still display strings in the other language. (For example, all strings coming from the C/C++ Extension such as IntelliSense, are in the removed language. This appears to be true for some built-in VS Code extensions as well.).
Expected: When uninstalling the language pack for the currently selected display language, the setting should be reverted to the default language. Extensions that use vscode-nls should not still display the removed language. Note that the available languages in Configure Display Language only include languages there are language packs for, so it doesn't make sense for the current language setting to remain something not on that list.
Version: 1.39.2 (user setup)
Commit: 6ab5985
Date: 2019-10-15T15:35:18.241Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362
The text was updated successfully, but these errors were encountered: