You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide.md
+45Lines changed: 45 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,9 @@
22
22
-[Proxying to a Svelte app](#proxying-to-a-svelte-app)
23
23
-[Prefixing `/absproxy/<port>` with a path](#prefixing-absproxyport-with-a-path)
24
24
-[Preflight requests](#preflight-requests)
25
+
-[Internationalization and customization](#internationalization-and-customization)
26
+
-[Available keys and placeholders](#available-keys-and-placeholders)
27
+
-[Legacy flag](#legacy-flag)
25
28
26
29
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
27
30
<!-- prettier-ignore-end -->
@@ -458,3 +461,45 @@ By default, if you have auth enabled, code-server will authenticate all proxied
458
461
requests including preflight requests. This can cause issues because preflight
459
462
requests do not typically include credentials. To allow all preflight requests
460
463
through the proxy without authentication, use `--skip-auth-preflight`.
464
+
465
+
## Internationalization and customization
466
+
467
+
code-server allows you to provide a JSON file to configure certain strings. This can be used for both internationalization and customization.
468
+
469
+
Create a JSON file with your custom strings:
470
+
471
+
```json
472
+
{
473
+
"WELCOME": "Welcome to {{app}}",
474
+
"LOGIN_TITLE": "{{app}} Access Portal",
475
+
"LOGIN_BELOW": "Please log in to continue",
476
+
"PASSWORD_PLACEHOLDER": "Enter Password"
477
+
}
478
+
```
479
+
480
+
Then reference the file:
481
+
482
+
```shell
483
+
code-server --i18n /path/to/custom-strings.json
484
+
```
485
+
486
+
Or this can be done in the config file:
487
+
488
+
```yaml
489
+
i18n: /path/to/custom-strings.json
490
+
```
491
+
492
+
You can combine this with the `--locale` flag to configure language support for both code-server and VS Code in cases where code-server has no support but VS Code does. If you are using this for internationalization, please consider sending us a pull request to contribute it to `src/node/i18n/locales`.
493
+
494
+
### Available keys and placeholders
495
+
496
+
Refer to [../src/node/i18n/locales/en.json](../src/node/i18n/locales/en.json) for a full list of the available keys for translations. Note that the only placeholders supported for each key are the ones used in the default string.
497
+
498
+
The `--app-name` flag controls the `{{app}}` placeholder in templates. If you want to change the name, you can either:
499
+
500
+
1. Set `--app-name` (potentially alongside `--i18n`)
501
+
2. Use `--i18n` and hardcode the name in your strings
502
+
503
+
### Legacy flag
504
+
505
+
The `--welcome-text` flag is now deprecated. Use the `WELCOME` key instead.
0 commit comments