question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Usage with SSR returns "Missing translationId: *ID* for language: ${ languageCode }"

See original GitHub issue

Do 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:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ryandrewjohnsoncommented, Sep 12, 2018

Fixed in #127 and included in version v3.4.0.

1reaction
ramymacommented, Sep 8, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keep getting the error MissingTranslationId - Stack Overflow
I want to use the allLanguages format. ... I'm getting the error: Missing TranslationId: header.home for language: ${ languagecode }.
Read more >
getting-started – React Localize Redux Documentation
The translation id must be unique across all your translations, and the value is ... Return translation for default language in place of...
Read more >
Localized Server-Side Rendering with React | Phrase
The speed and SEO benefits of server-side rendering can outweigh its complexity. Learn here how to localize a React app made with SSR....
Read more >
Internationalization (i18n) - Angular - w3resource
A locale is an identifier (id) that refers to a set of user preferences that tend to be shared within a region of...
Read more >
All side optimized Next.js translations - DEV Community ‍ ‍
The code is written once and depending on your needs it is then executed as SSG (static-site generation), SSR (server-side rendering) or CSR ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found