izimobil / polib

Pure python library to manipulate, create, modify gettext files (pot, po and mo files).
MIT License
102 stars 29 forks source link

Fix relative ordering of comments and translator comments #126

Closed samhocevar closed 2 years ago

samhocevar commented 2 years ago

The PO file format documentation indicates that "# " comments should appear before "#." comments (https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html). Also the gettext source code calls message_print_comment() before message_print_comment_dot() when writing a PO file.

samhocevar commented 2 years ago

This PR includes a new unit test and also fixes existing tests to comply with this behaviour.

codecov-commenter commented 2 years ago

Codecov Report

Merging #126 (066fc3c) into master (bc4732a) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #126   +/-   ##
=======================================
  Coverage   95.53%   95.53%           
=======================================
  Files           1        1           
  Lines         852      852           
=======================================
  Hits          814      814           
  Misses         38       38           
Impacted Files Coverage Δ
polib.py 95.53% <100.00%> (ø)

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

izimobil commented 2 years ago

Nice catch, thanks @samhocevar. For some reason, the Travis build fails with python 3.7, I'll have a look before merging !