You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the expected behavior?
Default Translation is added.
Which versions of react and react-localize-redux are you using? react v16.3.2 react-localize-redux v3.1.1
Solution
I believe this problem is caused because the default translations are added:
on mount;
on update if props.id has changed.
In both cases the default translation is added subject to certain conditions checked in addDefaultTranslation(), namely that there is a defaultLanguage.
On initial mount (1), the defaultLanguage is undefined, which means the default translations are not added. When the defaultLanguage comes through on a subsequent rerender (2), addDefaultTranslation() is not called because props.id has not changed.
The text was updated successfully, but these errors were encountered:
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Default translations are not added. Instead the
"Missing translationId..."
text is displayed.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
https://codesandbox.io/s/v34q286o45
What is the expected behavior?
Default Translation is added.
Which versions of
react
andreact-localize-redux
are you using?react v16.3.2
react-localize-redux v3.1.1
Solution
I believe this problem is caused because the default translations are added:
props.id
has changed.In both cases the default translation is added subject to certain conditions checked in
addDefaultTranslation()
, namely that there is adefaultLanguage
.On initial mount (1), the
defaultLanguage
is undefined, which means the default translations are not added. When the defaultLanguage comes through on a subsequent rerender (2),addDefaultTranslation()
is not called becauseprops.id
has not changed.The text was updated successfully, but these errors were encountered: