Closed Demian101 closed 10 months ago
Hey @Demian101!
You raise a good point: the problem is that if a message (such as "A"
in your case) occurs multiple times on the same line, then we record this in the sources multiple times.
This can happen if you have a table in your Markdown:
| A | A | A |
|---|---|---|
will generate the same message "A"
three times, all on the same time. So you get a single msgid "A"
line, but the source is duplicated.
This is harmless, but silly... if you run the file through msgcat
, you will notice that the duplicate source lines are removes. But I would also like to see mdbook-xgettext
remove them already.
This is where we accumulate the source lines, so I think this could be the right place to do the de-duplication:
Alternatively (and probably more efficiently), we could handle this after all messages have been added just before this line:
We could then also move the textwrap::refill
call to that location.
In some cases she may not be harmless lol
So , i try to replace all msgid "" msgstr ""
to ""
Oh, thanks for pointing that out! You've run into #64...
Having duplicate messages (such as "A"
) should be fine. The problem of adding empty messages (""
) was fixed with #111.
I'm about to make a 0.3 release which has the fix above. Please open a new issue if you run into problem with this release.
GREAT work! can't wait for the next version ~ 🤣
It has been released now! Please cargo install mdbook-i18n-helpers
to get it! :smile:
when I run
there are so many duplicate rows, dont know why