diff options
| author | Ekaterina Vaartis <vaartis@cock.li> | 2018-08-25 13:12:33 +0300 |
|---|---|---|
| committer | Ekaterina Vaartis <vaartis@cock.li> | 2018-08-25 13:29:49 +0300 |
| commit | c1e4bfa90ffa26e203ca61717b4fb99209ad0d99 (patch) | |
| tree | 39a63cb4156cd08bcf960cff51be2de09c1d6af8 /src/main.js | |
| parent | 30a6b7be5bf53611bb65cbabd18ad003989df8e3 (diff) | |
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
Diffstat (limited to 'src/main.js')
| -rw-r--r-- | src/main.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.js b/src/main.js index 87dc49df..37ef49f7 100644 --- a/src/main.js +++ b/src/main.js @@ -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 }) }) - |
