locize-cli
Advanced tools
Comparing version 8.3.1 to 8.4.0
@@ -8,2 +8,6 @@ # locize-cli change log | ||
## [8.4.0](https://github.com/locize/locize-cli/compare/v8.3.1...v8.4.0) - 2024-12-23 | ||
- feat: add --auto-translate option for sync command [101](https://github.com/locize/locize-cli/pull/101) | ||
## [8.3.1](https://github.com/locize/locize-cli/compare/v8.3.0...v8.3.1) - 2024-12-23 | ||
@@ -10,0 +14,0 @@ |
{ | ||
"name": "locize-cli", | ||
"version": "8.3.1", | ||
"version": "8.4.0", | ||
"description": "locize cli to import locales", | ||
@@ -18,7 +18,7 @@ "main": "index.js", | ||
"diff": "7.0.0", | ||
"dotenv": "16.4.5", | ||
"dotenv": "16.4.7", | ||
"flat": "5.0.2", | ||
"fluent_conv": "3.3.0", | ||
"gettext-converter": "1.3.0", | ||
"https-proxy-agent": "7.0.5", | ||
"https-proxy-agent": "7.0.6", | ||
"ini": "4.1.3", | ||
@@ -40,3 +40,3 @@ "js-yaml": "4.1.0", | ||
"gh-release": "7.0.2", | ||
"@yao-pkg/pkg": "6.1.1" | ||
"@yao-pkg/pkg": "6.2.0" | ||
}, | ||
@@ -43,0 +43,0 @@ "scripts": { |
@@ -149,2 +149,3 @@ [![npm](https://img.shields.io/npm/v/locize-cli.svg)](https://npmjs.org/package/locize-cli) | ||
- 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) | ||
- if you update existing keys (with *--update-values true*) the automatic translation is not triggered, unless the *--auto-translate true* argument us used | ||
- **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*** | ||
@@ -151,0 +152,0 @@ - **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*** |
16
sync.js
@@ -269,3 +269,15 @@ const fs = require('fs'); | ||
function send(d, so, clb, isRetrying) { | ||
request(opt.apiPath + '/update/' + opt.projectId + '/' + opt.version + '/' + lng + '/' + ns.namespace + (so ? '?omitstatsgeneration=true' : ''), { | ||
const queryParams = new URLSearchParams(); | ||
if (opt.autoTranslate) { | ||
/** @See https://docs.locize.com/integration/api#optional-autotranslate */ | ||
queryParams.append('autotranslate', 'true'); | ||
} | ||
if (so) { | ||
// no API docs for this | ||
queryParams.append('omitstatsgeneration', 'true'); | ||
} | ||
const queryString = queryParams.size > 0 ? '?' + queryParams.toString() : ''; | ||
request(opt.apiPath + '/update/' + opt.projectId + '/' + opt.version + '/' + lng + '/' + ns.namespace + queryString, { | ||
method: 'post', | ||
@@ -485,3 +497,3 @@ body: d, | ||
if (ns.diff.toUpdate.length > 0) { | ||
console.log(colors.yellow(`updating ${ns.diff.toUpdate.length} keys in ${ns.language}/${ns.namespace}...`)); | ||
console.log(colors.yellow(`updating ${ns.diff.toUpdate.length} keys in ${ns.language}/${ns.namespace}${opt.autoTranslate ? ' with automatic translation' : ''}...`)); | ||
if (opt.dry) console.log(colors.yellow(`would update ${ns.diff.toUpdate.join(', ')} in ${ns.language}/${ns.namespace}...`)); | ||
@@ -488,0 +500,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
187567
3186
346
+ Addeddotenv@16.4.7(transitive)
+ Addedhttps-proxy-agent@7.0.6(transitive)
- Removeddotenv@16.4.5(transitive)
- Removedhttps-proxy-agent@7.0.5(transitive)
Updateddotenv@16.4.7
Updatedhttps-proxy-agent@7.0.6