Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
42d87350
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
42d87350
编写于
3月 22, 2016
作者:
D
Dirk Baeumer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #4520: Code will not start with locale='zh-cn' or locale='zh-tw'
上级
ef2a1fca
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
28 addition
and
47 deletion
+28
-47
build/lib/i18n.js
build/lib/i18n.js
+5
-5
build/lib/i18n.ts
build/lib/i18n.ts
+5
-5
extensions/typescript/src/typescriptMain.ts
extensions/typescript/src/typescriptMain.ts
+5
-4
src/main.js
src/main.js
+6
-3
src/vs/base/common/platform.ts
src/vs/base/common/platform.ts
+6
-2
src/vs/workbench/electron-browser/index.html
src/vs/workbench/electron-browser/index.html
+1
-28
未找到文件。
build/lib/i18n.js
浏览文件 @
42d87350
...
...
@@ -52,9 +52,9 @@ var vscodeLanguages = [
'
ita
'
];
var
iso639_3_to_2
=
{
'
chs
'
:
'
zh-
CN
'
,
'
cht
'
:
'
zh-
TW
'
,
'
csy
'
:
'
cs-
CZ
'
,
'
chs
'
:
'
zh-
ch
'
,
'
cht
'
:
'
zh-
tw
'
,
'
csy
'
:
'
cs-
cz
'
,
'
deu
'
:
'
de
'
,
'
enu
'
:
'
en
'
,
'
esn
'
:
'
es
'
,
...
...
@@ -65,10 +65,10 @@ var iso639_3_to_2 = {
'
kor
'
:
'
ko
'
,
'
nld
'
:
'
nl
'
,
'
plk
'
:
'
pl
'
,
'
ptb
'
:
'
pt-
BR
'
,
'
ptb
'
:
'
pt-
br
'
,
'
ptg
'
:
'
pt
'
,
'
rus
'
:
'
ru
'
,
'
sve
'
:
'
sv-
SE
'
,
'
sve
'
:
'
sv-
se
'
,
'
trk
'
:
'
tr
'
};
function
sortLanguages
(
directoryNames
)
{
...
...
build/lib/i18n.ts
浏览文件 @
42d87350
...
...
@@ -69,9 +69,9 @@ const vscodeLanguages: string[] = [
];
const
iso639_3_to_2
:
Map
<
string
>
=
{
'
chs
'
:
'
zh-
CN
'
,
'
cht
'
:
'
zh-
TW
'
,
'
csy
'
:
'
cs-
CZ
'
,
'
chs
'
:
'
zh-
ch
'
,
'
cht
'
:
'
zh-
tw
'
,
'
csy
'
:
'
cs-
cz
'
,
'
deu
'
:
'
de
'
,
'
enu
'
:
'
en
'
,
'
esn
'
:
'
es
'
,
...
...
@@ -82,10 +82,10 @@ const iso639_3_to_2: Map<string> = {
'
kor
'
:
'
ko
'
,
'
nld
'
:
'
nl
'
,
'
plk
'
:
'
pl
'
,
'
ptb
'
:
'
pt-
BR
'
,
'
ptb
'
:
'
pt-
br
'
,
'
ptg
'
:
'
pt
'
,
'
rus
'
:
'
ru
'
,
'
sve
'
:
'
sv-
SE
'
,
'
sve
'
:
'
sv-
se
'
,
'
trk
'
:
'
tr
'
};
...
...
extensions/typescript/src/typescriptMain.ts
浏览文件 @
42d87350
...
...
@@ -11,6 +11,11 @@
import
{
env
,
languages
,
commands
,
workspace
,
window
,
Uri
,
ExtensionContext
,
IndentAction
,
Diagnostic
,
DiagnosticCollection
,
Range
}
from
'
vscode
'
;
// This must be the first statement otherwise modules might got loaded with
// the wrong locale.
import
*
as
nls
from
'
vscode-nls
'
;
nls
.
config
({
locale
:
env
.
language
});
import
*
as
Proto
from
'
./protocol
'
;
import
TypeScriptServiceClient
from
'
./typescriptServiceClient
'
;
import
{
ITypescriptServiceClientHost
}
from
'
./typescriptService
'
;
...
...
@@ -30,8 +35,6 @@ import WorkspaceSymbolProvider from './features/workspaceSymbolProvider';
import
*
as
VersionStatus
from
'
./utils/versionStatus
'
;
import
*
as
ProjectStatus
from
'
./utils/projectStatus
'
;
import
*
as
nls
from
'
vscode-nls
'
;
interface
LanguageDescription
{
id
:
string
;
diagnosticSource
:
string
;
...
...
@@ -39,8 +42,6 @@ interface LanguageDescription {
}
export
function
activate
(
context
:
ExtensionContext
):
void
{
nls
.
config
({
locale
:
env
.
language
});
let
MODE_ID_TS
=
'
typescript
'
;
let
MODE_ID_TSX
=
'
typescriptreact
'
;
let
MODE_ID_JS
=
'
javascript
'
;
...
...
src/main.js
浏览文件 @
42d87350
...
...
@@ -36,8 +36,6 @@ function stripComments(content) {
return
result
;
};
// Duplicated in ../index.html for the renderes.
function
getNLSConfiguration
()
{
var
locale
=
undefined
;
var
localeOpts
=
'
--locale
'
;
...
...
@@ -65,10 +63,15 @@ function getNLSConfiguration() {
}
}
locale
=
locale
||
app
.
getLocale
();
// Language tags are case insensitve however an amd loader is case sensitive
// To make this work on case preserving & insensitive FS we do the following:
// the language bundles have lower case language tags and we always lower case
// the locale we receive from the user or OS.
locale
=
locale
?
locale
.
toLowerCase
()
:
locale
;
if
(
locale
===
'
pseudo
'
)
{
return
{
locale
:
locale
,
availableLanguages
:
{},
pseudo
:
true
}
}
locale
=
locale
||
app
.
getLocale
();
var
initialLocale
=
locale
;
if
(
process
.
env
.
VSCODE_DEV
)
{
return
{
locale
:
locale
,
availableLanguages
:
{}
};
...
...
src/vs/base/common/platform.ts
浏览文件 @
42d87350
...
...
@@ -89,12 +89,16 @@ export const isQunit = _isQunit;
export
const
platform
=
_platform
;
/**
* The language used for the user interface.
* The language used for the user interface. The format of
* the string is all lower case (e.g. zh-tw for Traditional
* Chinese)
*/
export
const
language
=
_language
;
/**
* The OS locale or the locale specified by --locale
* The OS locale or the locale specified by --locale. The format of
* the string is all lower case (e.g. zh-tw for Traditional
* Chinese)
*/
export
const
locale
=
_locale
;
...
...
src/vs/workbench/electron-browser/index.html
浏览文件 @
42d87350
...
...
@@ -97,33 +97,6 @@
process
.
on
(
'
uncaughtException
'
,
function
(
error
)
{
onError
(
error
,
enableDeveloperTools
)
});
}
function
getNlsPluginConfiguration
(
configuration
)
{
var
locale
=
configuration
.
locale
;
if
(
locale
===
'
pseudo
'
)
{
return
{
availableLanguages
:
{},
pseudo
:
true
}
}
if
(
!
configuration
.
isBuilt
)
{
return
{
availableLanguages
:
{}
};
}
// We have a built version so we have extracted nls file. Try to find
// the right file to use.
locale
=
locale
||
window
.
navigator
.
language
;
while
(
locale
)
{
var
candidate
=
path
.
join
(
__dirname
,
'
..
'
,
'
workbench.main.nls.
'
)
+
locale
+
'
.js
'
;
if
(
fs
.
existsSync
(
candidate
))
{
return
{
availableLanguages
:
{
'
*
'
:
locale
}
};
}
else
{
var
index
=
locale
.
lastIndexOf
(
'
-
'
);
if
(
index
>
0
)
{
locale
=
locale
.
substring
(
0
,
index
);
}
else
{
locale
=
null
;
}
}
}
return
{
availableLanguages
:
{}
};
}
</script>
<!-- Startup Code -->
...
...
@@ -173,7 +146,7 @@
}
catch
(
e
)
{
}
if
(
!
nlsConfig
)
{
nlsConfig
=
getNlsPluginConfiguration
(
configuration
)
;
nlsConfig
=
{
availableLanguages
:
{}
}
;
}
require
.
config
({
baseUrl
:
rootUrl
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录