Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
彭彦祖
code-server
提交
288e794c
C
code-server
项目概览
彭彦祖
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
288e794c
编写于
2月 20, 2020
作者:
A
Asher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update locale file location
Should make language packs work again.
上级
c567a06f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
17 deletion
+22
-17
ci/build.ts
ci/build.ts
+6
-6
ci/vscode.patch
ci/vscode.patch
+15
-11
src/node/cli.ts
src/node/cli.ts
+1
-0
未找到文件。
ci/build.ts
浏览文件 @
288e794c
...
...
@@ -457,18 +457,18 @@ class Builder {
}
let
startingVscode
=
false
let
startedVscode
=
false
onLine
(
vscode
,
(
line
,
original
)
=>
{
console
.
log
(
"
[vscode]
"
,
original
)
// Wait for watch-client since "Finished compilation" will appear multiple
// times before the client starts building.
if
(
!
startingVscode
&&
line
.
includes
(
"
Starting watch-client
"
))
{
startingVscode
=
true
}
else
if
(
startingVscode
&&
line
.
includes
(
"
Finished compilation
"
)
&&
process
.
env
.
AUTO_PATCH
)
{
cp
.
exec
(
"
yarn patch:generate
"
,
{
cwd
:
this
.
rootPath
},
(
error
,
_
,
stderr
)
=>
{
if
(
error
||
stderr
)
{
console
.
error
(
error
?
error
.
message
:
stderr
)
}
})
}
else
if
(
startingVscode
&&
line
.
includes
(
"
Finished compilation
"
))
{
if
(
startedVscode
)
{
bundle
.
then
(
restartServer
)
}
startedVscode
=
true
}
})
...
...
ci/vscode.patch
浏览文件 @
288e794c
...
...
@@ -985,10 +985,10 @@ index 0000000000..56331ff1fc
+require('../../bootstrap-amd').load('vs/server/entry');
diff --git a/src/vs/server/ipc.d.ts b/src/vs/server/ipc.d.ts
new file mode 100644
index 0000000000..
82566066ff
index 0000000000..
a0d1d0df54
--- /dev/null
+++ b/src/vs/server/ipc.d.ts
@@ -0,0 +1,10
6
@@
@@ -0,0 +1,10
8
@@
+/**
+ * External interfaces for integration into code-server over IPC. No vs imports
+ * should be made in this file.
...
...
@@ -1039,6 +1039,8 @@ index 0000000000..82566066ff
+ 'extra-extensions-dir'?: string[];
+ 'extra-builtin-extensions-dir'?: string[];
+
+ locale?: string
+
+ log?: string;
+ 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
new file mode 100644
index 0000000000..
61c79d0d80
index 0000000000..
3d428a57d3
--- /dev/null
+++ b/src/vs/server/node/nls.ts
@@ -0,0 +1,8
6
@@
@@ -0,0 +1,8
8
@@
+import * as fs from 'fs';
+import * as path from 'path';
+import * as util from 'util';
...
...
@@ -2052,13 +2054,15 @@ index 0000000000..61c79d0d80
+};
+
+export const getLocaleFromConfig = async (userDataPath: string): Promise<string> => {
+ let locale = 'en';
+ try {
+ const localeConfigUri = path.join(userDataPath, 'User/locale.json');
+ const content = stripComments(await util.promisify(fs.readFile)(localeConfigUri, 'utf8'));
+ locale = JSON.parse(content).locale;
+ } catch (error) { /* Ignore. */ }
+ return locale;
+ const files = ['locale.json', 'argv.json'];
+ for (let i = 0; i < files.length; ++i) {
+ try {
+ const localeConfigUri = path.join(userDataPath, 'User', files[i]);
+ const content = stripComments(await util.promisify(fs.readFile)(localeConfigUri, 'utf8'));
+ return JSON.parse(content).locale;
+ } catch (error) { /* Ignore. */ }
+ }
+ return 'en';
+};
+
+// Taken from src/main.js in the main VS Code source.
...
...
src/node/cli.ts
浏览文件 @
288e794c
...
...
@@ -102,6 +102,7 @@ const options: Options<Required<Args>> = {
"
install-extension
"
:
{
type
:
"
string[]
"
},
"
uninstall-extension
"
:
{
type
:
"
string[]
"
},
locale
:
{
type
:
"
string
"
},
log
:
{
type
:
LogLevel
},
verbose
:
{
type
:
"
boolean
"
,
short
:
"
vvv
"
,
description
:
"
Enable verbose logging.
"
},
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录