code-server: Display language doesn't persist in code-server v3.11.0 running in Docker container when installing from CLI

OS/Web Information

  • Web Browser:
  • Local OS:
  • Remote OS:
  • Remote Architecture:
  • code-server --version: Version 3.11.0 of Code-Server

Steps to Reproduce

  1. Add file “argv.json” to “/home/coder/.local/share/code-server/User/”
  2. Reload window
  3. Languague change
  4. Code of argv.json:
{
    "locale": "es"
}

Expected

Change Languague Display

Actual

Not Change Language Display

Logs

Screenshot

Notes

This issue can be reproduced in VS Code: Yes/No

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 27 (16 by maintainers)

Most upvoted comments

I was able to replicate with:

$ rm ~/.local/share/code-server -r
$ code-server --install-extension ms-ceintl.vscode-language-pack-es
$ echo '{"locale":"es"}' > ~/.local/share/code-server/User/argv.json
$ code-server # Browse to localhost:8080

Strangely, I don’t get the option to select es from the command palette either even though the extension is installed.

If I uninstall the extension and re-install then refresh everything works.

I think there is some language bundle generation that happens somewhere that isn’t running when doing things in the CLI but is running when doing things through the UI.

$ code-server --install-extension ms-ceintl.vscode-language-pack-es
$ ll ~/.local/share/code-server/
total 4
drwxr-xr-x 2 root root 59 May 28 22:28 CachedExtensionVSIXs
drwxr-xr-x 2 root root 66 May 28 22:27 coder-logs
drwxr-xr-x 3 root root 59 May 28 22:28 extensions
drwxr-xr-x 3 root root 29 May 28 22:27 logs
-rw-r--r-- 1 root root 36 May 28 22:27 machineid
drwxr-xr-x 2 root root  6 May 28 22:27 User

no languagepacks.json found, It’s what causes it not to work !!!

when install language pack manually by UI,the languagepacks.json file auto generated at ~/.local/share/code-server/ , and language pack works.

generate languagepacks.json file when exec code-server --install-extension ... will works, but I don’t know how to realize…

I’m not sure; we just shell straight out to VS Code to handle the installation so it’s odd that it doesn’t work.

I suppose we should first check what desktop VS Code does. Install an extension then (without launching VS Code!) see if the file exists.

If it does, that’s weird and I’m not sure how to debug that but we’ll cross that bridge if we come to it.

If it doesn’t, then launch VS Code and see if it appears then. If it does then we might be missing something that is supposed to create the missing file on startup/launch (much like we create missing directories, etc). If this is the case then we’ll probably want to look into how desktop VS Code does it and copy/import that.

I tried this with desktop VS Code (--install-extension, edit argv.json, then launch) and it did not change my language so this seems to be an upstream issue.

Thank you! If you want to dig in, I’d start here: https://github.com/coder/code-server/issues/3372#issuecomment-1029340034

Yes@jsjoeio, I already try and the behavior is the same.

I think it never worked.

I’m not sure 🤔 @code-asher might know if it previously worked

@dgadelha unfortunately not since I’m at max bandwidth for that sprint, but I can add it as a high priority item.

PRs are also welcome. Thanks for posting those notes! That will definitely speed things up when we get to this.

I confirm this theory, when I installed the language from CLI no languagepacks.json found and when doing from IU it works

I would like to follow up on this error. I would like to know what I can do to help solve it, I really like code-server, but I had to stay in version 3.9.3, where these errors do not occur, how can I help to solve this problem. A pleasure to greet the entire team.

@jsjoeio, @code-asher, I started to see the changes from version 3.9.3 to version 3.10.0, to see if I can help to find the error and I could observe this change: https://github.com/cdr/code-server/pull/3250/files

I think instead of placing:

yarn gulp compile-build compile-extensions-build

You have to place:

yarn gulp compile-build && yarn gulp compile-extensions-build

To stand in a line.

I don’t use yarn and gulp, and I’m not an expert in bash, so I don’t really know if that is the case.

I hope to help a little