Fix lang toggle
This is not perfect as the toggle is not set to the right position when the site is reload but as @Wal_ said he would refactor, I just made a working sample good enough imo
This commit is contained in:
		@ -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>
 | 
				
			||||||
 | 
				
			|||||||
@ -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 :/
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user