added lang option to config page

ref #1
This commit is contained in:
Philipp Dormann 2021-03-15 15:22:44 +01:00
parent 4e8a203c6d
commit 7cde92e206

View File

@ -48,13 +48,19 @@
<div class="w-full p-3">
<div class="inline-block mr-2 mt-2">
<button type="button"
<button on:click={()=>{
lang.set("de-DE")
}} type="button"
class:bg-blue-700={$lang==="de-DE"}
class="bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md hover:bg-blue-700">Deutsch
<svg class="h-4 inline" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M15.923 345.043C52.094 442.527 145.929 512 256 512s203.906-69.473 240.077-166.957L256 322.783l-240.077 22.26z" fill="#ffda44"/><path d="M256 0C145.929 0 52.094 69.472 15.923 166.957L256 189.217l240.077-22.261C459.906 69.472 366.071 0 256 0z"/><path d="M15.923 166.957C5.633 194.69 0 224.686 0 256s5.633 61.31 15.923 89.043h480.155C506.368 317.31 512 287.314 512 256s-5.632-61.31-15.923-89.043H15.923z" fill="#d80027"/></svg></button>
</div>
<div class="inline-block mr-2 mt-2">
<button type="button"
class="bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md hover:bg-blue-700 bg-blue-700">English
<button on:click={()=>{
lang.set("en-EN")
}} type="button"
class:bg-blue-700={$lang==="en-EN"}
class="bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black text-white text-sm py-2.5 px-5 rounded-md hover:bg-blue-700">English
<svg class="h-4 inline" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<circle cx="256" cy="256" r="256" fill="#f0f0f0"></circle>
<g fill="#d80027">
@ -77,7 +83,7 @@
</div>
</div>
<script>
import {apikey} from './store.js';
import {apikey,lang} from './store.js';
let token;
$: isTokenValid=token?.length===44&& token.split(".")[0].length===7 &&isUUID(token.split(".")[1]);
function isUUID ( uuid ) {