diff --git a/src/components/panels/TimePanel.vue b/src/components/panels/TimePanel.vue index 9e5bbe36..ac72bdc8 100644 --- a/src/components/panels/TimePanel.vue +++ b/src/components/panels/TimePanel.vue @@ -14,7 +14,7 @@ }" > {{ - time.state || time.active ? this.$t(`time.${(time.state || time.active).toLowerCase()}`) : display + time && (time.state || time.active) ? this.$t(`time.${(time.state || time.active).toLowerCase()}`) : display }} diff --git a/src/store.js b/src/store.js index 2703a142..d69bc851 100644 --- a/src/store.js +++ b/src/store.js @@ -8,9 +8,13 @@ import Notifier from '@/Notifier'; import components from '@/assets/json/components.json'; import trackables from '@/assets/json/trackables.json'; +import locales from '@/assets/json/locales.json'; import fissurePlanets from '@/assets/json/planets.json'; import initialWorldstate from '@/assets/json/initialWorldstate.json'; +const locale = Object.keys(locales).includes(navigator.language.substr(0, 2).toLowerCase()) + ? navigator.language.substr(0, 2).toLowerCase() + : 'en'; const apiBase = 'https://api.warframestat.us' || process.env.VUE_APP_API_BASE; let notifier; @@ -55,7 +59,7 @@ const state = { 'Toroids-toggle-value': true, 'Special Caves-toggle-value': true, }, - locale: 'en', + locale, bountyToggles: {}, rivens: { pc: [],