Usage with SSR returns "Missing translationId: *ID* for language: ${ languageCode }"
See original GitHub issueDo you want to request a feature or report a bug? Report a bug
What is the current behavior?
When rendering with ReactDOMServer.renderToString
, the translations are not ready at the time of page render and therefore yields the uninitialized message of the translation.
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: Here’s an example: https://codesandbox.io/s/2z9vqwwxlp
What is the expected behavior? The localization should be initialized before render time to get the translated message rendered correctly by the server.
Which versions of react
and react-localize-redux
are you using?
v3.3.2
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Fixed in #127 and included in version
v3.4.0
.I have a theory, if we can pass the initialize object to the LocalizeProvider and then use the passed values as the defaults when setting up the context, we’d be able to get the context initialize right from the start. I’ve been doing some digging in the code but I don’t know where would that fit exactly… I’d like to help, can you give me any pointer ?
BTW I’ve created a minimalistic example here to test SSR with the library