From c1e4bfa90ffa26e203ca61717b4fb99209ad0d99 Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Sat, 25 Aug 2018 13:12:33 +0300 Subject: 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 --- src/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.js') 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 }) }) - -- cgit v1.2.3-70-g09d2