lingui / lingui/js-lingui

`lingui extract-experimental` bugs

Open
#1,797 61 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

📦 extractor
Dominant language
TypeScript
Stars
5.9k
Forks
457
Avg merge
1d 23h
Merged PRs (30d)
16

Description

**Describe the bug**

- Extracted message id incorrect when `Trans` children has plain text follow JSX element, space is losted

![image](https://github.com/lingui/js-lingui/assets/18096089/6d2547fd-7dcc-4e51-9f20-24e7d852cb4a)

- Dependency tree related files (AboutText.tsx/Developers.tsx) do not extracted in reproduction, but Switcher.tsx did

**To Reproduce**

https://github.com/yunsii/lingui-examples-nextjs-swc-1797

**Expected behavior**

- Extract correct message id
- Extract full dependency tree related files

---

- jsLingui version `v4.5.0`
- Macro support:
- [x] I'm using SWC with `@lingui/swc-plugin`
- [ ] I'm using Babel with `babel-macro-plugin`
- [ ] I'm not using macro

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction and inspect the SWC extraction behavior for Trans children and dependency-tree traversal. Compare the extracted output for AboutText.tsx, Developers.tsx, and Switcher.tsx with the expected messages. Done means the message id preserves the space after a JSX element and all relevant dependency-tree files are extracted.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, react, typescript
Domain
internationalization, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.