woboq / tr

Translation tools for rust
58 stars 10 forks source link

POT generated inconsistent with xgettext #11

Closed zecakeh closed 2 years ago

zecakeh commented 2 years ago

I noticed two inconsistencies in the generated file compared to xgettext:

  1. The last line of plural forms is generated as
    msgstr ""

    but it should be two lines

    msgstr[0] ""
    msgstr[1] ""

    This results in an error when opening the file in Poedit.

  2. When there are several locations for the same message, xgettext creates a line for each of them while xtr puts them on the same line. Both work in Poedit.

Obviously the first one should be addressed if the file is considered invalid by other software.

ogoffart commented 2 years ago

Thanks for the bug report. I have fixed the first point.

For the second point, the current behevior of having them in the same line is consitant with what's documented in https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html , so i left it as is.

zecakeh commented 2 years ago

Thanks for working on that.