Rewrite word wrapping for gettext entries

Open Azamat Hackimov requested to merge azamathackimov/lokalize:wordwrap into master

Old algorithm works not right as expected - if text have unintended newlines, lokalize wraps them as required, and result goes not identical as vanilla gettext.

This produce some noize when commiting PO catalogs into git.

  • Fix issue when whitespace appears as leading character in next string instead of trailing in previous.
  • New algorithm removes all newlines and then add them where they are really needed, after that goes standard word wrapping with nice max 78-wide lines.

See also and,

Merge request reports