Update locale file location
Should make language packs work again.
This commit is contained in:
parent
c567a06ff5
commit
288e794c99
12
ci/build.ts
12
ci/build.ts
|
@ -457,18 +457,18 @@ class Builder {
|
||||||
}
|
}
|
||||||
|
|
||||||
let startingVscode = false
|
let startingVscode = false
|
||||||
|
let startedVscode = false
|
||||||
onLine(vscode, (line, original) => {
|
onLine(vscode, (line, original) => {
|
||||||
console.log("[vscode]", original)
|
console.log("[vscode]", original)
|
||||||
// Wait for watch-client since "Finished compilation" will appear multiple
|
// Wait for watch-client since "Finished compilation" will appear multiple
|
||||||
// times before the client starts building.
|
// times before the client starts building.
|
||||||
if (!startingVscode && line.includes("Starting watch-client")) {
|
if (!startingVscode && line.includes("Starting watch-client")) {
|
||||||
startingVscode = true
|
startingVscode = true
|
||||||
} else if (startingVscode && line.includes("Finished compilation") && process.env.AUTO_PATCH) {
|
} else if (startingVscode && line.includes("Finished compilation")) {
|
||||||
cp.exec("yarn patch:generate", { cwd: this.rootPath }, (error, _, stderr) => {
|
if (startedVscode) {
|
||||||
if (error || stderr) {
|
bundle.then(restartServer)
|
||||||
console.error(error ? error.message : stderr)
|
}
|
||||||
}
|
startedVscode = true
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -985,10 +985,10 @@ index 0000000000..56331ff1fc
|
||||||
+require('../../bootstrap-amd').load('vs/server/entry');
|
+require('../../bootstrap-amd').load('vs/server/entry');
|
||||||
diff --git a/src/vs/server/ipc.d.ts b/src/vs/server/ipc.d.ts
|
diff --git a/src/vs/server/ipc.d.ts b/src/vs/server/ipc.d.ts
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000..82566066ff
|
index 0000000000..a0d1d0df54
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/vs/server/ipc.d.ts
|
+++ b/src/vs/server/ipc.d.ts
|
||||||
@@ -0,0 +1,106 @@
|
@@ -0,0 +1,108 @@
|
||||||
+/**
|
+/**
|
||||||
+ * External interfaces for integration into code-server over IPC. No vs imports
|
+ * External interfaces for integration into code-server over IPC. No vs imports
|
||||||
+ * should be made in this file.
|
+ * should be made in this file.
|
||||||
|
@ -1039,6 +1039,8 @@ index 0000000000..82566066ff
|
||||||
+ 'extra-extensions-dir'?: string[];
|
+ 'extra-extensions-dir'?: string[];
|
||||||
+ 'extra-builtin-extensions-dir'?: string[];
|
+ 'extra-builtin-extensions-dir'?: string[];
|
||||||
+
|
+
|
||||||
|
+ locale?: string
|
||||||
|
+
|
||||||
+ log?: string;
|
+ log?: string;
|
||||||
+ verbose?: boolean;
|
+ verbose?: boolean;
|
||||||
+
|
+
|
||||||
|
@ -1995,10 +1997,10 @@ index 0000000000..8956fc40d4
|
||||||
+};
|
+};
|
||||||
diff --git a/src/vs/server/node/nls.ts b/src/vs/server/node/nls.ts
|
diff --git a/src/vs/server/node/nls.ts b/src/vs/server/node/nls.ts
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000..61c79d0d80
|
index 0000000000..3d428a57d3
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/vs/server/node/nls.ts
|
+++ b/src/vs/server/node/nls.ts
|
||||||
@@ -0,0 +1,86 @@
|
@@ -0,0 +1,88 @@
|
||||||
+import * as fs from 'fs';
|
+import * as fs from 'fs';
|
||||||
+import * as path from 'path';
|
+import * as path from 'path';
|
||||||
+import * as util from 'util';
|
+import * as util from 'util';
|
||||||
|
@ -2052,13 +2054,15 @@ index 0000000000..61c79d0d80
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+export const getLocaleFromConfig = async (userDataPath: string): Promise<string> => {
|
+export const getLocaleFromConfig = async (userDataPath: string): Promise<string> => {
|
||||||
+ let locale = 'en';
|
+ const files = ['locale.json', 'argv.json'];
|
||||||
+ try {
|
+ for (let i = 0; i < files.length; ++i) {
|
||||||
+ const localeConfigUri = path.join(userDataPath, 'User/locale.json');
|
+ try {
|
||||||
+ const content = stripComments(await util.promisify(fs.readFile)(localeConfigUri, 'utf8'));
|
+ const localeConfigUri = path.join(userDataPath, 'User', files[i]);
|
||||||
+ locale = JSON.parse(content).locale;
|
+ const content = stripComments(await util.promisify(fs.readFile)(localeConfigUri, 'utf8'));
|
||||||
+ } catch (error) { /* Ignore. */ }
|
+ return JSON.parse(content).locale;
|
||||||
+ return locale;
|
+ } catch (error) { /* Ignore. */ }
|
||||||
|
+ }
|
||||||
|
+ return 'en';
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+// Taken from src/main.js in the main VS Code source.
|
+// Taken from src/main.js in the main VS Code source.
|
||||||
|
|
|
@ -102,6 +102,7 @@ const options: Options<Required<Args>> = {
|
||||||
"install-extension": { type: "string[]" },
|
"install-extension": { type: "string[]" },
|
||||||
"uninstall-extension": { type: "string[]" },
|
"uninstall-extension": { type: "string[]" },
|
||||||
|
|
||||||
|
locale: { type: "string" },
|
||||||
log: { type: LogLevel },
|
log: { type: LogLevel },
|
||||||
verbose: { type: "boolean", short: "vvv", description: "Enable verbose logging." },
|
verbose: { type: "boolean", short: "vvv", description: "Enable verbose logging." },
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue