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.

Translations with variables stopped working on production after update

See original GitHub issue

I had a similar issue earlier, but now I have tried everything, with zero results 😕 After updating lingui-react to 1.1.1 and updating babel plugin to the latest version, some of my translation stopped working (in production -> dev = undefined). Only those, which have a variable or component inside and are untranslated, eg.

"Výsledky hledání pro <0>{searchedString}</0>": {
    "translation": "",
    "origin": [
      [
        "src\\components\\pages\\SearchResults.js",
        34
      ]
    ]
  }

SearchResults.js:

<Trans>
  Výsledky hledání pro <span className={cls.highlight}>{searchedString}</span>
</Trans>

It renders Výsledky hledání pro {searchedString}. I tried to extract & compile my catalog several times… only thing that works, is adding a translation, which is impossible for me to do for every such translation for every language at this point of this project 😞 . I hope it has a simple solution or I am doing something very wrong.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tricoder42commented, Sep 5, 2017

Coolio! I’m just working on the fix, should be ready in an hour. Thank you for your feedback 👍

0reactions
tricoder42commented, Sep 5, 2017

Also, new CLI options published in docs

Read more comments on GitHub >

github_iconTop Results From Across the Web

django fails to translate strings containing several variables
Edit2: It seems to be a bigger, repeating problem. Common attribute in these cases is that the string contains several variables. django ...
Read more >
Change variable name to preferred language using scripting
Solved: Hello Community, I'm stuck on one request catalog item/form in ServiceNow. The short story is, when for example employee from other ...
Read more >
The complexities of translation and the need for dynamic ...
Translation is a complex undertaking that usually requires you to take advantage of dynamic variables and other parameters in your source ...
Read more >
24 Working with dates and times - Stata
You specify the appropriate display format for the new variable so that, rather than displaying ... With that specification, date() could not only...
Read more >
Translation API overview - Drupal
For the most part, you cannot use variables inside t() calls, because the pattern matching used to extract translatable text will not know...
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