Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PO translator comments must begin with # and space #2098

Open
mlocati opened this issue Nov 28, 2024 · 1 comment
Open

PO translator comments must begin with # and space #2098

mlocati opened this issue Nov 28, 2024 · 1 comment

Comments

@mlocati
Copy link

mlocati commented Nov 28, 2024

Describe the bug

The .po files downloaded from Transifex start with some translator comments, for example:

# 
# Translators:
# Translator 1, 2024
# Translator 2, 2024
# 
msgid ""
msgstr ""

Please remark that the first and the 5th lines contain a # comment followed by a space (# ) and not just a #
When lingui reads and updates such .po files, the trailing space is stripped out (that is, the lines # become #).

As per the gettext specs, translator comments always start with a # followed by a space:

There are two kinds of comments: those which have some white space immediately following the # - the translator comments -
[...]

So, lingui should keep those trailing spaces

To Reproduce

  1. generate a .po file with lingui extract
  2. add an empty translator comment (# followed by a space)
  3. run lingui extract again
  4. The line with the empty translator comment will become a # NOT followed by a space

Expected behavior

Lines # should still be # and not # when lingui regenerates them.

@timofei-iatsenko
Copy link
Collaborator

Thanks for the report. It seems it's an issue in the underlaying pofile library. Another good reason to drop it in favor of own implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants