lingo.dev 0.122.1 → 0.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/cli.cjs CHANGED
@@ -775,9 +775,10 @@ var _prompts = require('@inquirer/prompts');
775
775
 
776
776
  // src/cli/utils/find-locale-paths.ts
777
777
 
778
- var _glob2 = require('glob');
778
+ var _glob2 = require('glob'); var pkg = _interopRequireWildcard(_glob2); var pkg2 = _interopRequireWildcard(_glob2);
779
779
 
780
780
 
781
+ var { glob } = pkg;
781
782
  function findLocaleFiles(bucket) {
782
783
  switch (bucket) {
783
784
  case "json":
@@ -805,7 +806,7 @@ function findLocaleFiles(bucket) {
805
806
  }
806
807
  }
807
808
  function findLocaleFilesWithExtension(ext2) {
808
- const files = _glob2.glob.sync(`**/*${ext2}`, {
809
+ const files = glob.sync(`**/*${ext2}`, {
809
810
  ignore: ["node_modules/**", "package*.json", "i18n.json", "lingo.json"]
810
811
  });
811
812
  const localeFilePattern = new RegExp(`/([a-z]{2}(-[A-Z]{2})?)${ext2}$`);
@@ -849,7 +850,7 @@ function findLocaleFilesWithExtension(ext2) {
849
850
  }
850
851
  function findLocaleFilesForFilename(fileName) {
851
852
  const pattern = fileName;
852
- const localeFiles = _glob2.glob.sync(`**/${fileName}`, {
853
+ const localeFiles = glob.sync(`**/${fileName}`, {
853
854
  ignore: ["node_modules/**", "package*.json", "i18n.json", "lingo.json"]
854
855
  });
855
856
  const localeFilesAndPatterns = localeFiles.map((file) => ({
@@ -1420,6 +1421,7 @@ var locale_default = new (0, _interactivecommander.Command)().command("locale").
1420
1421
 
1421
1422
 
1422
1423
 
1424
+ var { glob: glob2 } = pkg2;
1423
1425
  function getBuckets(i18nConfig) {
1424
1426
  const result = Object.entries(i18nConfig.buckets).map(
1425
1427
  ([bucketType, bucketEntry]) => {
@@ -1513,7 +1515,7 @@ function expandPlaceholderedGlob(_pathPattern, sourceLocale) {
1513
1515
  );
1514
1516
  const sourcePathPattern = pathPattern.replaceAll(/\[locale\]/g, sourceLocale);
1515
1517
  const unixStylePattern = sourcePathPattern.replace(/\\/g, "/");
1516
- const sourcePaths = _glob2.glob.sync(unixStylePattern, {
1518
+ const sourcePaths = glob2.sync(unixStylePattern, {
1517
1519
  follow: true,
1518
1520
  withFileTypes: true,
1519
1521
  windowsPathsNoEscape: true
@@ -11625,7 +11627,8 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11625
11627
  sourceData,
11626
11628
  processableData,
11627
11629
  targetLocale,
11628
- targetData
11630
+ // When --force is used, exclude previous translations from reference to ensure fresh translations
11631
+ targetData: flags.force ? {} : targetData
11629
11632
  },
11630
11633
  (progress, sourceChunk, processedChunk) => {
11631
11634
  bucketOra.text = `[${sourceLocale} -> ${targetLocale}] [${Object.keys(processableData).length} entries] (${progress}%) AI localization in progress...`;
@@ -13267,7 +13270,8 @@ function createWorkerTask(args) {
13267
13270
  sourceLocale: assignedTask.sourceLocale,
13268
13271
  targetLocale: assignedTask.targetLocale,
13269
13272
  sourceData,
13270
- targetData,
13273
+ // When --force is used, exclude previous translations from reference to ensure fresh translations
13274
+ targetData: args.ctx.flags.force ? {} : targetData,
13271
13275
  processableData,
13272
13276
  hints: relevantHints
13273
13277
  },
@@ -15191,7 +15195,7 @@ async function renderHero2() {
15191
15195
  // package.json
15192
15196
  var package_default = {
15193
15197
  name: "lingo.dev",
15194
- version: "0.122.1",
15198
+ version: "0.123.0",
15195
15199
  description: "Lingo.dev CLI",
15196
15200
  private: false,
15197
15201
  repository: {
@@ -15299,7 +15303,7 @@ var package_default = {
15299
15303
  }
15300
15304
  },
15301
15305
  bin: {
15302
- "lingo.dev": "./bin/cli.mjs"
15306
+ lingo: "./bin/cli.mjs"
15303
15307
  },
15304
15308
  files: [
15305
15309
  "bin",