Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Select Topic Area

Question

Body

Hi 👋🏻

When using VS Code on the web with a GitHub Codespace, it seems to use the browser's display language. Is there a way to always set the display language of VS Code to English, specifically through the dev container configuration?

For example, is there a setting or configuration in the devcontainer.json file or elsewhere that can enforce the display language to be English regardless of the browser's language?

Any guidance or examples would be greatly appreciated!

You must be logged in to vote

Replies: 3 comments · 4 replies

Comment options

🕒 Discussion Activity Reminder 🕒

This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions:

1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as out of date at the bottom of the page.

2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own.

3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution.

Note: This dormant notification will only apply to Discussions with the Question label. To learn more, see our recent announcement.

Thank you for helping bring this Discussion to a resolution! 💬

You must be logged in to vote
1 reply
@mu88
Comment options

No solution yet, still relevant

Comment options

Yes — you can enforce VS Code’s display language inside a Codespace regardless of the browser language.

Add the following to your .devcontainer/devcontainer.json file under the customizations.vscode.settings section:

{
  "customizations": {
    "vscode": {
      "settings": {
        "locale": "en"
      }
    }
  }
}

When the Codespace starts, VS Code in the web UI will automatically apply this locale setting, overriding the browser’s default language.

If the change doesn’t apply immediately, try rebuilding the container or reloading the Codespace (Ctrl+Shift+P → Developer: Reload Window).

You must be logged in to vote
1 reply
@mu88
Comment options

Did you test this, because it doesn't work for me 🤔 although set (see here), it's still German for me

Comment options

Great question! When you're using GitHub Codespaces with VS Code on the web, it indeed defaults to the browser's language settings. If you'd like to force the display language of VS Code to always be English, regardless of the browser’s display language, you can enforce that in the Codespace's environment by setting a few configuration options.

Option 1: Set locale in devcontainer.json

One approach is to enforce the language setting by setting the locale in the devcontainer.json file, which configures your container environment. You can define environment variables directly in this file to control the language.

In your devcontainer.json, you can add the following setting:

{
  "name": "My Dev Container",
  "image": "your-docker-image",
  "settings": {
    "locale": "en"
  },
  "runArgs": [
    "--env",
    "LANG=en_US.UTF-8",
    "--env",
    "LC_ALL=en_US.UTF-8"
  ]
}

What this does:

  • locale setting: By setting the locale explicitly to en, you are enforcing English as the display language within the container environment.
  • Environment variables (LANG and LC_ALL): These environment variables set the system-wide locale settings. When VS Code is launched in the Codespace, it will inherit these settings and apply the correct language (English in this case).

Option 2: Modify VS Code's Settings via devcontainer.json

You can also directly set VS Code's language preferences via devcontainer.json by specifying settings within the settings section:

{
  "name": "My Dev Container",
  "image": "your-docker-image",
  "settings": {
    "locale": "en",
    "files.autoSave": "onWindowChange"
  }
}

This configuration is more specific to VS Code itself and ensures that VS Code’s display language is forced to English. You don't necessarily need to set the environment variables (LANG or LC_ALL) in this case, but it could be useful to handle broader localization settings.

Option 3: Use a postCreateCommand or postStartCommand to Set Locale

If you want more control and are working with specific containers or dependencies, you can add a postCreateCommand or postStartCommand to run commands that modify the locale during container creation or startup:

{
  "name": "My Dev Container",
  "image": "your-docker-image",
  "postCreateCommand": "sudo update-locale LANG=en_US.UTF-8"
}

Conclusion:

  • Forcing English: Set "locale": "en" directly in the devcontainer.json file. This is the cleanest and most direct way to enforce the language setting within VS Code on the web.
  • Environment Variables: Use LANG and LC_ALL environment variables in the devcontainer.json to set the system locale to English.
  • Post-commands: Use a postCreateCommand or postStartCommand to apply any language-specific settings after container creation.

This approach should work well for all languages and settings tied to VS Code within your GitHub Codespace, ensuring your interface remains in English, no matter what language the browser is set to.

You must be logged in to vote
1 reply
@mu88
Comment options

see here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codespaces Your development environment, in the cloud. Run VS Code and code on GitHub's cloud platform, Question Ask and answer questions about GitHub features and usage
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.