lingui / lingui/js-lingui

"Translation" moved from start to end of json object in 2nd extract

Open Beginner friendly
#2,671 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

### Verifications

- [x] I've searched [existing issues](https://github.com/lingui/js-lingui/issues) and this hasn't been reported yet.
- [x] I've checked [the docs](https://lingui.dev) and this isn't expected behavior.
- [x] I'm using the latest version of Lingui, and the problem still occurs.

### Description

Image

Image

Since the first extract adds the translation to the front then it gets moved on merge there are PRs that show a json diff of this line being moved. Just add it to the end from the start

### Reproduction Link

_No response_

### Reproduction Steps

1. Create a new string
2. Run extract and merge PR
3. Pull latest and add different strings
4. Notice the json diffs will include the "translation" line being moved from the top to the bottom

### Expected Behavior

"Translation" line is added to the bottom on every extract run

### Macro Support

Babel with @lingui/babel-plugin-lingui-macro

### Lingui Version

6.4.0

### Babel / SWC Version

_No response_

### Node Version

_No response_

### Framework

_No response_

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

Reproduce the Lingui 6.4.0 extraction and merge flow described in the issue, starting with a new string and then adding more strings. Trace the extraction code that orders entries in the JSON output. Done means the "translation" line is appended at the end on every extract run, so subsequent pull requests no longer show it moving.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
internationalization, localization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.