Open Zerotask opened 1 year ago
The dependency intl-messageformat
parses tags, see this section of the docs.
You have to use a very strict format so it does not just throw SyntaxError: INVALID_TAG
, i.e. double quotes for attribute values:
'Or <a href="{url}">register here</a>'
This issue appears to still be present? I have this in my en.json file:
{
"topbar": {
"search": {
"status": {
"text": "Searching for '{query}'"
}
}
}
}
Yet using this Svelte syntax doesn't work:
<span>
{$_("topbar.search.status.text", { values: { query: $SearchQuery } })}
</span>
It returns: Searching for '{query}'
instead of e.g. Searching for 'foo bar'
Hopefully there's an easy fix because I'm not looking to have to spend hours switching to another lib
Would be nice to document the usage of variables in the doc I had to find this issue to find the syntax 😄 I can help updating it.
Describe the bug
Will produce:
Without the @html it's the same. If I place the {url} variable outside the html code, it will be replaced correctly.
Expected behavior
Information about your project:
svelte-i18n
version: 3.7.0Whether your project uses Webpack or Rollup: Vite (latest SvelteKit version)