Skip to content

Commit 1a8786a

Browse files
authored
feat(cli): exclude previous translations from reference when --force flag is used (#1776)
Co-authored-by: AndreyHirsa <--global>
1 parent 8f57757 commit 1a8786a

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

.changeset/fair-cows-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": patch
3+
---
4+
5+
Exclude previous translations from LLM reference when --force flag is used. The localization engine now receives an empty object instead of existing translations, ensuring truly fresh translations are generated without influence from previous versions.

packages/cli/src/cli/cmd/i18n.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ export default new Command()
446446
sourceData,
447447
processableData,
448448
targetLocale,
449-
targetData,
449+
// When --force is used, exclude previous translations from reference to ensure fresh translations
450+
targetData: flags.force ? {} : targetData,
450451
},
451452
(progress, sourceChunk, processedChunk) => {
452453
bucketOra.text = `[${sourceLocale} -> ${targetLocale}] [${

packages/cli/src/cli/cmd/run/execute.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ function createWorkerTask(args: {
254254
sourceLocale: assignedTask.sourceLocale,
255255
targetLocale: assignedTask.targetLocale,
256256
sourceData,
257-
targetData,
257+
// When --force is used, exclude previous translations from reference to ensure fresh translations
258+
targetData: args.ctx.flags.force ? {} : targetData,
258259
processableData,
259260
hints: relevantHints,
260261
},

0 commit comments

Comments
 (0)