Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using $localize in combination with state doesn't translate to selected language #7

Open
riencoertjens opened this issue Jun 8, 2023 · 1 comment

Comments

@riencoertjens
Copy link

riencoertjens commented Jun 8, 2023

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

@wmertens
Copy link
Contributor

Could it be that this is fixed with the recent changes? I can't reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants