Skip to content

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

@aleleba

Description

@aleleba

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

Activity

changed the title [-]Languague display not working in Version 3.10.0 of Code-Server[/-] [+]Can't change display language in code-server v3.10.0[/+] on May 12, 2021
added this to the On Deck milestone on May 12, 2021
jsjoeio

jsjoeio commented on May 12, 2021

@jsjoeio
Contributor

I was able to successfully reproduce this on macOS + Chrome and code-server 3.10.0

image

jsjoeio

jsjoeio commented on May 12, 2021

@jsjoeio
Contributor

However, you can change the display language if you do the following:

  1. Open Command Palette
  2. Search for "Configure Display Language"
  3. Click "Install additional Languages"
  4. Select language pack
  5. Reload

Screenshot

image

And, if you restart code-server the language pack is installed and we set the locale in argsv.json so it persists!

image

@aleleba can you please double-check that you have the language pack extension installed?

added
waiting-for-infoWaiting for more information from submitter
and removed
bugSomething isn't working
on May 12, 2021
aleleba

aleleba commented on May 13, 2021

@aleleba
Author

@jsjoeio, Yes I can confirm that I install the language pack. Currently I install the Spanish Language package directly with a command in my Dockerfile.

What happens in the previous versions of code-server is that when entering for the first time it already opened the Spanish language by default.

I just tried uninstalling and installing the package again, restarted the window and changed the language.

In the same way, I would like the language to be preloaded as before, so that if the Docker container falls, it takes the language configuration at once.

I am attaching the docker docker command I use in the Dockerfile:

RUN code-server --extensions-dir ~/.local/share/code-server/extensions/ --install-extension ms-ceintl.vscode-language-pack-es

I really appreciate the follow-up and the help.

jsjoeio

jsjoeio commented on May 13, 2021

@jsjoeio
Contributor

Ah okay, thank you for all the details. So here's a screenshot of my running that command locally (not using Docker):
image

Hmm...now this is interesting... When I look inside /Users/jp/.local/share/code-server/User, I see an argsv.json and argv.json 🤔

image

I'll keep both and restart code-server.

It's in Spanish, as expected.
image

According to VS Code's docs, argv.json is the expected filename to keep the locale.

Let's delete the argsv.json, restart code-server and see what happens. Still in Spanish so that wasn't an issue. (probably a typo from me)

image

Well, I'm a bit stumped. It feels like this is specific to how code-server is loading/running in your Docker environment. Maybe @code-asher has some insight.

added
needs-investigationThis issue needs to be further investigated
and removed
waiting-for-infoWaiting for more information from submitter
on May 13, 2021
changed the title [-]Can't change display language in code-server v3.10.0[/-] [+]Display language doesn't persist in code-server v3.10.0 running in Docker container[/+] on May 13, 2021
aleleba

aleleba commented on May 13, 2021

@aleleba
Author

@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

jsjoeio

jsjoeio commented on May 13, 2021

@jsjoeio
Contributor

Maybe @oxy might have some insight too.

code-asher

code-asher commented on May 13, 2021

@code-asher
Member

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.

20 remaining items

alanhe421

alanhe421 commented on Oct 14, 2022

@alanhe421

which old version is ok? Or was it an existing BUG all along?

jsjoeio

jsjoeio commented on Oct 14, 2022

@jsjoeio
Contributor

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

code-asher

code-asher commented on Oct 19, 2022

@code-asher
Member

I think it never worked.

aleleba

aleleba commented on Dec 14, 2022

@aleleba
Author

Can we make some following up @code-asher ? , If you need any help, it should be a pleasure to help.

jsjoeio

jsjoeio commented on Dec 14, 2022

@jsjoeio
Contributor

@aleleba can you try reproducing this with the latest version of code-server?

aleleba

aleleba commented on Dec 14, 2022

@aleleba
Author

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

jsjoeio

jsjoeio commented on Dec 14, 2022

@jsjoeio
Contributor

Thank you! If you want to dig in, I'd start here: #3372 (comment)

code-asher

code-asher commented on Dec 19, 2022

@code-asher
Member

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.

added
upstream:vscodeNeeds to be fixed upstream in VSCode
and removed
bugSomething isn't working
on Dec 19, 2022
repo-ranger

repo-ranger commented on Dec 19, 2022

@repo-ranger
Contributor

This issue has been marked as 'upstream:vscode'. Please file this upstream: link to open issue
This issue will automatically close in 5 seconds.

repo-ranger

repo-ranger commented on Dec 19, 2022

@repo-ranger
Contributor

This issue has been marked as 'upstream:vscode'. Please file this upstream: link to open issue
This issue will automatically close in 5 seconds.

Anyexyz

Anyexyz commented on Apr 20, 2025

@Anyexyz

我确认了这个理论,当我从 CLI 安装语言时没有找到 languagepacks.json,而从 IU 安装时它可以工作

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.

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.

Thank you for your suggestion! Based on your idea, I wrote a Bash script to automatically generate the languagepacks.json file.
You can check it here:

With this setup, the languagepacks.json file will be automatically generated after installing a single language pack, making it easier to switch languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream:vscodeNeeds to be fixed upstream in VSCode

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ifduyue@jsjoeio@alanhe421@humbinal@dgadelha

        Issue actions

          Display language doesn't persist in code-server v3.11.0 running in Docker container when installing from CLI · Issue #3372 · coder/code-server