mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Added some fixes and made language change not reload (#31)
* Added some fixes and made language change not reload * Remove unwanted code Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
7b2c84de8c
commit
032b03ec15
@ -279,6 +279,11 @@ export default {
|
||||
if (to.fullPath !== from.fullPath) {
|
||||
this.fetchData()
|
||||
}
|
||||
},
|
||||
'$i18n.locale' (to, from) {
|
||||
if (to !== from) {
|
||||
this.fetchData()
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeCreate () {
|
||||
@ -289,9 +294,6 @@ export default {
|
||||
this.breadList = []
|
||||
this.name = this.$route.name
|
||||
this.$route.matched.forEach((item) => {
|
||||
if (item.meta.title) {
|
||||
item.meta.title = this.$t(item.meta.title)
|
||||
}
|
||||
this.breadList.push(item)
|
||||
})
|
||||
},
|
||||
@ -319,8 +321,6 @@ export default {
|
||||
} else {
|
||||
this.dataView = false
|
||||
}
|
||||
console.log(this.$route)
|
||||
console.log(this.routeName)
|
||||
if (this.$route && this.$route.meta && this.$route.meta.permission) {
|
||||
this.apiName = this.$route.meta.permission[0]
|
||||
if (this.$route.meta.columns) {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div :style="!$route.meta.hiddenHeaderContent ? 'margin: -24px -24px 0px;' : null">
|
||||
<div class="page-menu-tabs">
|
||||
<a-tabs :tabBarStyle="{margin: 0}" @change="changeTab">
|
||||
<a-tab-pane v-for="child in $route.permission" :tab="child.meta.title" :key="child.key"></a-tab-pane>
|
||||
<a-tab-pane v-for="child in $route.permission" :tab="this.$t(child.meta.title)" :key="child.key"></a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
<div class="content">
|
||||
@ -71,7 +71,7 @@ export default {
|
||||
},
|
||||
getPageMeta () {
|
||||
// eslint-disable-next-line
|
||||
this.pageTitle = (typeof(this.title) === 'string' || !this.title) ? this.title : this.$route.meta.title
|
||||
this.pageTitle = (typeof(this.title) === 'string' || !this.title) ? this.$t(this.title) : this.$t(this.$route.meta.title)
|
||||
|
||||
const content = this.$refs.content
|
||||
if (content) {
|
||||
|
||||
@ -121,7 +121,7 @@ export default {
|
||||
<SubMenu {...{ key: menu.path }}>
|
||||
<span slot="title">
|
||||
{this.renderIcon(menu.meta.icon)}
|
||||
<span>{menu.meta.title}</span>
|
||||
<span>{this.$t(menu.meta.title)}</span>
|
||||
</span>
|
||||
{itemArr}
|
||||
</SubMenu>
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
<a-breadcrumb class="breadcrumb">
|
||||
<a-breadcrumb-item v-for="(item, index) in breadList" :key="index">
|
||||
<router-link v-if="item.name != name" :to="{ path: item.path }">
|
||||
{{ item.meta.title }}
|
||||
{{ this.$t(item.meta.title) }}
|
||||
</router-link>
|
||||
<span v-else>{{ item.meta.title }}</span>
|
||||
<span v-else>{{ this.$t(item.meta.title) }}</span>
|
||||
</a-breadcrumb-item>
|
||||
</a-breadcrumb>
|
||||
</template>
|
||||
|
||||
@ -59,7 +59,6 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
locale: null,
|
||||
enUS,
|
||||
arEG,
|
||||
caES,
|
||||
@ -81,16 +80,14 @@ export default {
|
||||
methods: {
|
||||
moment,
|
||||
onClick (e) {
|
||||
const localeValue = e.key
|
||||
this.locale = localeValue
|
||||
var localeValue = e.key
|
||||
if (!localeValue) {
|
||||
moment.locale('en')
|
||||
} else {
|
||||
moment.locale(localeValue)
|
||||
this.$i18n.locale = e.key
|
||||
Vue.ls.set('current_locale', e.key)
|
||||
this.$router.go(0)
|
||||
localeValue = 'en'
|
||||
}
|
||||
this.$locale = localeValue
|
||||
moment.locale(localeValue)
|
||||
this.$i18n.locale = localeValue
|
||||
Vue.ls.set('current_locale', localeValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user