#511: Resolve "Page title not updated when changing the language"

This commit is contained in:
jovuit 2019-03-05 09:31:20 +01:00 committed by Eliot Berriot
parent 7eab11084c
commit bf4d987fb8
2 changed files with 11 additions and 21 deletions

View File

@ -0,0 +1 @@
i18n: Update page title when changing the App's language. (#511)

View File

@ -57,28 +57,17 @@ Vue.use(GetTextPlugin, {
Vue.use(VueMasonryPlugin)
Vue.use(VueLazyload)
Vue.config.productionTip = false
Vue.directive('title', {
inserted: (el, binding) => {
let parts = []
let instanceName = store.state.instance.settings.instance.name.value
if (instanceName.length === 0) {
instanceName = 'Funkwhale'
}
parts.unshift(instanceName)
parts.unshift(binding.value)
document.title = parts.join(' - ')
},
updated: (el, binding) => {
let parts = []
let instanceName = store.state.instance.settings.instance.name.value
if (instanceName.length === 0) {
instanceName = 'Funkwhale'
}
parts.unshift(instanceName)
parts.unshift(binding.value)
document.title = parts.join(' - ')
Vue.directive('title', function (el, binding) {
let parts = []
let instanceName = store.state.instance.settings.instance.name.value
if (instanceName.length === 0) {
instanceName = 'Funkwhale'
}
})
parts.unshift(instanceName)
parts.unshift(binding.value)
document.title = parts.join(' - ')
}
)
axios.interceptors.request.use(function (config) {
// Do something before request is sent
if (store.state.auth.token) {