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

Support rounding line numbers #127

Closed mgeisler closed 7 months ago

mgeisler commented 9 months ago

When updating the translation files for Comprehensive Rust, we have a lot of small diffs like this:

-#: src/SUMMARY.md:19 src/SUMMARY.md:79 src/SUMMARY.md:134 src/SUMMARY.md:192
-#: src/SUMMARY.md:218 src/SUMMARY.md:268
+#: src/SUMMARY.md:19 src/SUMMARY.md:80 src/SUMMARY.md:135 src/SUMMARY.md:193
+#: src/SUMMARY.md:231 src/SUMMARY.md:281
 msgid "Welcome"
 msgstr "Velkommen"

We could avoid some of this churn if we would round the line numbers. I'm thinking rounding them to nearest multiple of 5 or 10 will help a lot. Jumping to a rounded line number would still bring you close to the actual position.

One could also remove the line numbers completely. The whole source location can be removed by sending the files through msgcat --no-location.

What do people think of this?

mgeisler commented 7 months ago

From a few comments in google/comprehensive-rust#282, it seems like this might be useful. I would suggest rounding the line numbers to 10, 20, ... to start with.