js-lingui icon indicating copy to clipboard operation
js-lingui copied to clipboard

Built PO file generates wrong comments

Open niksauer opened this issue 3 years ago • 3 comments

Describe the bug The output PO file has comments with a leading period:

#. Your free trial will end on August 6th and will not renew.
#: src/components/routes/billing/Status/Status.tsx:56
msgid "and will not renew."
msgstr ""

To Reproduce Steps to reproduce the behavior, possibly with minimal code sample, e.g:

import { t } from "@lingui/macro"

const renewLabel = t({
        message: ` and will not renew.`,
        comment: 'Your free trial will end on August 6th and will not renew.',
})

Expected behavior The output Po file should use standard comments:

# Your free trial will end on August 6th and will not renew.
#: src/components/routes/billing/Status/Status.tsx:56
msgid "and will not renew."
msgstr ""

Additional context Add any other context about the problem here.

  • jsLingui version 3.13.2
  • react-scripts version 4.0.3

niksauer avatar Apr 07 '22 12:04 niksauer

Hm, that's strange yep, will take a look

semoal avatar Apr 24 '22 15:04 semoal

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 24 '22 03:06 stale[bot]

im also running into this issue with next.js based applications (Still using babel)

ScriptedAlchemy avatar Jun 28 '22 23:06 ScriptedAlchemy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 08 '22 22:09 stale[bot]

Hello @niksauer 🙂 According to the documentation of PO format, a line starting with # is a translator comment which is created and maintained exclusively by the translator.

A line starting with #. is a comment given by the programmer, directed at the translator.

So our output conforms to the PO format specification.

However, the current behaviour is not consistent with our documentation. I have created a pull request #1337 that fixes the documentation 🙂

Martin005 avatar Jan 13 '23 15:01 Martin005