Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
cddd0614
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,发现更多精彩内容 >>
提交
cddd0614
编写于
6月 28, 2018
作者:
R
Ramya Achutha Rao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Map zh-cn,zh-tw to zh-hans,zh-hant Fixes #53275
上级
1e7d0075
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
7 deletion
+13
-7
src/vs/workbench/parts/localizations/electron-browser/localizations.contribution.ts
...alizations/electron-browser/localizations.contribution.ts
+13
-7
未找到文件。
src/vs/workbench/parts/localizations/electron-browser/localizations.contribution.ts
浏览文件 @
cddd0614
...
...
@@ -141,8 +141,9 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo
return
;
}
const
ceintlExtensionSearch
=
this
.
galleryService
.
query
({
names
:
[
`MS-CEINTL.vscode-language-pack-
${
locale
}
`
],
pageSize
:
1
});
const
tagSearch
=
this
.
galleryService
.
query
({
text
:
`tag:lp-
${
locale
}
`
,
pageSize
:
1
});
const
currentLocale
=
this
.
getPossibleChineseMapping
(
locale
);
const
ceintlExtensionSearch
=
this
.
galleryService
.
query
({
names
:
[
`MS-CEINTL.vscode-language-pack-
${
currentLocale
}
`
],
pageSize
:
1
});
const
tagSearch
=
this
.
galleryService
.
query
({
text
:
`tag:lp-
${
currentLocale
}
`
,
pageSize
:
1
});
TPromise
.
join
([
ceintlExtensionSearch
,
tagSearch
]).
then
(([
ceintlResult
,
tagResult
])
=>
{
if
(
ceintlResult
.
total
===
0
&&
tagResult
.
total
===
0
)
{
...
...
@@ -156,11 +157,11 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo
return
;
}
TPromise
.
join
([
this
.
galleryService
.
getManifest
(
extensionToFetchTranslationsFrom
),
this
.
galleryService
.
getCoreTranslation
(
extensionToFetchTranslationsFrom
,
l
ocale
)])
TPromise
.
join
([
this
.
galleryService
.
getManifest
(
extensionToFetchTranslationsFrom
),
this
.
galleryService
.
getCoreTranslation
(
extensionToFetchTranslationsFrom
,
currentL
ocale
)])
.
then
(([
manifest
,
translation
])
=>
{
const
loc
=
manifest
&&
manifest
.
contributes
&&
manifest
.
contributes
.
localizations
&&
manifest
.
contributes
.
localizations
.
filter
(
x
=>
x
.
languageId
.
toLowerCase
()
===
l
ocale
)[
0
];
const
languageName
=
loc
?
(
loc
.
languageName
||
locale
)
:
l
ocale
;
const
languageDisplayName
=
loc
?
(
loc
.
localizedLanguageName
||
loc
.
languageName
||
locale
)
:
l
ocale
;
const
loc
=
manifest
&&
manifest
.
contributes
&&
manifest
.
contributes
.
localizations
&&
manifest
.
contributes
.
localizations
.
filter
(
x
=>
this
.
getPossibleChineseMapping
(
x
.
languageId
)
===
currentL
ocale
)[
0
];
const
languageName
=
loc
?
(
loc
.
languageName
||
currentLocale
)
:
currentL
ocale
;
const
languageDisplayName
=
loc
?
(
loc
.
localizedLanguageName
||
loc
.
languageName
||
currentLocale
)
:
currentL
ocale
;
const
translationsFromPack
=
translation
&&
translation
.
contents
?
translation
.
contents
[
'
vs/platform/node/minimalTranslations
'
]
:
{};
const
promptMessageKey
=
extensionToInstall
?
'
installAndRestartMessage
'
:
'
showLanguagePackExtensions
'
;
const
useEnglish
=
!
translationsFromPack
[
promptMessageKey
];
...
...
@@ -191,7 +192,7 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo
this
.
viewletService
.
openViewlet
(
EXTENSIONS_VIEWLET_ID
,
true
)
.
then
(
viewlet
=>
viewlet
as
IExtensionsViewlet
)
.
then
(
viewlet
=>
{
viewlet
.
search
(
`tag:lp-
${
l
ocale
}
`
);
viewlet
.
search
(
`tag:lp-
${
currentL
ocale
}
`
);
viewlet
.
focus
();
});
}
...
...
@@ -235,6 +236,11 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo
}
private
getPossibleChineseMapping
(
locale
:
string
):
string
{
locale
=
locale
.
toLowerCase
();
return
locale
===
'
zh-cn
'
?
'
zh-hans
'
:
locale
===
'
zh-tw
'
?
'
zh-hant
'
:
locale
;
}
private
getLanguagePackExtension
(
language
:
string
):
TPromise
<
IGalleryExtension
>
{
return
this
.
localizationService
.
getLanguageIds
(
LanguageType
.
Core
)
.
then
(
coreLanguages
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录