Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/add-run-verbose-flag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"lingo.dev": minor
---
Add `--verbose` to print processed data, chunks, and changed keys.
10 changes: 10 additions & 0 deletions packages/cli/src/cli/cmd/run/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ function createWorkerTask(args: {
.fromPairs()
.value();

// Verbose: print the data to be processed
if (args.ctx.flags.verbose) {
console.log(JSON.stringify(processableData, null, 2));
}

if (!Object.keys(processableData).length) {
await args.ioLimiter(async () => {
// re-push in case some of the unlocalizable / meta data changed
Expand Down Expand Up @@ -262,6 +267,11 @@ function createWorkerTask(args: {
},
);

// Verbose: print the processed translation chunk
if (args.ctx.flags.verbose) {
console.log(JSON.stringify(processedTargetData, null, 2));
}

const finalTargetData = _.merge(
{},
sourceData,
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/cli/cmd/run/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export default new Command()
"--sound",
"Play audio feedback when translations complete (success or failure sounds)",
)
.option(
"--verbose",
"Print the translation data being processed as formatted JSON for each bucket and locale",
)
.action(async (args) => {
let authId: string | null = null;
try {
Expand Down
Loading