qwik-i18n
qwik-i18n copied to clipboard
using $localize in combination with state doesn't translate to selected language
we're having an issue where using state in some way together with $localize
doesn't do the proper translation
for example
<div>{$localize`translate {state.key}`}</div>
or
<div>{state.key
? $localize`translate one thing`
: $localize`translate another thing`}</div>
doesn't translate to any other language than the default on initial render, when updating the sate (and the component with the key
it does do the translation)
if we "force" a component rerender by updating the key
it does do the translation.
here's a repo with a reproduction
expected $localize string is translated to language selected in the urlParam
actual result $localize string is only translated after updating the state