未验证 提交 08cd0cb7 编写于 作者: W wuzewu 提交者: GitHub

fix some parts of components to support language selection (#511)

上级 6e213677
...@@ -500,7 +500,7 @@ export default { ...@@ -500,7 +500,7 @@ export default {
step: { step: {
xAxis: { xAxis: {
type: 'value', type: 'value',
name: this.horizontal, name: this.$t('lang.step'),
axisLabel: { axisLabel: {
fontSize: '11', fontSize: '11',
}, },
...@@ -511,7 +511,7 @@ export default { ...@@ -511,7 +511,7 @@ export default {
relative: { relative: {
xAxis: { xAxis: {
type: 'value', type: 'value',
name: this.horizontal, name: this.$t('lang.relative'),
axisLabel: { axisLabel: {
fontSize: '11', fontSize: '11',
}, },
...@@ -522,7 +522,7 @@ export default { ...@@ -522,7 +522,7 @@ export default {
wall: { wall: {
xAxis: { xAxis: {
type: 'time', type: 'time',
name: this.horizontal, name: this.$t('lang.wall'),
axisLabel: { axisLabel: {
fontSize: '11', fontSize: '11',
formatter: function(value, index) { formatter: function(value, index) {
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
<span class="visual-dl-audio-run-icon">{{ tagInfo.run }}</span> <span class="visual-dl-audio-run-icon">{{ tagInfo.run }}</span>
</h3> </h3>
<p> <p>
<span>Step:</span> <span>{{ $t('lang.step') }}:</span>
<span>{{ audioData.step }}</span> <span>{{ audioData.step }}</span>
<span class="visual-del-audio-time">{{ audioData.wallTime | formatTime }}</span> <span class="visual-del-audio-time">{{ audioData.wallTime | formatTime(this.$i18n.locale) }}</span>
</p> </p>
<v-slider <v-slider
:max="steps" :max="steps"
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
}, },
}, },
filters: { filters: {
formatTime: function(value) { formatTime: function(value, language) {
if (!value) { if (!value) {
return; return;
} }
...@@ -62,7 +62,8 @@ export default { ...@@ -62,7 +62,8 @@ export default {
weekday: 'short', year: 'numeric', month: 'short', weekday: 'short', year: 'numeric', month: 'short',
day: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit', day: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit',
}; };
return time.toLocaleDateString('en-US', options); let enc = language === 'zh' ? 'zh-CN' : 'en-US';
return time.toLocaleDateString(enc, options);
}, },
}, },
data() { data() {
...@@ -112,7 +113,7 @@ export default { ...@@ -112,7 +113,7 @@ export default {
tagInfo: function(val) { tagInfo: function(val) {
this.currentIndex = 0; this.currentIndex = 0;
this.getOriginAudioData(); this.getOriginAudioData();
} },
}, },
methods: { methods: {
stopInterval() { stopInterval() {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<span class="visual-dl-image-run-icon">{{ tagInfo.run }}</span> <span class="visual-dl-image-run-icon">{{ tagInfo.run }}</span>
</h3> </h3>
<p> <p>
<span>Step:</span> <span>{{ $t('lang.step') }}:</span>
<span>{{ imgData.step }}</span> <span>{{ imgData.step }}</span>
<span class="visual-del-image-time">{{ imgData.wallTime | formatTime }}</span> <span class="visual-del-image-time">{{ imgData.wallTime | formatTime }}</span>
</p> </p>
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
tagInfo: function(val) { tagInfo: function(val) {
this.currentIndex = 0; this.currentIndex = 0;
this.getOriginChartsData(); this.getOriginChartsData();
} },
}, },
methods: { methods: {
stopInterval() { stopInterval() {
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
<span class="visual-dl-text-run-icon">{{ tagInfo.run }}</span> <span class="visual-dl-text-run-icon">{{ tagInfo.run }}</span>
</h3> </h3>
<p> <p>
<span>Step:</span> <span>{{ $t('lang.step') }}:</span>
<span>{{ textData.step }}</span> <span>{{ textData.step }}</span>
<span class="visual-del-text-time">{{ textData.wallTime | formatTime }}</span> <span class="visual-del-text-time">{{ textData.wallTime | formatTime(this.$i18n.locale) }}</span>
</p> </p>
<v-slider <v-slider
:max="steps" :max="steps"
...@@ -49,7 +49,7 @@ export default { ...@@ -49,7 +49,7 @@ export default {
}, },
}, },
filters: { filters: {
formatTime: function(value) { formatTime: function(value, language) {
if (!value) { if (!value) {
return; return;
} }
...@@ -59,7 +59,8 @@ export default { ...@@ -59,7 +59,8 @@ export default {
weekday: 'short', year: 'numeric', month: 'short', weekday: 'short', year: 'numeric', month: 'short',
day: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit', day: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit',
}; };
return time.toLocaleDateString('en-US', options); let enc = language === 'zh' ? 'zh-CN' : 'en-US';
return time.toLocaleDateString(enc, options);
}, },
}, },
data() { data() {
...@@ -109,7 +110,7 @@ export default { ...@@ -109,7 +110,7 @@ export default {
tagInfo: function(val) { tagInfo: function(val) {
this.currentIndex = 0; this.currentIndex = 0;
this.getOriginChartsData(); this.getOriginChartsData();
} },
}, },
methods: { methods: {
stopInterval() { stopInterval() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册