Skip to content
Snippets Groups Projects
Commit c9e7eea6 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch '511-i18n-title' into 'develop'

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

Closes #511

See merge request funkwhale/funkwhale!641
parents 7eab1108 bf4d987f
No related branches found
No related tags found
No related merge requests found
i18n: Update page title when changing the App's language. (#511)
...@@ -57,28 +57,17 @@ Vue.use(GetTextPlugin, { ...@@ -57,28 +57,17 @@ Vue.use(GetTextPlugin, {
Vue.use(VueMasonryPlugin) Vue.use(VueMasonryPlugin)
Vue.use(VueLazyload) Vue.use(VueLazyload)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.directive('title', { Vue.directive('title', function (el, binding) {
inserted: (el, binding) => { let parts = []
let parts = [] let instanceName = store.state.instance.settings.instance.name.value
let instanceName = store.state.instance.settings.instance.name.value if (instanceName.length === 0) {
if (instanceName.length === 0) { instanceName = 'Funkwhale'
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(' - ')
} }
}) parts.unshift(instanceName)
parts.unshift(binding.value)
document.title = parts.join(' - ')
}
)
axios.interceptors.request.use(function (config) { axios.interceptors.request.use(function (config) {
// Do something before request is sent // Do something before request is sent
if (store.state.auth.token) { if (store.state.auth.token) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment