You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some messages using the msg macro that are multiline, eg:
<SomeComponent
description={_(msg`Learn about the four key steps of building a top-tier corporate
sustainability program for tackling climate change: measuring
emissions, reducing them with initiatives, achieving net zero, and
reporting progress.`)}
/>
(note the indentation)
In Lingui 4, this gets extracted as:
#: components/home/KickoffCard.tsx:116
msgid ""
"Learn about the four key steps of building a top-tier corporate\n"
"sustainability program for tackling climate change: measuring\n"
"emissions, reducing them with initiatives, achieving net zero, and\n"
"reporting progress."
msgstr ""
"Learn about the four key steps of building a top-tier corporate\n"
"sustainability program for tackling climate change: measuring\n"
"emissions, reducing them with initiatives, achieving net zero, and\n"
"reporting progress."
With a generated ID of N0eok2
However, with Lingui 5 it gets extracted as:
#: components/home/KickoffCard.tsx:116
msgid ""
"Learn about the four key steps of building a top-tier corporate\n"
" sustainability program for tackling climate change: measuring\n"
" emissions, reducing them with initiatives, achieving net zero, and\n"
" reporting progress."
With a generated ID of omQrF1.
When we attempt to load the message at runtime (we're using the swc plugin) it's using the ID N0eok2 (matching the v4 extracted message). The dedentation is desirable, so I think the v4 behaviour is most correct?
The text was updated successfully, but these errors were encountered:
The v5 behavior is correct. All indentation / whitespaces are left as-is without any cleaning. V4 version of swc plugin has v4 behavior of whitespace cleaning, so you will have mismatch during runtime/extraction.
This change is ported to swc plugin, but it's not released yet. I asked @andrii-bodnar to make a pre-release of lingui swc plugin.
We have some messages using the
msg
macro that are multiline, eg:(note the indentation)
In Lingui 4, this gets extracted as:
With a generated ID of
N0eok2
However, with Lingui 5 it gets extracted as:
With a generated ID of
omQrF1
.When we attempt to load the message at runtime (we're using the swc plugin) it's using the ID
N0eok2
(matching the v4 extracted message). The dedentation is desirable, so I think the v4 behaviour is most correct?The text was updated successfully, but these errors were encountered: