diff options
author | Stefan Malzner <stefan@adlk.io> | 2017-12-07 00:08:45 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2017-12-07 00:08:45 +0100 |
commit | 9733eaf85115444718a1f6a32b971d29bd54d0ca (patch) | |
tree | 0450747dc6e12f28305a9962bc0b6054f255ba91 /src/stores | |
parent | fix(Service): Fix transparent service background (diff) | |
download | ferdium-app-9733eaf85115444718a1f6a32b971d29bd54d0ca.tar.gz ferdium-app-9733eaf85115444718a1f6a32b971d29bd54d0ca.tar.zst ferdium-app-9733eaf85115444718a1f6a32b971d29bd54d0ca.zip |
fix(i18n): Fallback to system language or english
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 17ec832cf..dcdb11a12 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -255,8 +255,10 @@ export default class AppStore extends Store { | |||
255 | _setLocale() { | 255 | _setLocale() { |
256 | const locale = this.stores.settings.all.locale; | 256 | const locale = this.stores.settings.all.locale; |
257 | 257 | ||
258 | if (locale && locale !== this.locale) { | 258 | if (locale && Object.prototype.hasOwnProperty.call(locales, locale) && locale !== this.locale) { |
259 | this.locale = locale; | 259 | this.locale = locale; |
260 | } else if (!locale) { | ||
261 | this.locale = this._getDefaultLocale(); | ||
260 | } | 262 | } |
261 | } | 263 | } |
262 | 264 | ||
@@ -281,6 +283,10 @@ export default class AppStore extends Store { | |||
281 | locale = defaultLocale; | 283 | locale = defaultLocale; |
282 | } | 284 | } |
283 | 285 | ||
286 | if (!locale) { | ||
287 | locale = DEFAULT_APP_SETTINGS.fallbackLocale; | ||
288 | } | ||
289 | |||
284 | return locale; | 290 | return locale; |
285 | } | 291 | } |
286 | 292 | ||