Skip to content
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

Incorrect locale 'en-US' used everywhere (Electron issue?) #110322

Closed
koxu1996 opened this issue Nov 10, 2020 · 16 comments
Closed

Incorrect locale 'en-US' used everywhere (Electron issue?) #110322

koxu1996 opened this issue Nov 10, 2020 · 16 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@koxu1996
Copy link

  • VSCode Version: 1.50.1 (d2e414d) x64
  • OS Version: ArchLinux x64 5.9.6

Today I upgraded electron from 9.3.3-1 to 9.3.4-1 and many extensions stopped working in VSCode, due to incorrect locale, eg. Python:
image
image

Probably it's related to electron/electron#23272, but I want to let you know.

@wooque
Copy link

wooque commented Nov 10, 2020

Same issue here, this message pops in integrated terminal, though it seems it didn't break anything in my setup.

@stakaz
Copy link

stakaz commented Nov 10, 2020

Same here. For me it breaks lualatex compilation with LaTeX-Workshop extension.

My specifications (I am using arch linux):

Version: 1.50.1
Commit: d2e414d9e4239a252d1ab117bd7067f125afd80a
Date: 2020-10-15T10:42:48.064Z
Electron: 9.3.4
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Linux x64 5.9.6-arch1-1

@wooque
Copy link

wooque commented Nov 10, 2020

This PR is backported to 9.3.4, could be the culprit electron/electron#26185

@tamuratak
Copy link
Contributor

The VS Code package on Arch Linux is a custom build. The current version of Electron of the official build is 9.3.3. You should report this issue to Arch Linux.

@starquake
Copy link

Arch Linux splits Electron from VS Code and always has the most recent version available from upstream. It looks like something broke in 9.3.4: electron/electron#26443

So I guess we should wait for an update with a fix.

@lights0123
Copy link

I opened that issue in electron's issue tracker after experiencing this exact problem in VS Code, so yes, that is the problem.

@jorgelaranjo
Copy link

jorgelaranjo commented Nov 12, 2020

Upgrade Electron to 10.1.5-1 and VS Code to 1.51.1-1. Clearly at electron as pointed out by #110322 (comment)

@telmotrooper
Copy link

telmotrooper commented Nov 13, 2020

Edit: Package electron9 has been updated in the Arch repositories and this fix isn't necessary anymore. Just update your system and it should be fine. 🙂

For anyone having this issue on Arch Linux, downgrade package electron9 from 9.3.4 to 9.3.3.

curl -O https://archive.archlinux.org/packages/e/electron9/electron9-9.3.3-1-x86_64.pkg.tar.zst
sudo pacman -U electron9-9.3.3-1-x86_64.pkg.tar.zst

You'll probably want to add electron9* to IgnorePkg in /etc/pacman.conf, so the next time you update your packages you won't accidentally update this one as well. When a fix has been deployed you can remove this setting... 🙂

@shelmus
Copy link

shelmus commented Nov 13, 2020

@telmotrooper This works. Thanks!

@ejose19
Copy link

ejose19 commented Nov 14, 2020

@telmotrooper Thanks, be sure to also download the signature (https://archive.archlinux.org/packages/e/electron9/electron9-9.3.3-1-x86_64.pkg.tar.zst.sig) along the package and check pacman.conf so that LocalFileSigLevel = Required(or unset and SigLevel = Required), as you probably don't want to install unsigned packages.

@lights0123
Copy link

You can also just do sudo pacman -U /var/cache/pacman/pkg/electron9-9.3.3-1-x86_64.pkg.tar.zst, as you probably have it still cached.

@stuartpb
Copy link

Just adding, for anyone looking for a low-hanging-fruit workaround, LC_ALL=en_US.UTF-8 code --lang=en_US.UTF-8 --set-lang=en_US.UTF-8 (ie. all of the LC_ALL environment variable, old --lang option that the blamed PR said didn't work, and --set-lang option that the PR appears to implement instead) still results in the en-US locale issue appearing in the first terminal you see.

@lights0123
Copy link

Yep, because the Electron source code reads the locale passed from the command line, but then immediately overrides it:

https://github.com/electron/electron/blob/ef674025b5e17845e48a4d55721ea1a5583c4d04/shell/browser/electron_browser_main_parts.cc#L385-L387

@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron upstream-issue-linked This is an upstream issue that has been reported upstream labels Nov 16, 2020
@lights0123
Copy link

The fix has been merged upstream: the next release will include the fix.

@deepak1556
Copy link
Collaborator

Closing this as vscode master is on 9.3.3 and the upstream issue was first observed in 9.3.4

@wleoncio
Copy link

Just adding, for anyone looking for a low-hanging-fruit workaround, LC_ALL=en_US.UTF-8 code --lang=en_US.UTF-8 --set-lang=en_US.UTF-8 (ie. all of the LC_ALL environment variable, old --lang option that the blamed PR said didn't work, and --set-lang option that the PR appears to implement instead) still results in the en-US locale issue appearing in the first terminal you see.

Is it possible to have VSC run a script or even a 1-liner before opening an intergrated terminal? I've seen similar issues back from 2016 which were solved by adding export LC_ALL=[whatever] to the shell configuration file (e.g. .bashrc), but I tried that and it didn't work.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests