@localess/cli 0.0.1-dev.20260217111809 → 0.0.1-dev.20260218083711
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/dist/index.js +19 -4
- package/dist/index.mjs +19 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -230,11 +230,19 @@ function localessClient(options) {
|
|
|
230
230
|
return {};
|
|
231
231
|
}
|
|
232
232
|
},
|
|
233
|
-
async getTranslations(locale) {
|
|
233
|
+
async getTranslations(locale, params) {
|
|
234
234
|
if (options.debug) {
|
|
235
235
|
console.log(LOG_GROUP, "getTranslations() locale : ", locale);
|
|
236
|
+
console.log(LOG_GROUP, "getTranslations() params : ", JSON.stringify(params));
|
|
236
237
|
}
|
|
237
|
-
let
|
|
238
|
+
let version = "";
|
|
239
|
+
if (options?.version && options.version == "draft") {
|
|
240
|
+
version = `&version=${options.version}`;
|
|
241
|
+
}
|
|
242
|
+
if (params?.version && params.version == "draft") {
|
|
243
|
+
version = `&version=${params.version}`;
|
|
244
|
+
}
|
|
245
|
+
let url = `${options.origin}/api/v1/spaces/${options.spaceId}/translations/${locale}?token=${options.token}${version}`;
|
|
238
246
|
if (options.debug) {
|
|
239
247
|
console.log(LOG_GROUP, "getTranslations fetch url : ", url);
|
|
240
248
|
}
|
|
@@ -553,8 +561,15 @@ var translationsPushCommand = new import_commander4.Command("push").argument("<l
|
|
|
553
561
|
}
|
|
554
562
|
console.log("Pushing translations to Localess with locale:", locale, "and type:", options.type);
|
|
555
563
|
const message = await client.updateTranslations(locale, options.type, translationValues);
|
|
556
|
-
|
|
557
|
-
|
|
564
|
+
if (message) {
|
|
565
|
+
console.log("Successfully pushed translations to Localess");
|
|
566
|
+
console.log("Summary:", message.message);
|
|
567
|
+
if (message.ids) {
|
|
568
|
+
console.log("Updated translation IDs:", message.ids);
|
|
569
|
+
}
|
|
570
|
+
} else {
|
|
571
|
+
console.log("Something went wrong while pushing translations to Localess");
|
|
572
|
+
}
|
|
558
573
|
});
|
|
559
574
|
|
|
560
575
|
// src/commands/translations/index.ts
|
package/dist/index.mjs
CHANGED
|
@@ -207,11 +207,19 @@ function localessClient(options) {
|
|
|
207
207
|
return {};
|
|
208
208
|
}
|
|
209
209
|
},
|
|
210
|
-
async getTranslations(locale) {
|
|
210
|
+
async getTranslations(locale, params) {
|
|
211
211
|
if (options.debug) {
|
|
212
212
|
console.log(LOG_GROUP, "getTranslations() locale : ", locale);
|
|
213
|
+
console.log(LOG_GROUP, "getTranslations() params : ", JSON.stringify(params));
|
|
213
214
|
}
|
|
214
|
-
let
|
|
215
|
+
let version = "";
|
|
216
|
+
if (options?.version && options.version == "draft") {
|
|
217
|
+
version = `&version=${options.version}`;
|
|
218
|
+
}
|
|
219
|
+
if (params?.version && params.version == "draft") {
|
|
220
|
+
version = `&version=${params.version}`;
|
|
221
|
+
}
|
|
222
|
+
let url = `${options.origin}/api/v1/spaces/${options.spaceId}/translations/${locale}?token=${options.token}${version}`;
|
|
215
223
|
if (options.debug) {
|
|
216
224
|
console.log(LOG_GROUP, "getTranslations fetch url : ", url);
|
|
217
225
|
}
|
|
@@ -530,8 +538,15 @@ var translationsPushCommand = new Command4("push").argument("<locale>", "Locale
|
|
|
530
538
|
}
|
|
531
539
|
console.log("Pushing translations to Localess with locale:", locale, "and type:", options.type);
|
|
532
540
|
const message = await client.updateTranslations(locale, options.type, translationValues);
|
|
533
|
-
|
|
534
|
-
|
|
541
|
+
if (message) {
|
|
542
|
+
console.log("Successfully pushed translations to Localess");
|
|
543
|
+
console.log("Summary:", message.message);
|
|
544
|
+
if (message.ids) {
|
|
545
|
+
console.log("Updated translation IDs:", message.ids);
|
|
546
|
+
}
|
|
547
|
+
} else {
|
|
548
|
+
console.log("Something went wrong while pushing translations to Localess");
|
|
549
|
+
}
|
|
535
550
|
});
|
|
536
551
|
|
|
537
552
|
// src/commands/translations/index.ts
|