Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
85032a3f
M
mindinsight
项目概览
MindSpore
/
mindinsight
通知
7
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindinsight
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
85032a3f
编写于
8月 14, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
8月 14, 2020
浏览文件
操作
浏览文件
下载
差异文件
!521 UI add protecting of language settings
Merge pull request !521 from 黄伟锋/myMaster
上级
74971ff4
47a5f8d3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
13 deletion
+27
-13
mindinsight/ui/src/components/header.vue
mindinsight/ui/src/components/header.vue
+8
-6
mindinsight/ui/src/i18n.js
mindinsight/ui/src/i18n.js
+3
-2
mindinsight/ui/src/main.js
mindinsight/ui/src/main.js
+8
-4
mindinsight/ui/src/views/train-manage/graph.vue
mindinsight/ui/src/views/train-manage/graph.vue
+8
-1
未找到文件。
mindinsight/ui/src/components/header.vue
浏览文件 @
85032a3f
...
@@ -172,12 +172,14 @@ export default {
...
@@ -172,12 +172,14 @@ export default {
set
(
val
)
{},
set
(
val
)
{},
},
},
isChinese
()
{
isChinese
()
{
let
isChinese
=
false
;
let
isChinese
=
true
;
if
(
const
languageList
=
[
'
zh-cn
'
,
'
en-us
'
];
localStorage
.
getItem
(
'
milang
'
)
&&
const
language
=
window
.
localStorage
.
getItem
(
'
milang
'
);
localStorage
.
getItem
(
'
milang
'
)
===
'
zh-cn
'
)
{
if
(
language
&&
languageList
.
includes
(
language
))
{
isChinese
=
true
;
isChinese
=
language
===
languageList
[
0
];
}
else
{
window
.
localStorage
.
setItem
(
'
milang
'
,
languageList
[
0
]);
}
}
return
isChinese
;
return
isChinese
;
},
},
...
...
mindinsight/ui/src/i18n.js
浏览文件 @
85032a3f
...
@@ -37,14 +37,15 @@ function loadLocaleMessages() {
...
@@ -37,14 +37,15 @@ function loadLocaleMessages() {
}
}
/* load default language pack */
/* load default language pack */
const
languageList
=
[
'
zh-cn
'
,
'
en-us
'
];
const
langStorge
=
window
.
localStorage
.
getItem
(
'
milang
'
);
const
langStorge
=
window
.
localStorage
.
getItem
(
'
milang
'
);
let
langflag
;
let
langflag
;
// Check language by default
// Check language by default
if
(
langStorge
)
{
if
(
langStorge
&&
languageList
.
includes
(
langStorge
)
)
{
langflag
=
langStorge
;
langflag
=
langStorge
;
}
else
{
}
else
{
// set Chinese if no default language
// set Chinese if no default language
langflag
=
'
zh-cn
'
;
langflag
=
languageList
[
0
]
;
window
.
localStorage
.
setItem
(
'
milang
'
,
langflag
);
window
.
localStorage
.
setItem
(
'
milang
'
,
langflag
);
}
}
...
...
mindinsight/ui/src/main.js
浏览文件 @
85032a3f
...
@@ -26,10 +26,14 @@ import $ from 'jquery';
...
@@ -26,10 +26,14 @@ import $ from 'jquery';
import
locale
from
'
element-ui/lib/locale/lang/en
'
;
import
locale
from
'
element-ui/lib/locale/lang/en
'
;
import
localezh
from
'
element-ui/lib/locale/lang/zh-CN
'
;
import
localezh
from
'
element-ui/lib/locale/lang/zh-CN
'
;
if
(
let
language
=
window
.
localStorage
.
getItem
(
'
milang
'
);
localStorage
.
getItem
(
'
milang
'
)
&&
const
languageList
=
[
'
zh-cn
'
,
'
en-us
'
];
localStorage
.
getItem
(
'
milang
'
)
!==
'
zh-cn
'
if
(
!
language
||
!
languageList
.
includes
(
language
))
{
)
{
language
=
languageList
[
0
];
window
.
localStorage
.
setItem
(
'
milang
'
,
language
);
}
if
(
language
!==
languageList
[
0
])
{
Vue
.
use
(
ElementUI
,
{
locale
});
Vue
.
use
(
ElementUI
,
{
locale
});
}
else
{
}
else
{
Vue
.
use
(
ElementUI
,
{
localezh
});
Vue
.
use
(
ElementUI
,
{
localezh
});
...
...
mindinsight/ui/src/views/train-manage/graph.vue
浏览文件 @
85032a3f
...
@@ -529,7 +529,14 @@ export default {
...
@@ -529,7 +529,14 @@ export default {
}
}
this
.
trainJobID
=
this
.
$route
.
query
.
train_id
;
this
.
trainJobID
=
this
.
$route
.
query
.
train_id
;
this
.
language
=
localStorage
.
getItem
(
'
milang
'
)
||
'
zh-cn
'
;
this
.
language
=
window
.
localStorage
.
getItem
(
'
milang
'
);
const
languageList
=
[
'
zh-cn
'
,
'
en-us
'
];
if
(
!
this
.
language
||
!
languageList
.
includes
(
this
.
language
))
{
this
.
language
=
languageList
[
0
];
window
.
localStorage
.
setItem
(
'
milang
'
,
this
.
language
);
}
document
.
title
=
`
${
decodeURIComponent
(
this
.
trainJobID
)}
-
${
this
.
$t
(
document
.
title
=
`
${
decodeURIComponent
(
this
.
trainJobID
)}
-
${
this
.
$t
(
'
graph.titleText
'
,
'
graph.titleText
'
,
)}
-MindInsight`
;
)}
-MindInsight`
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录