Skip to content

Commit d0114e7

Browse files
committed
nav international
1 parent 2b925b5 commit d0114e7

File tree

6 files changed

+63
-31
lines changed

6 files changed

+63
-31
lines changed

index.html

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
<div id="app">
1515
<div class="nav" @mouseenter="animbck" @mouseleave="animfwd">
1616
<div id="extlinks">
17-
<a id="title" href="https://logcreative.github.io/LaTeXSparkle/" target="_blank" >
18-
<embed src="res/logo/cnflogo.svg" class="flogo">
19-
</a>
17+
<div id="title" v-html="$t('nav.flogoadd')"></div>
2018
<div id="poweredby" class="accordion">
2119
<a class="acckey" @click="changelang" target="_blank" style="cursor: pointer;" :title="$t('nav.lang_title')"><div class="icon" style="display: inline; font-weight: bold;">{{$t('nav.lang_icon')}} </div><div class="value">{{$t('nav.lang')}}</div></a>
2220
<!-- darkmode -->
@@ -32,16 +30,16 @@
3230
<a href="https://github.com/LogCreative/PGFPlotsEdt" target="_blank">{{ $t('nav.title') }}</a><br>
3331
<div style="display: inline-block; color: rgba(128, 128, 128, 0.5);">{{ $t('nav.subtitle') }} <div id="version" style="display: inline-block;"></div></div>
3432
<div id="template" class="accordion">
35-
<tplbutton tplname="折线图" :tplid="1"></tplbutton>
36-
<tplbutton tplname="折点图" :tplid="2"></tplbutton>
37-
<tplbutton tplname="散点图" :tplid="3"></tplbutton>
38-
<tplbutton tplname="柱形图" :tplid="4"></tplbutton>
39-
<tplbutton tplname="面积图" :tplid="5"></tplbutton>
40-
<tplbutton tplname="曲面图" :tplid="6"></tplbutton>
41-
<tplbutton tplname="等高图" :tplid="7"></tplbutton>
42-
<tplbutton tplname="直方图" :tplid="8"></tplbutton>
43-
<tplbutton tplname="箱式图" :tplid="9"></tplbutton>
44-
<tplbutton tplname="极坐标" :tplid="10"></tplbutton>
33+
<tplbutton :tplname="$t('nav.tpl1')" :tplid="1"></tplbutton>
34+
<tplbutton :tplname="$t('nav.tpl2')" :tplid="2"></tplbutton>
35+
<tplbutton :tplname="$t('nav.tpl3')" :tplid="3"></tplbutton>
36+
<tplbutton :tplname="$t('nav.tpl4')" :tplid="4"></tplbutton>
37+
<tplbutton :tplname="$t('nav.tpl5')" :tplid="5"></tplbutton>
38+
<tplbutton :tplname="$t('nav.tpl6')" :tplid="6"></tplbutton>
39+
<tplbutton :tplname="$t('nav.tpl7')" :tplid="7"></tplbutton>
40+
<tplbutton :tplname="$t('nav.tpl8')" :tplid="8"></tplbutton>
41+
<tplbutton :tplname="$t('nav.tpl9')" :tplid="9"></tplbutton>
42+
<tplbutton :tplname="$t('nav.tpl10')" :tplid="10"></tplbutton>
4543
</div>
4644
</div>
4745
</div>

lang/cn.json

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
{
2-
"nav":{
3-
"title": "PGFPlots 统计绘图编辑器",
4-
"subtitle": "PGFPlotsEdt",
5-
"lang": "简体中文",
6-
"lang_icon": "CN",
7-
"lang_title": "切换语言",
8-
"doc": "宏包文档"
9-
}
10-
}
2+
"nav": {
3+
"title": "PGFPlots 统计绘图编辑器",
4+
"subtitle": "PGFPlotsEdt",
5+
"lang": "简体中文",
6+
"lang_icon": "CN",
7+
"lang_title": "切换语言",
8+
"doc": "宏包文档",
9+
"flogoadd": "<embed src=\"res/logo/cnflogo.svg\" height=\"35px\">",
10+
"tpl1": "折线图",
11+
"tpl2": "折点图",
12+
"tpl3": "散点图",
13+
"tpl4": "柱形图",
14+
"tpl5": "面积图",
15+
"tpl6": "曲面图",
16+
"tpl7": "等高图",
17+
"tpl8": "直方图",
18+
"tpl9": "箱式图",
19+
"tpl10": "极坐标"
20+
}
21+
}

lang/en.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
"lang": "English",
66
"lang_icon": "EN",
77
"lang_title": "Change language",
8-
"doc": "Package Documentation"
8+
"doc": "Package Documentation",
9+
"flogoadd": "<embed src=\"res/logo/enflogo.svg\" height=\"35px\">",
10+
"tpl1": "Line",
11+
"tpl10": "Polar",
12+
"tpl2": "Mark",
13+
"tpl3": "Scatter",
14+
"tpl4": "Bar",
15+
"tpl5": "Area",
16+
"tpl6": "Surf",
17+
"tpl7": "Contour",
18+
"tpl8": "Histogram",
19+
"tpl9": "Boxplot"
920
}
1021
}

main.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ var i18n = new VueI18n({
77
}
88
});
99

10+
i18n.cn = fetch('lang/cn.json').then(res=>res.json()).then(data=>{
11+
i18n.setLocaleMessage('cn',Object.assign(data));
12+
});
13+
i18n.en = fetch('lang/en.json').then(res=>res.json()).then(data=>{
14+
i18n.setLocaleMessage('en',Object.assign(data));
15+
});
16+
1017
// 更新库列表
1118
var updatePkg = function(){
1219
var pkgstr = "";
@@ -1219,14 +1226,6 @@ const tp_premable = "\\begin{tikzpicture}\n\\tikzset{\n every pin/.style={fill=y
12191226
var app = new Vue({
12201227
el: '#app',
12211228
i18n,
1222-
created: function (){
1223-
i18n.cn = fetch('lang/cn.json').then(res=>res.json()).then(data=>{
1224-
i18n.setLocaleMessage('cn',Object.assign(data));
1225-
});
1226-
i18n.en = fetch('lang/en.json').then(res=>res.json()).then(data=>{
1227-
i18n.setLocaleMessage('en',Object.assign(data));
1228-
});
1229-
},
12301229
data:{
12311230
td: false,
12321231
enableLegend: false,

res/logo/cnflogo.svg

Lines changed: 2 additions & 0 deletions
Loading

res/logo/enflogo.svg

Lines changed: 11 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)