google / mdbook-i18n-helpers

Translation support for mdbook. The plugins here give you a structured way to maintain a translated book.
Apache License 2.0
126 stars 25 forks source link

Deduplicate repeated sources #154

Closed mgeisler closed 6 months ago

mgeisler commented 7 months ago

With #145 merged, we can now end up in a situation where a message has the same source repeated multiple times:

#: src/SUMMARY.md:10 src/SUMMARY.md:10 src/SUMMARY.md:70 src/SUMMARY.md:90
msgid "Welcome"
msgstr "Te damos la bienvenida"

We should add logic to remove the duplicates in this case. The situation becomes even worse when the line numbers are removed completely (when granularity is set to 0).

zachcmadsen commented 7 months ago

Hey @mgeisler, I'm interested in taking this. Based on #145, it looks like we'd need to handle duplicates whenever we call add_message in create_catalog. Am I on the right track?

mgeisler commented 6 months ago

Hi @zachcmadsen, thanks for taking this on! I think you're definitely on the right track!

mgeisler commented 6 months ago

I just created #171, which is related to this (but can be fixed independently).