Fix lang toggle #72

Merged
tonitch merged 1 commits from tonitch/front/fix/langSwitch into master 2024-03-08 22:22:20 +01:00
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
import 'https://kit.fontawesome.com/fb3bbd0a95.js' import 'https://kit.fontawesome.com/fb3bbd0a95.js'
import { toast } from 'vue3-toastify'; import { toast } from 'vue3-toastify';
import { ref } from 'vue' import { ref } from 'vue'
import i18n from './i18n.js' import i18n, { setLang } from './i18n.js'
import Inscription from "./Inscription.vue" import Inscription from "./Inscription.vue"
@ -50,7 +50,7 @@
</a></li> </a></li>
<li style="float:right; margin-top:7.5px;" title="Language"> <li style="float:right; margin-top:7.5px;" title="Language">
<input type="checkbox" v-model="toggle" true-value="FR" false-value="EN" class="theme-checkbox"> <input type="checkbox" @:click="setLang( toggle? 'fr' : 'en' )" v-model="toggle" class="theme-checkbox">
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -19,7 +19,7 @@ export function getCookie(key){
* @param key cookie name * @param key cookie name
*/ */
export function setCookie(key, value){ export function setCookie(key, value){
cookie = key + "=" + value + ";"; let cookie = key + "=" + value + "; SameSite=Lax";
document.cookie = cookie; document.cookie = cookie;
// Here we can apreciate the stupidity of Javascript :/ // Here we can apreciate the stupidity of Javascript :/
} }