@yuneta/gobj-ui 7.10.1 → 7.10.3

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.
@@ -18539,8 +18539,8 @@ function build_delete_question(gobj, records) {
18539
18539
  String(impact.children)
18540
18540
  ], [
18541
18541
  "span",
18542
- { i18n: "children will be unlinked, not deleted" },
18543
- (0, i18next.t)("children will be unlinked, not deleted")
18542
+ {},
18543
+ (0, i18next.t)("children will be unlinked, not deleted", { count: impact.children })
18544
18544
  ]]
18545
18545
  ]);
18546
18546
  if (impact.parents > 0) lines.push([
@@ -18562,8 +18562,8 @@ function build_delete_question(gobj, records) {
18562
18562
  ],
18563
18563
  [
18564
18564
  "span",
18565
- { i18n: "parents" },
18566
- (0, i18next.t)("parents")
18565
+ {},
18566
+ (0, i18next.t)("parents", { count: impact.parents })
18567
18567
  ]
18568
18568
  ]
18569
18569
  ]);
@@ -56646,8 +56646,8 @@ function show_delete_confirm(gobj, nodeData) {
56646
56646
  let topic_name = nodeData.data.desc.topic_name;
56647
56647
  let impact = delete_impact(nodeData.data.desc, record);
56648
56648
  let question = (0, i18next.t)("delete") + " " + topic_name + ": " + record.id + "?";
56649
- if (impact.children > 0) question += "\n" + impact.children + " " + (0, i18next.t)("children will be unlinked, not deleted");
56650
- if (impact.parents > 0) question += "\n" + (0, i18next.t)("it will be detached from") + " " + impact.parents + " " + (0, i18next.t)("parents");
56649
+ if (impact.children > 0) question += "\n" + impact.children + " " + (0, i18next.t)("children will be unlinked, not deleted", { count: impact.children });
56650
+ if (impact.parents > 0) question += "\n" + (0, i18next.t)("it will be detached from") + " " + impact.parents + " " + (0, i18next.t)("parents", { count: impact.parents });
56651
56651
  show_confirm_popover(gobj, priv._node_delete_el, question, "delete", "#ff4d4f", () => execute_delete_node(gobj, nodeData), "_delete_confirm_el");
56652
56652
  }
56653
56653
  function hide_delete_confirm(gobj) {
@@ -18534,8 +18534,8 @@ function build_delete_question(gobj, records) {
18534
18534
  String(impact.children)
18535
18535
  ], [
18536
18536
  "span",
18537
- { i18n: "children will be unlinked, not deleted" },
18538
- t("children will be unlinked, not deleted")
18537
+ {},
18538
+ t("children will be unlinked, not deleted", { count: impact.children })
18539
18539
  ]]
18540
18540
  ]);
18541
18541
  if (impact.parents > 0) lines.push([
@@ -18557,8 +18557,8 @@ function build_delete_question(gobj, records) {
18557
18557
  ],
18558
18558
  [
18559
18559
  "span",
18560
- { i18n: "parents" },
18561
- t("parents")
18560
+ {},
18561
+ t("parents", { count: impact.parents })
18562
18562
  ]
18563
18563
  ]
18564
18564
  ]);
@@ -56633,8 +56633,8 @@ function show_delete_confirm(gobj, nodeData) {
56633
56633
  let topic_name = nodeData.data.desc.topic_name;
56634
56634
  let impact = delete_impact(nodeData.data.desc, record);
56635
56635
  let question = t("delete") + " " + topic_name + ": " + record.id + "?";
56636
- if (impact.children > 0) question += "\n" + impact.children + " " + t("children will be unlinked, not deleted");
56637
- if (impact.parents > 0) question += "\n" + t("it will be detached from") + " " + impact.parents + " " + t("parents");
56636
+ if (impact.children > 0) question += "\n" + impact.children + " " + t("children will be unlinked, not deleted", { count: impact.children });
56637
+ if (impact.parents > 0) question += "\n" + t("it will be detached from") + " " + impact.parents + " " + t("parents", { count: impact.parents });
56638
56638
  show_confirm_popover(gobj, priv._node_delete_el, question, "delete", "#ff4d4f", () => execute_delete_node(gobj, nodeData), "_delete_confirm_el");
56639
56639
  }
56640
56640
  function hide_delete_confirm(gobj) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.10.1",
3
+ "version": "7.10.3",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -5012,11 +5012,11 @@ function show_delete_confirm(gobj, nodeData)
5012
5012
  let question = t('delete') + ' ' + topic_name + ': ' + record.id + '?';
5013
5013
  if(impact.children > 0) {
5014
5014
  question += '\n' + impact.children + ' ' +
5015
- t('children will be unlinked, not deleted');
5015
+ t('children will be unlinked, not deleted', {count: impact.children});
5016
5016
  }
5017
5017
  if(impact.parents > 0) {
5018
5018
  question += '\n' + t('it will be detached from') + ' ' +
5019
- impact.parents + ' ' + t('parents');
5019
+ impact.parents + ' ' + t('parents', {count: impact.parents});
5020
5020
  }
5021
5021
 
5022
5022
  show_confirm_popover(gobj, priv._node_delete_el,
@@ -3070,15 +3070,25 @@ function build_delete_question(gobj, records)
3070
3070
  lines.push(["p", {class: "DELETE_ASK_CHILDREN has-text-weight-semibold",
3071
3071
  style: ROW}, [
3072
3072
  ["strong", {}, String(impact.children)],
3073
- ["span", {i18n: "children will be unlinked, not deleted"},
3074
- t("children will be unlinked, not deleted")]
3073
+ /* `count` picks the singular: i18next looks for the `_one`
3074
+ * variant and falls back to the base key for the plural, so the
3075
+ * validator still sees a key it can find.
3076
+ *
3077
+ * And NO `i18n` attribute on a counted word: refresh_language()
3078
+ * re-translates whatever carries one, calling t() WITHOUT the
3079
+ * count — which put the plural straight back over the singular.
3080
+ * A counted word cannot be re-translated from its key alone.
3081
+ * Nothing is lost: this is a MODAL, and a dialog with a backdrop
3082
+ * never sees a language change — the button is behind it. */
3083
+ ["span", {},
3084
+ t("children will be unlinked, not deleted", {count: impact.children})]
3075
3085
  ]]);
3076
3086
  }
3077
3087
  if(impact.parents > 0) {
3078
3088
  lines.push(["p", {class: "DELETE_ASK_PARENTS", style: ROW}, [
3079
3089
  ["span", {i18n: "it will be detached from"}, t("it will be detached from")],
3080
3090
  ["strong", {}, String(impact.parents)],
3081
- ["span", {i18n: "parents"}, t("parents")]
3091
+ ["span", {}, t("parents", {count: impact.parents})]
3082
3092
  ]]);
3083
3093
  }
3084
3094