Separate timeControl logic into utils/timeControl
[vchess.git] / client / src / components / Language.vue
1 <template lang="pug">
2 div
3 -
4 var langName = {
5 "en": "English",
6 "es": "Español",
7 "fr": "Français",
8 };
9 input#modalLang.modal(type="checkbox")
10 div(role="dialog")
11 #language.card
12 label.modal-close(for="modalLang")
13 form
14 fieldset
15 label(for="langSelect") {{ st.tr["Language"] }}
16 select#langSelect
17 each language,langCode in langName
18 option(value=langCode selected=(lang==langCode))
19 =language
20 </template>
21
22 <script>
23 import { store } from "@/store";
24 export default {
25 name: "my-language",
26 data: function() {
27 return {
28 st: store.state,
29 };
30 },
31 methods: {
32 setLanguage: function(e) {
33 localStorage["lang"] = e.target.value;
34 store.setLanguage(e.target.value);
35 },
36 },
37 };
38 </script>