Make interface language configurable from settings
The locale can now be configured in settings and is stored in Vuex. The changes are applied immidiately after selection. The list of languages is taken from the messages file, which contains all the available locales (and a new value, `interfaceLanguage`, to control the translation of this option in the options menu) Closes #36
This commit is contained in:
parent
30a6b7be5b
commit
c1e4bfa90f
9 changed files with 64 additions and 5 deletions
|
@ -60,6 +60,7 @@ const persistedStateOptions = {
|
|||
'config.loopVideoSilentOnly',
|
||||
'config.pauseOnUnfocused',
|
||||
'config.stopGifs',
|
||||
'config.interfaceLanguage',
|
||||
'users.lastLoginName',
|
||||
'statuses.notifications.maxSavedId'
|
||||
]
|
||||
|
@ -79,6 +80,7 @@ const store = new Vuex.Store({
|
|||
})
|
||||
|
||||
const i18n = new VueI18n({
|
||||
// By default, use the browser locale, we will update it if neccessary
|
||||
locale: currentLocale,
|
||||
fallbackLocale: 'en',
|
||||
messages
|
||||
|
@ -201,4 +203,3 @@ window.fetch('/nodeinfo/2.0.json')
|
|||
store.dispatch('setOption', { name: 'suggestionsEnabled', value: suggestions.enabled })
|
||||
store.dispatch('setOption', { name: 'suggestionsWeb', value: suggestions.web })
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue