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
refactor: simplify --i18n flag to file-only approach
Replace dual JSON/file path functionality with file-only approach for cleaner,
more predictable behavior. Since this is a new feature that hasn't been
released yet, this change eliminates potential user confusion without
breaking existing workflows.
Changes:
- Modify loadCustomStrings() to only accept file paths
- Enhanced error handling with specific messages for file vs JSON errors
- Remove inline JSON parsing from CLI argument handling
- Update flag description to reflect file-only approach
- Add comprehensive test suite covering all error scenarios
- Update documentation to show only file-based examples
Benefits:
- Eliminates semantic ambiguity about argument format
- Clearer error messages (file not found vs invalid JSON)
- Follows Unix conventions for configuration files
- Simpler implementation with better TypeScript typing
- Can enhance with inline JSON later if demand exists
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: docs/guide.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -461,22 +461,29 @@ through the proxy without authentication, use `--skip-auth-preflight`.
461
461
462
462
## Internationalization and customization
463
463
464
-
code-server allows you to provide a language file or JSON to configure certain strings. This can be used for both internationalization and customization.
464
+
code-server allows you to provide a JSON file to configure certain strings. This can be used for both internationalization and customization.
465
465
466
-
For example:
466
+
Create a JSON file with your custom strings:
467
+
468
+
```json
469
+
{
470
+
"WELCOME": "Welcome to {{app}}",
471
+
"LOGIN_TITLE": "{{app}} Access Portal",
472
+
"LOGIN_BELOW": "Please log in to continue",
473
+
"PASSWORD_PLACEHOLDER": "Enter Password"
474
+
}
475
+
```
476
+
477
+
Then reference the file:
467
478
468
479
```shell
469
-
code-server --i18n /custom-strings.json
470
-
code-server --i18n '{"WELCOME": "{{app}} ログイン"}'
480
+
code-server --i18n /path/to/custom-strings.json
471
481
```
472
482
473
483
Or this can be done in the config file:
474
484
475
485
```yaml
476
-
i18n: |
477
-
{
478
-
"WELCOME": "Welcome to the {{app}} Development Portal"
479
-
}
486
+
i18n: /path/to/custom-strings.json
480
487
```
481
488
482
489
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`.
0 commit comments