@@ -12,6 +12,8 @@ We can remove this once upstream supports all language packs.
12
12
5. Add the locale flag.
13
13
6. Remove the redundant locale verification. It does the same as the existing
14
14
one but is worse because it does not handle non-existent or empty files.
15
+ 7. Replace some caching and Node requires because code-server does not restart
16
+ when changing the language unlike native Code.
15
17
16
18
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
17
19
===================================================================
@@ -312,3 +314,18 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-san
312
314
await this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true);
313
315
return true;
314
316
}
317
+ Index: code-server/lib/vscode/src/vs/base/node/languagePacks.js
318
+ ===================================================================
319
+ --- code-server.orig/lib/vscode/src/vs/base/node/languagePacks.js
320
+ +++ code-server/lib/vscode/src/vs/base/node/languagePacks.js
321
+ @@ -73,7 +73,9 @@
322
+ function getLanguagePackConfigurations(userDataPath) {
323
+ const configFile = path.join(userDataPath, 'languagepacks.json');
324
+ try {
325
+ - return nodeRequire(configFile);
326
+ + // This must not use Node otherwise it will be cached. code-server does
327
+ + // not restart so this would never update.
328
+ + return JSON.parse(fs.readFileSync(configFile, "utf8"));
329
+ } catch (err) {
330
+ // Do nothing. If we can't read the file we have no
331
+ // language pack config.
0 commit comments