@localess/cli 0.0.1-dev.20260222174414 → 0.0.1-dev.20260224115109
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 +9 -6
- package/dist/index.mjs +9 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -591,7 +591,7 @@ var zTranslationUpdateSchema = import_zod.z.object({
|
|
|
591
591
|
});
|
|
592
592
|
|
|
593
593
|
// src/commands/translations/push/index.ts
|
|
594
|
-
var translationsPushCommand = new import_commander5.Command("push").argument("<locale>", "Locale to push").description("Push locale translations to Localess").requiredOption("-p, --path <path>", "Path to the translations file to push").option("-f, --format <format>", `File format. Possible values are : ${Object.values(TranslationFileFormat)}`, "flat" /* FLAT */).option("-t, --type <type>", `Push type. Possible values are : ${Object.values(TranslationUpdateType)}`, "add-missing" /* ADD_MISSING */).option("
|
|
594
|
+
var translationsPushCommand = new import_commander5.Command("push").argument("<locale>", "Locale to push").description("Push locale translations to Localess").requiredOption("-p, --path <path>", "Path to the translations file to push").option("-f, --format <format>", `File format. Possible values are : ${Object.values(TranslationFileFormat)}`, "flat" /* FLAT */).option("-t, --type <type>", `Push type. Possible values are : ${Object.values(TranslationUpdateType)}`, "add-missing" /* ADD_MISSING */).option("--dry-run", "Preview changes without applying them to Localess").action(async (locale, options) => {
|
|
595
595
|
console.log("Pushing translations with arguments:", locale);
|
|
596
596
|
console.log("Pushing translations with options:", options);
|
|
597
597
|
if (!zTranslationUpdateTypeSchema.safeParse(options.type).success) {
|
|
@@ -624,12 +624,15 @@ var translationsPushCommand = new import_commander5.Command("push").argument("<l
|
|
|
624
624
|
return;
|
|
625
625
|
}
|
|
626
626
|
console.log("Pushing translations to Localess with locale:", locale, "and type:", options.type);
|
|
627
|
-
const
|
|
628
|
-
if (
|
|
627
|
+
const response = await client.updateTranslations(locale, options.type, translationValues, options.dryRun);
|
|
628
|
+
if (response) {
|
|
629
|
+
if (response.dryRun) {
|
|
630
|
+
console.log("Dry run results:");
|
|
631
|
+
}
|
|
629
632
|
console.log("Successfully pushed translations to Localess");
|
|
630
|
-
console.log("Summary:",
|
|
631
|
-
if (
|
|
632
|
-
console.log("Updated translation IDs:",
|
|
633
|
+
console.log("Summary:", response.message);
|
|
634
|
+
if (response.ids) {
|
|
635
|
+
console.log("Updated translation IDs:", response.ids);
|
|
633
636
|
}
|
|
634
637
|
} else {
|
|
635
638
|
console.log("Something went wrong while pushing translations to Localess");
|
package/dist/index.mjs
CHANGED
|
@@ -568,7 +568,7 @@ var zTranslationUpdateSchema = z.object({
|
|
|
568
568
|
});
|
|
569
569
|
|
|
570
570
|
// src/commands/translations/push/index.ts
|
|
571
|
-
var translationsPushCommand = new Command5("push").argument("<locale>", "Locale to push").description("Push locale translations to Localess").requiredOption("-p, --path <path>", "Path to the translations file to push").option("-f, --format <format>", `File format. Possible values are : ${Object.values(TranslationFileFormat)}`, "flat" /* FLAT */).option("-t, --type <type>", `Push type. Possible values are : ${Object.values(TranslationUpdateType)}`, "add-missing" /* ADD_MISSING */).option("
|
|
571
|
+
var translationsPushCommand = new Command5("push").argument("<locale>", "Locale to push").description("Push locale translations to Localess").requiredOption("-p, --path <path>", "Path to the translations file to push").option("-f, --format <format>", `File format. Possible values are : ${Object.values(TranslationFileFormat)}`, "flat" /* FLAT */).option("-t, --type <type>", `Push type. Possible values are : ${Object.values(TranslationUpdateType)}`, "add-missing" /* ADD_MISSING */).option("--dry-run", "Preview changes without applying them to Localess").action(async (locale, options) => {
|
|
572
572
|
console.log("Pushing translations with arguments:", locale);
|
|
573
573
|
console.log("Pushing translations with options:", options);
|
|
574
574
|
if (!zTranslationUpdateTypeSchema.safeParse(options.type).success) {
|
|
@@ -601,12 +601,15 @@ var translationsPushCommand = new Command5("push").argument("<locale>", "Locale
|
|
|
601
601
|
return;
|
|
602
602
|
}
|
|
603
603
|
console.log("Pushing translations to Localess with locale:", locale, "and type:", options.type);
|
|
604
|
-
const
|
|
605
|
-
if (
|
|
604
|
+
const response = await client.updateTranslations(locale, options.type, translationValues, options.dryRun);
|
|
605
|
+
if (response) {
|
|
606
|
+
if (response.dryRun) {
|
|
607
|
+
console.log("Dry run results:");
|
|
608
|
+
}
|
|
606
609
|
console.log("Successfully pushed translations to Localess");
|
|
607
|
-
console.log("Summary:",
|
|
608
|
-
if (
|
|
609
|
-
console.log("Updated translation IDs:",
|
|
610
|
+
console.log("Summary:", response.message);
|
|
611
|
+
if (response.ids) {
|
|
612
|
+
console.log("Updated translation IDs:", response.ids);
|
|
610
613
|
}
|
|
611
614
|
} else {
|
|
612
615
|
console.log("Something went wrong while pushing translations to Localess");
|