mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 22:29:17 +02:00
#511: Resolve "Page title not updated when changing the language"
This commit is contained in:
parent
7eab11084c
commit
bf4d987fb8
2 changed files with 11 additions and 21 deletions
1
changes/changelog.d/511.bugfix
Normal file
1
changes/changelog.d/511.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
i18n: Update page title when changing the App's language. (#511)
|
|
@ -57,18 +57,7 @@ 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 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 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) {
|
||||||
|
@ -78,7 +67,7 @@ Vue.directive('title', {
|
||||||
parts.unshift(binding.value)
|
parts.unshift(binding.value)
|
||||||
document.title = parts.join(' - ')
|
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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue