Compare commits

..

3 Commits

Author SHA1 Message Date
Olivier Benz
47e9d43922 Update Code to 1.102.1 (#7424) 2025-07-17 10:55:37 -08:00
Asher
f26309a23c Release v4.102.0 2025-07-16 18:56:42 -08:00
Asher
0f9a0e8fb3 Revert escaping for i18n strings
Looks like the library already escapes, so we were getting double
escaping.
2025-07-16 18:10:11 -08:00
6 changed files with 36 additions and 20 deletions

View File

@@ -22,6 +22,22 @@ Code v99.99.999
## Unreleased
## [4.102.0](https://github.com/coder/code-server/releases/tag/v4.102.0) - 2025-07-16
Code v1.102.0
### Changed
- Update to Code 1.102.0.
### Added
- Custom strings can be configured using the `--i18n` flag set to a JSON
file. This can be used for either translation (and can be used alongside
`--locale`) or for customizing the strings. See
[./src/node/i18n/locales/en.json](./src/node/i18n/locales/en.json) for the
available keys.
## [4.101.2](https://github.com/coder/code-server/releases/tag/v4.101.2) - 2025-06-25
Code v1.101.2

View File

@@ -15,9 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3.28.1
version: 3.29.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 4.101.2
appVersion: 4.102.0

View File

@@ -6,7 +6,7 @@ replicaCount: 1
image:
repository: codercom/code-server
tag: '4.101.2'
tag: '4.102.0'
pullPolicy: Always
# Specifies one or more secrets to be used when pulling images from a

View File

@@ -464,7 +464,8 @@ through the proxy without authentication, use `--skip-auth-preflight`.
## Internationalization and customization
code-server allows you to provide a JSON file to configure certain strings. This can be used for both internationalization and customization.
code-server allows you to provide a JSON file to configure certain strings. This
can be used for both internationalization and customization.
Create a JSON file with your custom strings:
@@ -489,13 +490,19 @@ Or this can be done in the config file:
i18n: /path/to/custom-strings.json
```
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`.
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`.
### Available keys and placeholders
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.
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.
The `--app-name` flag controls the `{{app}}` placeholder in templates. If you want to change the name, you can either:
The `--app-name` flag controls the `{{app}}` placeholder in templates. If you
want to change the name, you can either:
1. Set `--app-name` (potentially alongside `--i18n`)
2. Use `--i18n` and hardcode the name in your strings

View File

@@ -31,7 +31,7 @@ const getRoot = async (req: Request, error?: Error): Promise<string> => {
const locale = req.args["locale"] || "en"
i18n.changeLanguage(locale)
const appName = req.args["app-name"] || "code-server"
const welcomeText = escapeHtml(req.args["welcome-text"] || (i18n.t("WELCOME", { app: appName }) as string))
const welcomeText = req.args["welcome-text"] || (i18n.t("WELCOME", { app: appName }) as string)
// Determine password message using i18n
let passwordMsg = i18n.t("LOGIN_PASSWORD", { configFile: req.args.config })
@@ -40,23 +40,16 @@ const getRoot = async (req: Request, error?: Error): Promise<string> => {
} else if (req.args.usingEnvHashedPassword) {
passwordMsg = i18n.t("LOGIN_USING_HASHED_PASSWORD")
}
passwordMsg = escapeHtml(passwordMsg)
// Get messages from i18n (with HTML escaping for security)
const loginTitle = escapeHtml(i18n.t("LOGIN_TITLE", { app: appName }))
const loginBelow = escapeHtml(i18n.t("LOGIN_BELOW"))
const passwordPlaceholder = escapeHtml(i18n.t("PASSWORD_PLACEHOLDER"))
const submitText = escapeHtml(i18n.t("SUBMIT"))
return replaceTemplates(
req,
content
.replace(/{{I18N_LOGIN_TITLE}}/g, loginTitle)
.replace(/{{I18N_LOGIN_TITLE}}/g, i18n.t("LOGIN_TITLE", { app: appName }))
.replace(/{{WELCOME_TEXT}}/g, welcomeText)
.replace(/{{PASSWORD_MSG}}/g, passwordMsg)
.replace(/{{I18N_LOGIN_BELOW}}/g, loginBelow)
.replace(/{{I18N_PASSWORD_PLACEHOLDER}}/g, passwordPlaceholder)
.replace(/{{I18N_SUBMIT}}/g, submitText)
.replace(/{{I18N_LOGIN_BELOW}}/g, i18n.t("LOGIN_BELOW"))
.replace(/{{I18N_PASSWORD_PLACEHOLDER}}/g, i18n.t("PASSWORD_PLACEHOLDER"))
.replace(/{{I18N_SUBMIT}}/g, i18n.t("SUBMIT"))
.replace(/{{ERROR}}/, error ? `<div class="error">${escapeHtml(error.message)}</div>` : ""),
)
}