Import the $t()
function from Svelte-intl-precompile
import { t } from "svelte-intl-precompile";
Use it in javascript code:
let string = $t("key-of-translation");
Or in Svelte code
<p>
{$t("key-of-translation")}
</p>
Add config files in locales/...json
manually or better use the i18n Ally extension
In the config of i18n Ally add the svelte
framework and make sure it can find the locales
folder.