Browse Source

国际化

fix-1705
wangjr 4 years ago
parent
commit
90fb3e9daf
5 changed files with 24 additions and 22 deletions
  1. +0
    -13
      templates/custom/select_dataset.tmpl
  2. +3
    -3
      templates/explore/datasets.tmpl
  3. +3
    -3
      web_src/js/components/Contributors.vue
  4. +3
    -3
      web_src/js/components/Images.vue
  5. +15
    -0
      web_src/js/index.js

+ 0
- 13
templates/custom/select_dataset.tmpl View File

@@ -137,16 +137,3 @@

</div>

<script type="text/javascript">
import Vue from 'vue';
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import locale from 'element-ui/lib/locale'
var text_langName = document.getElementById("menutext_2").innerText
if (text_langName == '简体中文'){
locale.use(zhLocale)
}
else if (text_langName == 'English'){
locale.use(enLocale)
}
</script>

+ 3
- 3
templates/explore/datasets.tmpl View File

@@ -217,13 +217,13 @@
</div>
{{template "base/footer" .}}

<script type="text/javascript">
import Vue from 'vue';
<script type="mode">
import Vue from 'vue'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import locale from 'element-ui/lib/locale'

var text_langName = document.getElementById("menutext_2").innerText
let text_langName = document.getElementById("menutext_2").innerText
console.log("fjdhfdjhfjdhfdjhfdj:",text_langName)
if (text_langName == '简体中文'){
locale.use(zhLocale)


+ 3
- 3
web_src/js/components/Contributors.vue View File

@@ -101,8 +101,8 @@
let index = this.href_.indexOf("?")
this.url_infor = this.href_.substring(index+1,this.href_.length)
this.getContributorsList()
this.text_langName=''
this.getLang()
// this.text_langName=''
// this.getLang()
},

updated(){
@@ -111,7 +111,7 @@
}
},
mounted(){
this.getLang()
// this.getLang()
}
};
</script>


+ 3
- 3
web_src/js/components/Images.vue View File

@@ -9,7 +9,7 @@
</div>
<div class="ui container" id="header">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="$t('message.cloud_brain_mirror')公共镜像(云脑1)" name="first" v-loading="loading">
<el-tab-pane label="$t(message.cloud_brain_mirror) 云脑镜像" name="first" v-loading="loading">
<div class="ui sixteen wide column">
<div class="ui two column stackable grid">
<div class="column">
@@ -375,11 +375,11 @@ export default {
this.text_langName = document.getElementById("menutext_1").innerText
if (this.text_langName == '简体中文'){
this.$i18n.locale = 'zh'
locale.use(zhLocale)
// locale.use(zhLocale)
}
else if (this.text_langName == 'English'){
this.$i18n.locale = 'en'
locale.use(enLocale)
// locale.use(enLocale)
}
}



+ 15
- 0
web_src/js/index.js View File

@@ -77,6 +77,21 @@ Vue.use(Element, {
i18n: (key, value) => i18n.t(key, value)
})

function initGetlang(){
var text_langName = document.getElementById("langName").innerText
if (text_langName == '简体中文'){
i18n.locale = 'zh'
locale.use(zhLocale)
}
else if (text_langName == 'English'){
i18n.locale = 'en'
locale.use(enLocale)
}
}

initGetlang()


Object.defineProperty(Vue.prototype, '$echarts', {
value: echarts
})


Loading…
Cancel
Save