2019-09-25 15:14:36 +08:00
|
|
|
export default {
|
|
|
|
|
methods: {
|
|
|
|
|
onChangeLocale (command) {
|
|
|
|
|
this.$i18n.locale = command
|
2026-05-28 15:47:19 +08:00
|
|
|
let message = this.$t('page.layout.locales.changed', { name: this.$t('_name'), locale: this.$i18n.locale })
|
2019-12-12 10:00:30 +08:00
|
|
|
if (process.env.VUE_APP_BUILD_MODE === 'PREVIEW') {
|
2019-09-25 15:14:36 +08:00
|
|
|
message = [
|
2026-05-28 15:47:19 +08:00
|
|
|
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')
|
2019-09-25 15:14:36 +08:00
|
|
|
].join('<br/>')
|
|
|
|
|
}
|
|
|
|
|
this.$notify({
|
2026-05-28 15:47:19 +08:00
|
|
|
title: this.$t('page.layout.locales.notification_title'),
|
2019-09-25 15:14:36 +08:00
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
|
|
message
|
|
|
|
|
})
|
2026-05-28 15:47:19 +08:00
|
|
|
this.$store.dispatch('d2admin/menu/menuReload')
|
2019-09-25 15:14:36 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|