0.1.2 • Published 2 years ago

locales-dnit v0.1.2

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

+page.server.js

import {Util} from "../lib/util"
import {lang} from "./lang";

let langs;
lang.subscribe((value) => langs = value)
export const load = async ({fetch, params}) => {
const myUtil = new Util();
const content = myUtil.fetchFileContents()
return {params, content}
}

svelte page

<script>
    import {onMount} from "svelte";
    import {lang} from "./lang";
    import {Util} from "../lib/util";
    export let data;
    let content;
    onMount(()=>{
        const util = new Util();
        $lang = navigator.language || navigator.userLanguage;
        content = util.selectpageContent("home", $lang.substring(0, 2), data.content);
    })
</script>

lang.js

import {writable} from "svelte/store"; export const lang = writable('en');

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago