mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #1334 from gradido/set-locale-on-page-reload
fix: Language Set Correctly after Page Reload in Admin Interface
This commit is contained in:
commit
3a1ff078de
@ -44,6 +44,9 @@ Vue.use(Toasted, {
|
||||
|
||||
addNavigationGuards(router, store, apolloProvider.defaultClient, i18n)
|
||||
|
||||
i18n.locale =
|
||||
store.state.moderator && store.state.moderator.language ? store.state.moderator.language : 'en'
|
||||
|
||||
new Vue({
|
||||
moment,
|
||||
router,
|
||||
|
||||
@ -15,7 +15,15 @@ jest.mock('vue-apollo')
|
||||
jest.mock('vuex')
|
||||
jest.mock('vue-i18n')
|
||||
jest.mock('vue-moment')
|
||||
jest.mock('./store/store')
|
||||
jest.mock('./store/store', () => {
|
||||
return {
|
||||
state: {
|
||||
moderator: {
|
||||
language: 'es',
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
jest.mock('./i18n')
|
||||
jest.mock('./router/router')
|
||||
|
||||
@ -101,4 +109,8 @@ describe('main', () => {
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('sets the locale from store', () => {
|
||||
expect(i18n.locale).toBe('es')
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user