-
-
Notifications
You must be signed in to change notification settings - Fork 237
Expand file tree
/
Copy pathLocaleSwitcher.vue
More file actions
41 lines (38 loc) · 849 Bytes
/
LocaleSwitcher.vue
File metadata and controls
41 lines (38 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<template>
<div class="localization-dropdown">
<a href="https://sdras.github.io/object-explorer/"><em>Object Explorer</em></a>
<br>
Language:
<select v-model="selectedLanguage" data-attr-cy="language">
<option v-for="(val, key) in languages" :value="key">{{val.long}}</option>
</select>
</div>
</template>
<script>
export default {
data() {
return {
selectedLanguage: this.$store.state.curLanguage,
languages: this.$store.state.languages
}
},
watch: {
selectedLanguage(newLang) {
console.log('new lang', newLang)
this.$store.commit('changeLanguage', newLang)
this.$store.commit('resetSelection')
}
}
}
</script>
<style scoped>
select {
margin-top: 8px;
}
.localization-dropdown {
position: absolute;
right: 8%;
top: 35px;
text-align: right;
}
</style>