-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.107.1
- OS Version: Arch Linux (rolling release, so no version)
Steps to Reproduce:
- run VS Code with the
LANGUAGEenvironment variable set to something other thanen_*, such asde(make sure the locale is enabled in/etc/locale.genandgen-localehas been run so the data is available) - open a project containing a git repository
- modify a file
- try to switch git branches
Expected behavior: A popup offering to “migrate changes” to the new branch using git stash
Observed behavior:
A popup informing me that the operation failed, offering only to view logs and command output
The Git extension’s logs show the following (German) output
> git checkout -q pa/pandas-3
Fehler: Ihre lokalen Änderungen in den folgenden Dateien würden beim Auschecken
überschrieben werden:
src/scanpy/_utils/__init__.py
Bitte committen oder stashen Sie Ihre Änderungen, bevor Sie Branches
wechseln.
Abbruch
More details: This is because of this regex, which expects english command output
vscode/extensions/git/src/git.ts
Line 1982 in 93d270f
| if (/Please,? commit your changes or stash them/.test(err.stderr || '')) { |
VS Code does set LC_ALL=en_US.UTF-8 and LANG=en_US.UTF-8, but LANGUAGE=de overrides this for software like Git that uses gettext (explained here in gettext’s docs)
vscode/extensions/git/src/git.ts
Lines 681 to 682 in 93d270f
| LC_ALL: 'en_US.UTF-8', | |
| LANG: 'en_US.UTF-8', |
❯ env LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LANGUAGE=en git -h
usage: […]
❯ env LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LANGUAGE=de git -h
Verwendung: […]Proposed fix:
also set LANGUAGE=en there.