locale persistance

ref #1
This commit is contained in:
Philipp Dormann 2021-03-18 18:29:59 +01:00
parent ff99657ab3
commit 0aea3c1e7c
1 changed files with 4 additions and 10 deletions

View File

@ -141,19 +141,15 @@ return $locale == l;
</p>
</div>
</div>
{$locale}
{JSON.stringify($locale)}
<div class="w-full p-3">
<div class="inline-block mr-2 mt-2">
<button
on:click={() => {
// lang.set("de-DE");
lang.set("de-DE");
locale.set("de-DE");
}}
type="button"
class:bg-black={$locale !== "de-DE"}
class:bg-blue-700={JSON.stringify($locale) == "de-DE"}
class="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"
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"
@ -174,13 +170,11 @@ return $locale == l;
<div class="inline-block mr-2 mt-2">
<button
on:click={() => {
// lang.set("en-US");
lang.set("en-US");
locale.set("en-US");
}}
type="button"
class:bg-black={$locale !== "en-US"}
class:bg-blue-700={$locale !== "en-US"}
class="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"
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"