CLI/Watch - Extract with [files] marks other strings as obsolete in messages file
See original GitHub issueDescribe the bug
I am in the middle of writing a little script to automate extraction of strings using chockidar
as watcher.
Unfortunately I have came across 2 errors.
- CLI - Whenever I pass a
[files]
string into the cmd it is not recognized and command is extracting from all source path provided in config file of lingui. But for my case it is not really important, just pointing this out. Ex. commandlingui extract src/pages/SignIn/SignIn.tsx --verbose
. - Main problem - after hitting the default function of
@lingui/cli/lingui-extract
with alinguiConfig
andlinguiOptions
prepared based on the source code I have managed to get the “cli” to extract from the file I pin-pointed, BUT after the extraction all other previously extracted strings from other files are marked as obsolete.
To Reproduce Just run this code via npm. It is just a base code to run the extraction from script.
const { getConfig, LinguiConfig } = require('@lingui/conf');
const linguiExtract = require('../node_modules/@lingui/cli/lingui-extract').default;
const linguiConfig = getConfig({
configPath: process.env.LINGUI_CONFIG,
});
const linguiOptions = {
verbose: true,
clean: false,
overwrite: true,
files: ['src/pages/SignIn/SignIn.tsx'],
};
function prepareLinguiExtract(config, options) {
linguiExtract(config, options);
}
prepareLinguiExtract(linguiConfig, linguiOptions);
Expected behavior I expect it to just extract string from the file I am pointing to, not to modify the whole messages file.
Additional context
- jsLingui version 3.4.0
- Babel version 7.12.3
- CRA ejected, React 17.0.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Zip file containing more than one file is sent as string. How to ...
When the entire zip file content is represented as string, getNextEntry() only gives the first file name correctly. After that, it gives another...
Read more >Linux unzip command help and examples - Computer Hope
unzip lists, tests, or extracts files from archives of the zip ... file code type 180 ('C') when extracting Zip entries marked as...
Read more >unzip -- list, test and extract compressed files in a ZIP archive
unzip will list, test, or extract files from a ZIP archive, ... The sequence number is applied whenever another file with the original...
Read more >jest-get-type | Yarn - Package Manager
Generate a basic configuration file; Using Babel; Using webpack; Using Vite; Using Parcel; Using Typescript. Documentation; Badge; Contributing.
Read more >Extract/Unzip Files - UiPath Documentation Portal
UiPath.System.Activities.Compression.Workflow.ExtractFiles Description Extracts all the contents of a zip file archive to a specified folder.
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
Sure, I can work on this. I already have a working code I can implement it natively, but I will sit to it by the end of the week.
Released your funcitonality with 3.6.0. Thanks for the contribution!