locize-cli 7.13.0 → 7.13.1
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 +4 -0
- package/README.md +1 -1
- package/migrate.js +22 -11
- package/package.json +1 -1
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
|
+
## [7.13.1](https://github.com/locize/locize-cli/compare/v7.13.0...v7.13.1) - 2022-12-08
|
|
9
|
+
|
|
10
|
+
- optimize migrate command
|
|
11
|
+
|
|
8
12
|
## [7.13.0](https://github.com/locize/locize-cli/compare/v7.12.12...v7.13.0) - 2022-12-08
|
|
9
13
|
|
|
10
14
|
- migrate command will use missing route if replace param is false or not passed and will also automaticaly create languages (make sure to use an api key with admin permissions)
|
package/README.md
CHANGED
|
@@ -223,7 +223,7 @@ locize delete-namespace common --api-key my-api-key-d9de-4f55-9855-a9ef0ed44672
|
|
|
223
223
|
|
|
224
224
|
## Migration of existing i18next files
|
|
225
225
|
We suggest to use the sync command instead of the migrate command.
|
|
226
|
-
The migrate command
|
|
226
|
+
The migrate command should be used only once and only works with json files.
|
|
227
227
|
|
|
228
228
|
### Step 1: Go near to your translation files
|
|
229
229
|
|
package/migrate.js
CHANGED
|
@@ -230,18 +230,29 @@ const migrate = (opt, cb) => {
|
|
|
230
230
|
require('os').cpus().length,
|
|
231
231
|
(l, done) => addLanguage(opt, l, done),
|
|
232
232
|
(err) => {
|
|
233
|
-
|
|
234
|
-
if (
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
process.exit(1);
|
|
238
|
-
}
|
|
239
|
-
if (cb) cb(err);
|
|
240
|
-
return;
|
|
233
|
+
if (err) {
|
|
234
|
+
if (!cb) {
|
|
235
|
+
console.error(colors.red(err.stack));
|
|
236
|
+
process.exit(1);
|
|
241
237
|
}
|
|
242
|
-
if (
|
|
243
|
-
|
|
244
|
-
}
|
|
238
|
+
if (cb) cb(err);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
setTimeout(() => {
|
|
242
|
+
// wait a bit to make sure project is up-to-date also in cache
|
|
243
|
+
upload(opt, nss, (err) => {
|
|
244
|
+
if (err) {
|
|
245
|
+
if (!cb) {
|
|
246
|
+
console.error(colors.red(err.stack));
|
|
247
|
+
process.exit(1);
|
|
248
|
+
}
|
|
249
|
+
if (cb) cb(err);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (!cb) console.log(colors.green('FINISHED'));
|
|
253
|
+
if (cb) cb(null);
|
|
254
|
+
});
|
|
255
|
+
}, 5000);
|
|
245
256
|
}
|
|
246
257
|
);
|
|
247
258
|
return;
|