lingui / js-lingui

🌍 📖 A readable, automated, and optimized (3 kb) internationalization for JavaScript
https://lingui.dev
MIT License
4.44k stars 375 forks source link

multi-line comment not formatted correctly #1978

Closed taozhou-glean closed 2 weeks ago

taozhou-glean commented 1 month ago

Describe the bug

multi-line comment seems to be extracted missing #. on subsequent lines

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

 <Trans
    comment="this is a multi-line comment
    the second line"
  >
    Some text
  </Trans>

Expected behavior

#. this is a multi-line comment
#. the second line
#. js-lingui-id: Ot/Ga/
msgid "Some text"
msgstr "Some text"

actual result:

#. this is a multi-line comment
        the second line
#. js-lingui-id: Ot/Ga/
msgid "Some text"
msgstr "Some text"

Additional context lingui itself seems to be able to parse this just fine, but library like crowdin will treat this message catalog file as invalid

aseerkt commented 1 month ago

Reproducible - https://stackblitz.com/edit/vitejs-vite-jiwzn1?file=src%2Flocales%2Fen.po