dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.85k stars 668 forks source link

IntelliSense strings are localized #2513

Open Spike2D opened 6 years ago

Spike2D commented 6 years ago

Yesterday my VS Code updated Omnisharp, since then my intellisense and debugging messages are being outputted in another language from English, there doesn't seem to be any way to configure or change that behaviour.

gregg-miskelly commented 6 years ago

Can you give us some examples of intellisense strings?

I know the debugger hasn't yet done the work to ship any localized strings. So if you are getting localized debugger strings they must be from VS Code itself. I am not sure if there are any parts of the language service that have localization yet.

Spike2D commented 6 years ago

You were right, I could fix the intellisense, however I still get this: With 1.32.3-beta.9: 1 32 3-beta 9

Meanwhile with 1.32.4 or 1.32.5: 1 32 5

gregg-miskelly commented 6 years ago

@rchande @akshita31 any ideas?

rchande commented 6 years ago

@Spikent We need more info--what OS are you on? If you're on Windows, what is your language is your system set to use? This looks like a Unity project--what language is Unity configured to use?

Spike2D commented 6 years ago

@rchande I'm running Windows 10 Pro, and it's locale is set to Spanish, which I'm guessing it's what Omnisharp is picking up on recent updates to set its locale to...

The Project is a Godot project, it's running on c#.

plutapawel commented 6 years ago

I have the same problem on polish version of the Windows 10 system.

rchande commented 5 years ago

This is essentially a feature request for us to set the locale of OmniSharp based on the VS Code language configuration.

rchande commented 5 years ago

@Spikent Thank you for the feature request. What's happening here is that one of OmniSharp's dependencies recently implemented localization for error messages, meaning that they will now be printed in your system language instead of English. To work around this (and get English error messages), you can delete the new localization files:

Open your "OmniSharp" log and find the path to OmniSharp from the beginning of the log, eg:

OmniSharp server started.
    Path: C:\Users\rchande\.vscode-insiders\extensions\ms-vscode.csharp-1.16.1\.omnisharp\1.32.5\OmniSharp.exe
    PID: 144684

Navigate to the directory eg C:\Users\rchande\.vscode-insiders\extensions\ms-vscode.csharp-1.16.1\.omnisharp\1.32.5, and enter the subfolder that corresponds to your system language. In @Spikent's case, the folder would be "es" because the system language is Spanish. Remove all the DLLs whose name starts with Microsoft.CodeAnalysis.

This should result in English error messages.

Attosius commented 5 years ago

@rchande yes, i renamed my localized folder, this fixes intellisense, thank you!

Spike2D commented 5 years ago

I fixed it in a similar way as you proposed, it worked non the least, I think there should be a option to allow users to run based on VS code locale or the system one, since some people might actually find this handy!

Thanks for fix, should help anyone that runs into the same situation as us.

chinaq commented 5 years ago

I have a opposite requirement, my locale is Chinese, but I want to set IntelliSense to English, I set "Configure Display Language" to "en" 2018-09-26_130605

it works here: 2018-09-26_130649

but it does not work on IntelliSense 2018-09-26_130522

gregg-miskelly commented 5 years ago

@chinaq you can follow the work around that @rchande gave above for now.

Novack commented 5 years ago

Same problem for me on VSCode 1.30.1: Im getting error and warning hints on spanish, despite having VSCode locale to "en_US". Cant find any option to change this behavior.

Any news on this? (Workaround did worked btw, just asking for news on definitive solution).

henioStraszny commented 5 years ago

I believe that for most of the developers, the fact of having error messages in one language - English - is really a big benefit.

Please be aware that the amount of information you can google with Polish, Chech, or other similar language is minimal. Amount of information in English is huge. Translating error messages or other related information to my mother language makes my work much much harder.

Please do not change my development language to anything different then English by default.

imba-tjd commented 5 years ago

In VS, there is an Option-International Settings. By default, both the UI and intellisense info language are the same as Windows language settings. If it is set to English, both of them will be set to English.

For myself, while I agree English is the basic skill for programmers, I would still like to have a standalone setting to determine the language of intellisense info. But it's also OK totally corresponding to VSC's UI language.

I also found a DOTNET_CLI_UI_LANGUAGE env, but it only affects terminal panel(and external terminal).

felipeoriani commented 5 years ago

My Windows 10 is in pt-BR and I also have this problem.

Navigate to the directory eg C:\Users\rchande\.vscode-insiders\extensions\ms-vscode.csharp-1.16.1\.omnisharp\1.32.5, and enter the subfolder that corresponds to your system language. In @Spikent's case, the folder would be "es" because the system language is Spanish. Remove all the DLLs whose name starts with Microsoft.CodeAnalysis.

This should result in English error messages.

Yes, this workaround worked, but it would be great to have a user friendly configuration for it. Consider it on the next version. :D

Thank you.

rickyah commented 5 years ago

I have the same problem on mac os Mojave (10.14.3) with dotnet 2.1.504 installed.

The omnisharp server prints all messages in spanish, although I have english as locale both for the terminal and vscode. Unfortunately the workaround is not working, as on mac the Microsoft.CodeAnalysis dlls are not located on the omnisharp installation folder.

Changing the language with no warning and without giving a way to put it back is quite annoying. For a workaround in mac, you can change the system language to english, but this solution is cumbersome

MBurtsev commented 5 years ago

I have the same problem Terminal and IntelliSense https://i.imgur.com/GoxqoRx.png

Eagle3386 commented 5 years ago

Almost one year later, this bug (yes, it's a bug as a) OmniSharp ignores VSC's language setting and b) has no option for setting its own language either) still is unresolved.

If one might outline to some extend how to fix that (besides the mentioned awesome workaround by @rchande above), I'd love to implement it.

rchande commented 5 years ago

@Eagle3386 OmniSharp is just using the users's language setting. To alter this you would need to change the C# extension (https://github.com/OmniSharp/omnisharp-vscode) to read the VS Code setting and pass it to the server (https://github.com/OmniSharp/omnisharp-roslyn) which would also have to be changed to respect that configuration.

Eagle3386 commented 5 years ago

Alright, I'll try and see if I can handle that. Wish me luck, cause up to now, I've only fixed MS docs.. 🤣

Eagle3386 commented 5 years ago

I've managed to add an option, extend unit tests without much work and also retrieve VSCode's current display language (stored in vscode.env.language).

However, I seem unable to find docs about the needed variable name for dotnet (OmniSharpServer -> server.ts, line 304, seems to enable direct "pass-through" for dotnet's settings).

Any help would be greatly appreciated! 👍

Eagle3386 commented 5 years ago

Update: Found it while adding "terminal.integrated.env.windows": { "DOTNET_CLI_UI_LANGUAGE": "en" }, (or en-us) to my user/workspace settings.json file to fix terminal output, too. Maybe setting environment variable prior to to launching omnisharp-roslyn / dotnet via child thread already solves the issue.. 🤔

imba-tjd commented 5 years ago

Update: Found it while adding "terminal.integrated.env.windows": { "DOTNET_CLI_UI_LANGUAGE": "en" }, (or en-us) to my user/workspace settings.json file to fix terminal output, too. Maybe setting environment variable prior to to launching omnisharp-roslyn / dotnet via child thread already solves the issue.. 🤔

I had found this on the above comment. It doesn't work. You can try by setting it in Windows' environment variable.

Eagle3386 commented 5 years ago

I had found this on the above comment. It doesn't work. You can try by setting it in Windows' environment variable.

For the (external) terminal panel, it definitely works.

Regarding OS-roslyn, it clearly can't work up to now as there's no code for reading the environment variable and then passing it into the child thread's environment and/or launch arguments.. 😉

rezunalex commented 5 years ago

Would be great if somebody would advise how to solve this on MacOS.

Phloog commented 4 years ago

Any news on this? Is there a better solution than the workaround yet available?

MeowKim commented 4 years ago

Wow.. It's middle of 2020 now. I can't believe this is not solved yet. 😨

lucianotres commented 4 years ago

Update: Found it while adding "terminal.integrated.env.windows": { "DOTNET_CLI_UI_LANGUAGE": "en" }, (or en-us) to my user/workspace settings.json file to fix terminal output, too. Maybe setting environment variable prior to to launching omnisharp-roslyn / dotnet via child thread already solves the issue.. 🤔

Yes, the easiest way 🙌

ercanerdogan commented 3 years ago

Where is this settings.json file ? Could you write full-path?

ercanerdogan commented 3 years ago

Yeah, I have found that where is "%APPDATA%\Code\User" settings.json file is here.

BoraKaraca commented 3 years ago

This solution work for me Source:https://superuser.com/a/1512105/1346669

Close VS Code Enter the system language found in this path inside the folder.I use Turkish language on windows C:\Users\PC.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8\tr image

Remove all dll files starting with 'Microsoft.CodeAnalysis' (Please notice that some folder names in the path might vary due to different versions) Open VS Code its work image

Ejd3rE commented 3 years ago

This solution work for me Source:https://superuser.com/a/1512105/1346669

Close VS Code Enter the system language found in this path inside the folder.I use Turkish language on windows C:\Users\PC.vscode\extensions\ms-dotnettools.csharp-1.23.11.omnisharp\1.37.8\tr image

Remove all dll files starting with 'Microsoft.CodeAnalysis' (Please notice that some folder names in the path might vary due to different versions) Open VS Code its work image

thank you, it worked for me. I've been calling a lot.

jcbritobr commented 3 years ago

We are mid 2021 and this was not solve yet... Must be a very difcult issue to solve. OMG. Serious, this may be a big issue. In my case, using pt-BR, there are a lot of traduction errors in the messages, that changes completely and make the messages incorrect.

onur-ozguzel commented 3 years ago

Well well... Who knows after hours of searching, it' s fixed by dll deletion.

Eagle3386 commented 2 years ago

Well well... Who knows after hours of searching, it' s fixed by dll deletion.

By no means shall this method be called "fix". It's nothing but a tremendously dirty hack to say the least!

twoco commented 2 years ago

In my case, I always want english when developing. My OS (Windows 10) is set to german. I watch movies and play games in this language. But my development environment has to be in English. My VSCode is in english. I write code and comments in english. Communicate with other people in english. So german C# messages are really hard to share and not easy to understand or search the web for. It would be great if the language of VSCode is used, instead of the OS.

My workaround: Go to the folder: C:\Users\%USERNAME%\.vscode\extensions\ms-dotnettools.csharp-1.23.15\.omnisharp\1.37.15 There is a folder with your language code. In my case it's the folder de. Just rename it to e.g. de-disabled. So it fallback to en.

In my opinion all developers should use english. No options for different language. We could remove all other languages and set it fixed to english. The most terms are already in english. And other terms has a weird confusing translation. It's hard to communicate with the world. But anyway... 😉 It's just my opinion. Live and let live.

jcbritobr commented 2 years ago

In my case, I always want english when developing. My OS (Windows 10) is set to german. I watch movies and play games in this language. But my development environment has to be in English. My VSCode is in english. I write code and comments in english. Communicate with other people in english. So german C# messages are really hard to share and not easy to understand or search the web for. It would be great if the language of VSCode is used, instead of the OS.

My workaround: Go to the folder: C:\Users\%USERNAME%\.vscode\extensions\ms-dotnettools.csharp-1.23.15\.omnisharp\1.37.15 There is a folder with your language code. In my case it's the folder de. Just rename it to e.g. de-disabled. So it fallback to en.

In my opinion all developers should use english. No options for different language. We could remove all other languages and set it fixed to english. The most terms are already in english. And other terms has a weird confusing translation. It's hard to communicate with the world. But anyway... 😉 It's just my opinion. Live and let live.

Yep. Agreed. But the real issue is that languages are mixed. In my case, portuguese and english mixed in all stack traces. Is horrible to read.

twoco commented 2 years ago

Today ... Maybe not related to this. But I just want to show what happend to the dev world.

image

Not sure what component created this notification. I clicked on "Don't show again." (on the gear icon). Btw. a complete other topic but slighly related to it: The latest Chromium DevTools also now annoys with language packs. Have you already seen it? Argh, let me develop in english please. 😢 😆 I know what I'm doing. Leave me alone!

JulianGmp commented 2 years ago

That workaround does work for me, though I wish the extension would use DOTNET_CLI_UI_LANGUAGE if it's set. But I have to say, the dotnet cli language settings confuse me, if I run dotnet build with DOTNET_CLI_UI_LANGUAGE=es I get a mix between German and Spanish...

I do have to ask, does the extension need to ship with multiple languages? It's like 10 MB of DLLs.

jcbritobr commented 2 years ago

That workaround does work for me, though I wish the extension would use DOTNET_CLI_UI_LANGUAGE if it's set. But I have to say, the dotnet cli language settings confuse me, if I run dotnet build with DOTNET_CLI_UI_LANGUAGE=es I get a mix between German and Spanish...

I do have to ask, does the extension need to ship with multiple languages? It's like 10 MB of DLLs.

Maybe this issue exists today to make Visual Studio more "usefull". I'm just thinking about this.

markusroessler commented 2 years ago

In addition to @Spikent's workaround (https://github.com/OmniSharp/omnisharp-vscode/issues/2513#issuecomment-423270085): If you also want the debugger output to appear in english, remove all DLL files from the following directory: C:\Users\mroessler\.vscode\extensions\ms-dotnettools.csharp-1.23.16\.debugger\{LCID} You can find the LCID for your system language here: https://docs.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a

sqwwwok commented 2 years ago

image Try to change the display language of vscode to en, which worked on my mac. But the effects will be global in the editor.

Would be great if somebody would advise how to solve this on MacOS.

Romaleks360 commented 2 years ago

Any updates on this?

jcbritobr commented 2 years ago

image Try to change the display language of vscode to en, which worked on my mac. But the effects will be global in the editor.

Would be great if somebody would advise how to solve this on MacOS.

doesn't work.

Prashanth-BC commented 2 years ago

For mac this worked for me:

PaulARoy commented 2 years ago

Hi, Issue is still here, the workaround to delete the localized DLL worked for me. I think locale should be configurable and/or mapped to the vs code locale.

lghtcrss commented 1 year ago

Issue is still there as of 02/2023. After each update I have to delete the .dlls. Please give us a possibility to set the language for omnisharp-vscode.

domints commented 1 year ago

+1 - what is also weird, it worked on my Mac until like... few days ago. Today I want to write some code and out of the blue all messages are in Polish. Terrible UX, amount of resources available in languages other than English are so minuscule it only makes everything harder.

For anybody working on Mac: those files that you need to remove for workaround are located at: ~/.vscode/extensions/ms-dotnettools.csharp-{extension version}-darwin-x64/.omnisharp/{omnisharp version}/{language}

And here is one-liner, worked for me, removes those CodeAnalysis files no matter the language and version, as long as it's Mac on Intel CPU: rm -rf ~/.vscode/extensions/ms-dotnettools.csharp-*-darwin-x64/.omnisharp/*/*/Microsoft.CodeAnalysis.*.resources.dll Legal: I won't take responsibility if you break your VS Code or sth.

Shepherdsinan commented 1 year ago

Hello, I have linux Os and look path not found dll??