google/comprehensive-rust

Do not text wrap links

HuyNVuong opened this issue · 3 comments

See attached image below:

image

I have not checked .md files yet, but *.po files' links are getting text wrapped. While they won't affect the actual renders, it makes editing less readable and text editor also having a hard time rendering links

Hi @HuyNVuong, thanks for writing!

What you see above is just the formatting in the .po file. The actual (logical) string stored above starts with

The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-expr.html#predicate-loops) works

That is, the wrapping in the .po files are not part of the string data. The wrapping seems to follow C macro conventions: strings separated by whitespace are concatenated, so "foo" "bar" is the same as "foobar".

Ideally you should use a PO editor to work with the entries. That will take care of escaping things like " correctly for you.

You can of course also just edit the .po file directly — and then run dprint fmt afterwards to reformat it. That should normalize the line breaks to a consistent style.

Please let me know if that doesn't work for you?

Right yeah that's all works for me, that's why I was highlighting that it only affects text editor, which is a minor inconvenience, but nothing is really breaking.

I see that it is using C macro convention, if there's no existing .po files Marcos can easily be configured I suppose we can live with this for now

Great, I think we're on the same page then. Long-term, we'll likely use a translation platform (#1305), and this will hide the formattin of the PO files.