Skip to content

Commit 288e794

Browse files
committed
Update locale file location
Should make language packs work again.
1 parent c567a06 commit 288e794

3 files changed

Lines changed: 22 additions & 17 deletions

File tree

ci/build.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -457,18 +457,18 @@ class Builder {
457457
}
458458

459459
let startingVscode = false
460+
let startedVscode = false
460461
onLine(vscode, (line, original) => {
461462
console.log("[vscode]", original)
462463
// Wait for watch-client since "Finished compilation" will appear multiple
463464
// times before the client starts building.
464465
if (!startingVscode && line.includes("Starting watch-client")) {
465466
startingVscode = true
466-
} else if (startingVscode && line.includes("Finished compilation") && process.env.AUTO_PATCH) {
467-
cp.exec("yarn patch:generate", { cwd: this.rootPath }, (error, _, stderr) => {
468-
if (error || stderr) {
469-
console.error(error ? error.message : stderr)
470-
}
471-
})
467+
} else if (startingVscode && line.includes("Finished compilation")) {
468+
if (startedVscode) {
469+
bundle.then(restartServer)
470+
}
471+
startedVscode = true
472472
}
473473
})
474474

ci/vscode.patch

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -985,10 +985,10 @@ index 0000000000..56331ff1fc
985985
+require('../../bootstrap-amd').load('vs/server/entry');
986986
diff --git a/src/vs/server/ipc.d.ts b/src/vs/server/ipc.d.ts
987987
new file mode 100644
988-
index 0000000000..82566066ff
988+
index 0000000000..a0d1d0df54
989989
--- /dev/null
990990
+++ b/src/vs/server/ipc.d.ts
991-
@@ -0,0 +1,106 @@
991+
@@ -0,0 +1,108 @@
992992
+/**
993993
+ * External interfaces for integration into code-server over IPC. No vs imports
994994
+ * should be made in this file.
@@ -1039,6 +1039,8 @@ index 0000000000..82566066ff
10391039
+ 'extra-extensions-dir'?: string[];
10401040
+ 'extra-builtin-extensions-dir'?: string[];
10411041
+
1042+
+ locale?: string
1043+
+
10421044
+ log?: string;
10431045
+ verbose?: boolean;
10441046
+
@@ -1995,10 +1997,10 @@ index 0000000000..8956fc40d4
19951997
+};
19961998
diff --git a/src/vs/server/node/nls.ts b/src/vs/server/node/nls.ts
19971999
new file mode 100644
1998-
index 0000000000..61c79d0d80
2000+
index 0000000000..3d428a57d3
19992001
--- /dev/null
20002002
+++ b/src/vs/server/node/nls.ts
2001-
@@ -0,0 +1,86 @@
2003+
@@ -0,0 +1,88 @@
20022004
+import * as fs from 'fs';
20032005
+import * as path from 'path';
20042006
+import * as util from 'util';
@@ -2052,13 +2054,15 @@ index 0000000000..61c79d0d80
20522054
+};
20532055
+
20542056
+export const getLocaleFromConfig = async (userDataPath: string): Promise<string> => {
2055-
+ let locale = 'en';
2056-
+ try {
2057-
+ const localeConfigUri = path.join(userDataPath, 'User/locale.json');
2058-
+ const content = stripComments(await util.promisify(fs.readFile)(localeConfigUri, 'utf8'));
2059-
+ locale = JSON.parse(content).locale;
2060-
+ } catch (error) { /* Ignore. */ }
2061-
+ return locale;
2057+
+ const files = ['locale.json', 'argv.json'];
2058+
+ for (let i = 0; i < files.length; ++i) {
2059+
+ try {
2060+
+ const localeConfigUri = path.join(userDataPath, 'User', files[i]);
2061+
+ const content = stripComments(await util.promisify(fs.readFile)(localeConfigUri, 'utf8'));
2062+
+ return JSON.parse(content).locale;
2063+
+ } catch (error) { /* Ignore. */ }
2064+
+ }
2065+
+ return 'en';
20622066
+};
20632067
+
20642068
+// Taken from src/main.js in the main VS Code source.

src/node/cli.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ const options: Options<Required<Args>> = {
102102
"install-extension": { type: "string[]" },
103103
"uninstall-extension": { type: "string[]" },
104104

105+
locale: { type: "string" },
105106
log: { type: LogLevel },
106107
verbose: { type: "boolean", short: "vvv", description: "Enable verbose logging." },
107108
}

0 commit comments

Comments
 (0)