Add language customization flag (#7374)

This allows you to customize any string (that has a translation) or add your own translations.
This commit is contained in:
Alex Strick van Linschoten
2025-07-15 22:38:27 +02:00
committed by GitHub
parent 8b3d9b9e0a
commit 92fca0dcc3
8 changed files with 471 additions and 23 deletions

View File

@@ -7,6 +7,7 @@ import { plural } from "../common/util"
import { createApp, ensureAddress } from "./app"
import { AuthType, DefaultedArgs, Feature, toCodeArgs, UserProvidedArgs } from "./cli"
import { commit, version, vsRootPath } from "./constants"
import { loadCustomStrings } from "./i18n"
import { register } from "./routes"
import { VSCodeModule } from "./routes/vscode"
import { isDirectory, open } from "./util"
@@ -122,6 +123,12 @@ export const runCodeServer = async (
): Promise<{ dispose: Disposable["dispose"]; server: http.Server }> => {
logger.info(`code-server ${version} ${commit}`)
// Load custom strings if provided
if (args.i18n) {
await loadCustomStrings(args.i18n)
logger.info("Loaded custom strings")
}
logger.info(`Using user-data-dir ${args["user-data-dir"]}`)
logger.debug(`Using extensions-dir ${args["extensions-dir"]}`)