Extraction in 3.15 completely wipes all strings using the t macro
See original GitHub issueDescribe the bug
When running extraction all strings using the t
macro got wiped from my .po
files.
To Reproduce
$ npx create-react-app ling
$ cd ling
$ npm i @lingui/macro @lingui/react @lingui/cli
add to package.json
"lingui": {
"locales": [
"en",
"sl"
],
"sourceLocale": "en",
"format": "po",
"rootDir": "./src",
"catalogs": [
{
"path": "<rootDir>/locales/{locale}",
"include": [
"<rootDir>"
]
}
]
}
and to scripts: {
"i18n:extract": "lingui extract --overwrite --verbose"
}
add to App.js
import { Trans, t } from '@lingui/macro'
<Trans>Test string using Trans macro</Trans>
{t`Test string using t macro`}
Run
npm run i18n:extract
This is the result:
#: App.js:21
msgid "Test string using Trans macro"
msgstr ""
#: App.js:22
msgid "{0}"
msgstr ""
Expected behavior
#: App.js:21
msgid "Test string using Trans macro"
msgstr ""
#: App.js:22
msgid "Test string using t macro"
msgstr ""
Additional context
Somehow the t
string gets collapsed into the token {0}
. It completely collapsed hundredths of strings in my project in the same way and I had to revert to 3.14.0
- jsLingui version
3.15.0
- Babel version
@babel/core@7.20.2
- Your Babel config:
create-react-app
- vanilla
Issue Analytics
- State:
- Created 10 months ago
- Reactions:6
- Comments:5
Top Results From Across the Web
Issues · lingui/js-lingui - GitHub
extract translates passed file with includes import react-native-qrcode-svg ... Extraction in 3.15 completely wipes all strings using the t macro.
Read more >How to Easily Extract From Any String Without Using VBA InStr
We use the VBA InStr function to get the position of the first space. We want to get all the characters before the...
Read more >Re: st: macro string extraction - Stata
I want the local macro `first' to contain the string "h". ... however this function doesn't allow 1 1 (ones) as arguments (there...
Read more >Nixpkgs 22.11 manual - NixOS
Nix expressions describe how to build packages from source and are collected in the nixpkgs repository. Also included in the collection are Nix...
Read more >Reference - NeoMutt
-y, Start NeoMutt with a listing of all defined mailboxes. -Z, Open the first mailbox with new message or exit immediately with exit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I got the same issue after upgrading from
3.13.3
Same same! Pinning to 3.14.0.