locize-cli 12.1.1 → 12.2.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/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
5
5
  Project versioning adheres to [Semantic Versioning](http://semver.org/).
6
6
  Change log format is based on [Keep a Changelog](http://keepachangelog.com/).
7
7
 
8
+ ## [12.2.0](https://github.com/locize/locize-cli/compare/v12.1.1...v12.2.0) - 2026-06-01
9
+
10
+ - sync: introduce `--auto-translate-languages <lng1,lng2>` option to restrict auto-translation to specific target languages
11
+
8
12
  ## [12.1.1](https://github.com/locize/locize-cli/compare/v12.1.0...v12.1.1) - 2026-04-21
9
13
 
10
14
  - sync: fix default for `--auto-translate` option
package/README.md CHANGED
@@ -178,6 +178,7 @@ locize sync --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672 --project-id my-pro
178
178
  - all non reference languages will always be just locally replaced by what is published on locize, unless the *--skip-delete true* argument is used
179
179
  - if you change the values of existing keys in the reference language, it will not change them in locize (to change the existing values you have to change it directly in locize or use the *--update-values true* argument)
180
180
  - if you update existing keys (with *--update-values true*) the automatic translation is not triggered, unless the *--auto-translate true* argument us used
181
+ - if you want to restrict the automatic translation to specific target languages only, you can use the *--auto-translate-languages de,fr* argument (together with *--auto-translate true*); if omitted, all languages are auto-translated
181
182
  - **if you want to take into account all languages instead of the reference language only while comparing the namespace content between local and remote, you can use the command argument *--reference-language-only false***
182
183
  - **if you want to take into account the modification time while comparing the namespace content between local and remote, you can use the command argument *--compare-modification-time true***
183
184
 
package/dist/cjs/cli.js CHANGED
@@ -50,7 +50,7 @@ const program = new commander.Command();
50
50
 
51
51
  program
52
52
  .description('The official locize CLI.')
53
- .version('12.1.1'); // This string is replaced with the actual version at build time by rollup
53
+ .version('12.2.0'); // This string is replaced with the actual version at build time by rollup
54
54
  // .option('-a, --api-endpoint <url>', `Specify the api-endpoint url that should be used (default: ${defaultApiEndpoint})`)
55
55
  // .option('-C, --config-path <configPath>', `Specify the path to the optional locize config file (default: ${configInWorkingDirectory} or ${configInHome})`);
56
56
 
@@ -419,6 +419,7 @@ program
419
419
  .option('-u, --update-values <true|false>', 'This will update values of existing translations. (default: false)', 'false')
420
420
  .option('--auto-translate <true|false>', 'This will trigger auto-translation of updated translations.')
421
421
  .option('--auto-translate-review <true|false>', 'When auto-translating, route results through the review workflow for languages that have review enabled. (default: false)', 'false')
422
+ .option('--auto-translate-languages <lng1,lng2>', 'Restrict auto-translation to these target languages only (comma separated). Only effective together with --auto-translate and when updating the reference language. If omitted, all languages are auto-translated.')
422
423
  .option('-S, --skip-delete <true|false>', 'This will skip the removal of keys on locize. (default: false)', 'false')
423
424
  .option('-D, --delete-remote-namespace <true|false>', 'This will delete a complete namespace on locize, if a local file in reference language was deleted. (default: false)', 'false')
424
425
  .option('-m, --path-mask <mask>', 'This will define the folder and file structure; do not add a file extension (default: {{language}}/{{namespace}})', `{{language}}${path.sep}{{namespace}}`)
@@ -476,6 +477,7 @@ program
476
477
  const updateValues = options.updateValues === 'true';
477
478
  const autoTranslate = options.autoTranslate === 'true' ? true : options.autoTranslate === 'false' ? false : undefined;
478
479
  const autoTranslateReview = options.autoTranslateReview === 'true';
480
+ const autoTranslateLanguages = options.autoTranslateLanguages;
479
481
  const skipDelete = options.skipDelete === 'true';
480
482
  const deleteRemoteNamespace = options.deleteRemoteNamespace === 'true';
481
483
  const languageFolderPrefix = options.languageFolderPrefix || '';
@@ -500,6 +502,7 @@ program
500
502
  updateValues,
501
503
  autoTranslate,
502
504
  autoTranslateReview,
505
+ autoTranslateLanguages: autoTranslateLanguages && autoTranslateLanguages.split(',').map((l) => l.trim()).filter(Boolean),
503
506
  skipDelete,
504
507
  deleteRemoteNamespace,
505
508
  languageFolderPrefix,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "locize-cli",
3
- "version": "12.1.1",
3
+ "version": "12.2.0",
4
4
  "type": "commonjs"
5
5
  }
@@ -39,7 +39,7 @@ async function request (url, options) {
39
39
  }
40
40
 
41
41
  options.headers = options.headers || {};
42
- options.headers['User-Agent'] = `locize-cli/v12.1.1 (node/${process.version}; ${process.platform} ${process.arch})`; // This string is replaced with the actual version at build time by rollup
42
+ options.headers['User-Agent'] = `locize-cli/v12.2.0 (node/${process.version}; ${process.platform} ${process.arch})`; // This string is replaced with the actual version at build time by rollup
43
43
  options.headers['X-User-Agent'] = options.headers['User-Agent'];
44
44
  if (options.body || options.method !== 'get') options.headers['Content-Type'] = 'application/json';
45
45
  if (options.body) {
package/dist/cjs/sync.js CHANGED
@@ -435,6 +435,9 @@ async function update (opt, lng, ns, shouldOmit = false) {
435
435
  if (opt.autoTranslateReview && lng === opt.referenceLanguage) {
436
436
  queryParams.append('autotranslatereview', 'true');
437
437
  }
438
+ if (opt.autoTranslateLanguages && opt.autoTranslateLanguages.length > 0 && lng === opt.referenceLanguage) {
439
+ queryParams.append('autotranslatelanguages', opt.autoTranslateLanguages.join(','));
440
+ }
438
441
  if (so) {
439
442
  queryParams.append('omitstatsgeneration', 'true');
440
443
  }
package/dist/esm/cli.js CHANGED
@@ -48,7 +48,7 @@ const program = new Command();
48
48
 
49
49
  program
50
50
  .description('The official locize CLI.')
51
- .version('12.1.1'); // This string is replaced with the actual version at build time by rollup
51
+ .version('12.2.0'); // This string is replaced with the actual version at build time by rollup
52
52
  // .option('-a, --api-endpoint <url>', `Specify the api-endpoint url that should be used (default: ${defaultApiEndpoint})`)
53
53
  // .option('-C, --config-path <configPath>', `Specify the path to the optional locize config file (default: ${configInWorkingDirectory} or ${configInHome})`);
54
54
 
@@ -417,6 +417,7 @@ program
417
417
  .option('-u, --update-values <true|false>', 'This will update values of existing translations. (default: false)', 'false')
418
418
  .option('--auto-translate <true|false>', 'This will trigger auto-translation of updated translations.')
419
419
  .option('--auto-translate-review <true|false>', 'When auto-translating, route results through the review workflow for languages that have review enabled. (default: false)', 'false')
420
+ .option('--auto-translate-languages <lng1,lng2>', 'Restrict auto-translation to these target languages only (comma separated). Only effective together with --auto-translate and when updating the reference language. If omitted, all languages are auto-translated.')
420
421
  .option('-S, --skip-delete <true|false>', 'This will skip the removal of keys on locize. (default: false)', 'false')
421
422
  .option('-D, --delete-remote-namespace <true|false>', 'This will delete a complete namespace on locize, if a local file in reference language was deleted. (default: false)', 'false')
422
423
  .option('-m, --path-mask <mask>', 'This will define the folder and file structure; do not add a file extension (default: {{language}}/{{namespace}})', `{{language}}${path.sep}{{namespace}}`)
@@ -474,6 +475,7 @@ program
474
475
  const updateValues = options.updateValues === 'true';
475
476
  const autoTranslate = options.autoTranslate === 'true' ? true : options.autoTranslate === 'false' ? false : undefined;
476
477
  const autoTranslateReview = options.autoTranslateReview === 'true';
478
+ const autoTranslateLanguages = options.autoTranslateLanguages;
477
479
  const skipDelete = options.skipDelete === 'true';
478
480
  const deleteRemoteNamespace = options.deleteRemoteNamespace === 'true';
479
481
  const languageFolderPrefix = options.languageFolderPrefix || '';
@@ -498,6 +500,7 @@ program
498
500
  updateValues,
499
501
  autoTranslate,
500
502
  autoTranslateReview,
503
+ autoTranslateLanguages: autoTranslateLanguages && autoTranslateLanguages.split(',').map((l) => l.trim()).filter(Boolean),
501
504
  skipDelete,
502
505
  deleteRemoteNamespace,
503
506
  languageFolderPrefix,
@@ -37,7 +37,7 @@ async function request (url, options) {
37
37
  }
38
38
 
39
39
  options.headers = options.headers || {};
40
- options.headers['User-Agent'] = `locize-cli/v12.1.1 (node/${process.version}; ${process.platform} ${process.arch})`; // This string is replaced with the actual version at build time by rollup
40
+ options.headers['User-Agent'] = `locize-cli/v12.2.0 (node/${process.version}; ${process.platform} ${process.arch})`; // This string is replaced with the actual version at build time by rollup
41
41
  options.headers['X-User-Agent'] = options.headers['User-Agent'];
42
42
  if (options.body || options.method !== 'get') options.headers['Content-Type'] = 'application/json';
43
43
  if (options.body) {
package/dist/esm/sync.js CHANGED
@@ -433,6 +433,9 @@ async function update (opt, lng, ns, shouldOmit = false) {
433
433
  if (opt.autoTranslateReview && lng === opt.referenceLanguage) {
434
434
  queryParams.append('autotranslatereview', 'true');
435
435
  }
436
+ if (opt.autoTranslateLanguages && opt.autoTranslateLanguages.length > 0 && lng === opt.referenceLanguage) {
437
+ queryParams.append('autotranslatelanguages', opt.autoTranslateLanguages.join(','));
438
+ }
436
439
  if (so) {
437
440
  queryParams.append('omitstatsgeneration', 'true');
438
441
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "locize-cli",
3
- "version": "12.1.1",
3
+ "version": "12.2.0",
4
4
  "description": "locize cli to import locales",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",