Skip to content

Deduplicate source references when merging extracted messages - #441

Open
rigzad wants to merge 2 commits into
elixir-gettext:mainfrom
rigzad:main
Open

Deduplicate source references when merging extracted messages#441
rigzad wants to merge 2 commits into
elixir-gettext:mainfrom
rigzad:main

Conversation

@rigzad

@rigzad rigzad commented Jul 29, 2026

Copy link
Copy Markdown

Two extraction calls that resolve to the same msgid at the same file:line each contribute a reference group, and merge_messages_after_checks/2 concatenates them without uniquing. Macro-generated code produces N calls attributed to a single line, so the same #: comment is written N times.

extracted_comments on the very next line is already uniqued; this makes references consistent with it.

@maennchen

Copy link
Copy Markdown
Member

@rigzad Thanks for the PR ❤️
Can you run mix format please?

Two extraction calls that resolve to the same msgid at the same file:line
each contribute a reference group, and merge_messages_after_checks/2
concatenates them without uniquing. Macro-generated code produces N calls
attributed to a single line, so the same  comment is written N times.

 on the very next line is already uniqued; this makes
 consistent with it.
@rigzad

rigzad commented Jul 29, 2026

Copy link
Copy Markdown
Author

@maennchen done. My bad !

Comment thread test/gettext/extractor_test.exs
Co-authored-by: Jonatan Männchen <jonatan@maennchen.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants