aboutsummaryrefslogtreecommitdiff
path: root/src/modules/config.js
diff options
context:
space:
mode:
authorEkaterina Vaartis <vaartis@cock.li>2018-08-25 13:12:33 +0300
committerEkaterina Vaartis <vaartis@cock.li>2018-08-25 13:29:49 +0300
commitc1e4bfa90ffa26e203ca61717b4fb99209ad0d99 (patch)
tree39a63cb4156cd08bcf960cff51be2de09c1d6af8 /src/modules/config.js
parent30a6b7be5bf53611bb65cbabd18ad003989df8e3 (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/modules/config.js')
-rw-r--r--src/modules/config.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/config.js b/src/modules/config.js
index 45bb1465..ac163316 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -1,6 +1,8 @@
import { set, delete as del } from 'vue'
import StyleSetter from '../services/style_setter/style_setter.js'
+const browserLocale = (window.navigator.language || 'en').split('-')[0]
+
const defaultState = {
name: 'Pleroma FE',
colors: {},
@@ -17,7 +19,8 @@ const defaultState = {
stopGifs: false,
replyVisibility: 'all',
muteWords: [],
- highlight: {}
+ highlight: {},
+ interfaceLanguage: browserLocale
}
const config = {