Files
mes-ui-d2/src/locales/mixin.js

22 lines
753 B
JavaScript
Raw Normal View History

export default {
methods: {
onChangeLocale (command) {
this.$i18n.locale = command
let message = this.$t('page.layout.locales.changed', { name: this.$t('_name'), locale: this.$i18n.locale })
if (process.env.VUE_APP_BUILD_MODE === 'PREVIEW') {
message = [
this.$t('page.layout.locales.changed', { name: this.$t('_name'), locale: this.$i18n.locale }),
this.$t('page.layout.locales.preview_warning'),
this.$t('page.layout.locales.preview_doc')
].join('<br/>')
}
this.$notify({
title: this.$t('page.layout.locales.notification_title'),
dangerouslyUseHTMLString: true,
message
})
this.$store.dispatch('d2admin/menu/menuReload')
}
}
}