Closed MarcGodard closed 3 years ago
I copied the API from svelte-i18n
. Values must be passed inside a values
key.
In your example it should be {$t("foot", { default: 'hello', values: { count: 1 } })}
. I personally don't like that too much, I find it a bit verbose, but since svelte-i18n is the most popular i18n library for svelte by a lot I thought it was wise to just use the exact same API to make transitioning to this library dead simple.
You can find the docs for svelte-i18n here about this topic in https://github.com/kaisermann/svelte-i18n/blob/main/docs/Formatting.md#format-_-or-t
Has this been tested with the latest kit version? Its not working for me and its the ONLY thing I added so far.
This: {$_("foot", { values: { count: 5 } })}
shows up as {count} is awesome!
(yes I simplified the example)
Yes, it does work. I just created a test app quickly to prove it: https://github.com/cibernox/quick-i18n-throwaway-demo
@cibernox Thanks, must be missing something.
@MarcGodard if you find what you missed let me know, it's probably a signal that I should improve the readme.
There was a svelte error that was causing all this. Once I fixed it, it fixed this.
Great to hear, closing this!
I tried:
The default works, but using the example, the count isn't working. What am I missing?