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.

Partial extractions have some unexpected results

See original GitHub issue

Describe the bug

Running lingui extract on certain files (using either husky or running manually) is giving some unexpected results.

  1. it looks like obsolete translations aren’t being marked as obsolete (#~msgid "")
  2. unrelated file path comments are being removed in other unrelated translations

Regarding the second point, I haven’t seen this happening in our example repo used below, but it might just be the fact that there are very few strings involved. In our real project, we have lots of entries which are grouped together by msgid and have file location comments above.

~I’ll try to make a reproducible example of this when I can.~ EDIT: There is now a reproducible example in comments.

To Reproduce From our example project: We changed a text from {t`Version ${version}`} to {t`App version ${version}`}.

Running lingui extract src/login/view/Login.tsx resulted in this: https://github.com/kerlends/lingui-extract-bug/commit/4cec61a2b3698fb13819ca935dbc1f2646c36c05

Running lingui extract resulted in this: https://github.com/kerlends/lingui-extract-bug/commit/ffb6413d5eb2fd15836e1856ac95b4ddccb6c071

Try yourself:

git clone https://github.com/kerlends/lingui-extract-bug.git
git checkout text-changed-without-extracting

lingui extract src/login/view/Login.tsx
git diff

git checkout -- .
lingui extract
git diff

Expected behavior Partial extraction should mark the previous message obsolete if not used elsewhere. Partial extraction should not remove comments from unrelated translations

  • jsLingui version 3.12.1
  • Babel version @babel/core@7.15.5
  • Create React App 4.0.3

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
semoalcommented, Feb 2, 2022

We have a bot that marks issues as wontfix after no activity, but indeed this is a bug and shoudn’t be closed. I’ll try to get some time for Lingui asap.

0reactions
stale[bot]commented, Apr 3, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Injuries That Can Result in an Emergency Tooth Extraction
Common reasons for tooth extraction. You may do your best to care for your teeth, but some unexpected circumstances warrant emergency tooth extraction....
Read more >
Troubleshooting Common Issues with Restriction Digestion ...
The most common issues when performing digestion reactions are caused by unexpected cleavage patterns. In this article, we have highlighted the most ...
Read more >
After Extraction of Wisdom Teeth - Oral Surgeon Cave Creek
With any medical procedure, there can be unexpected results. These can include delayed healing, infection and post-operative numbness or tingling in your lip, ......
Read more >
Wisdom Teeth Removal | Wisdom Tooth Extractions
With any medical procedure, there can be unexpected results. These can include delayed healing, infection and post-operative numbness or tingling in your lip, ......
Read more >
Wisdom tooth extraction | Robbinsville New Jersey | ROMS
The upper wisdom teeth are situated close to your maxillary sinuses, and their removal can result in a communication between your mouth and...
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