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

Check for duplicate sources in messages #156

Closed zachcmadsen closed 6 months ago

zachcmadsen commented 7 months ago

With rounded line numbers, it's possible for messages to have duplicate sources. This checks for duplicate sources before updating messages. An alternative approach is deduplicating sources after all the messages are added/updated. I went with the "on-the-fly" approach since it's simpler.

The check scans all of the sources for a message. If performance is a concern, we could try other ways to check for duplicates.

Fixes #154

google-cla[bot] commented 7 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

codecov-commenter commented 7 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (fba1b0a) 90.74% compared to head (ba57994) 90.80%.

Files Patch % Lines
i18n-helpers/src/xgettext.rs 94.73% 0 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #156 +/- ## ========================================== + Coverage 90.74% 90.80% +0.05% ========================================== Files 11 11 Lines 2399 2436 +37 Branches 2399 2436 +37 ========================================== + Hits 2177 2212 +35 Misses 159 159 - Partials 63 65 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kdarkhan commented 6 months ago

Thanks for contribution @zachcmadsen! Feel free to pick up the followup task https://github.com/google/mdbook-i18n-helpers/issues/171 if you want.