Skip to content

Commit

Permalink
feat: default language to navigator.language top level language (#532)
Browse files Browse the repository at this point in the history
(if it's one of the supported languages)
  • Loading branch information
TobiTenno authored Jul 31, 2021
1 parent f8e3348 commit 3d4b787
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/panels/TimePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}"
>
<span style="text-transform: capitalize">{{
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
}}</span>
</span>
<TimeBadge class="pull-right" :starttime="time.activation || now" :endtime="time.expiry" :interval="1000" />
Expand Down
6 changes: 5 additions & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -55,7 +59,7 @@ const state = {
'Toroids-toggle-value': true,
'Special Caves-toggle-value': true,
},
locale: 'en',
locale,
bountyToggles: {},
rivens: {
pc: [],
Expand Down

1 comment on commit 3d4b787

@vercel
Copy link

@vercel vercel bot commented on 3d4b787 Jul 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.