-
I am using ts + svelte. How should I load resources. I want the users to be able to change the language of the app. For that I thought about using typescipts language templates, and then just loading my language resources (e.g. en.json). I noticed that using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Fixed it xD. |
Beta Was this translation helpful? Give feedback.
Fixed it xD.
let lang = "";
async function loadLanguage() {
const resourcePath = await resolveResource("lang/de.json")
lang = JSON.parse(await readTextFile(resourcePath));
console.log(lang);
};
loadLanguage();