Pylance doesn't honor VSCode display language
See #4579. My LANG is set to de_DE.UTF-8, the display language in VSCode is set to "en":
srittau@blitz:~$ locale
LANG=de_DE.UTF-8
LANGUAGE=de_DE:en
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=
Still, pylance's error messages are in German, meaning that I need to reverse-translate the message to divine their meaning. It's also impossible to copy & paste the error messages when collaborating with non-German speakers. pylance should follow VSCode's language setting, not the system language. Or at least provide some way to override it.
Environment data
- Language Server version: 2024.5.1 (pyright version 1.1.360, commit 4bc8428d)
- OS and version: Ubuntu 24.04
- Python version (& distribution if applicable, e.g. Anaconda): any
Does the workaround mentioned here work for you? https://github.com/microsoft/pylance-release/issues/4579#issuecomment-1696059319
@StellaHuang95 This seems to work around the problem, indeed.
Thank you for confirming. It seems that Pylance isn't picking up the language properly here. We'll investigate to see what might be causing the issue.
I'm not entirely sure it this is the same issue, but I had a similar problem. Also working on a German Windows environment and VSCode refused to change language to English. What fixed it for me is installing the German Language Pack (and then setting the language to English).
How's your investigation going? Version 2025.3.2 does this again.
Another workaround might be setting "python.analysis.displayEnglishDiagnostics": true