Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Modify which part of the object will be shown in Svelte

$
0
0

I am new to svelte and want to write a simple multilanguage script.

my data:

export const content={"intro": "De Intro","introEn": "En Intro",}

in my template i am using:

<p>{t("content.intro")}</p>

and in the function i want to append "En" to load the english text

export const t = (i) => {   return(i+"En");};

the result is that the browser prints

content.introEn

how can I show the data from the object?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>