@yuneta/gobj-ui 7.23.128 → 7.23.130

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.
@@ -2983,7 +2983,8 @@ function show_notification(shell, kind, message, opts) {
2983
2983
  },
2984
2984
  [["button", {
2985
2985
  class: "TOAST_CLOSE delete",
2986
- "aria-label": "close"
2986
+ "aria-label": (0, i18next.t)("close"),
2987
+ "data-i18n-aria-label": "close"
2987
2988
  }], [
2988
2989
  "p",
2989
2990
  {
@@ -3063,7 +3064,8 @@ function yui_shell_show_modal(shell, content, opts) {
3063
3064
  {
3064
3065
  class: "MODAL_BACK yui-dialog-back",
3065
3066
  type: "button",
3066
- "aria-label": "back"
3067
+ "aria-label": (0, i18next.t)("back"),
3068
+ "data-i18n-aria-label": "back"
3067
3069
  },
3068
3070
  [["i", { class: "yi-arrow-left" }]]
3069
3071
  ],
@@ -3088,7 +3090,8 @@ function yui_shell_show_modal(shell, content, opts) {
3088
3090
  {
3089
3091
  class: "MODAL_CLOSE yui-dialog-x",
3090
3092
  type: "button",
3091
- "aria-label": "close"
3093
+ "aria-label": (0, i18next.t)("close"),
3094
+ "data-i18n-aria-label": "close"
3092
3095
  },
3093
3096
  [["i", { class: "yi-xmark" }]]
3094
3097
  ]
@@ -3108,7 +3111,8 @@ function yui_shell_show_modal(shell, content, opts) {
3108
3111
  ]];
3109
3112
  if (with_close) modal_children.push(["button", {
3110
3113
  class: "MODAL_CLOSE modal-close is-large",
3111
- "aria-label": "close"
3114
+ "aria-label": (0, i18next.t)("close"),
3115
+ "data-i18n-aria-label": "close"
3112
3116
  }]);
3113
3117
  }
3114
3118
  let logical = opts && opts.logical_class || "";
@@ -3261,7 +3265,8 @@ function build_dialog(shell, message, buttons, opts) {
3261
3265
  ]);
3262
3266
  $card_children.push(["button", {
3263
3267
  class: "CONFIRM_CLOSE delete yui-confirm-x",
3264
- "aria-label": "close"
3268
+ "aria-label": (0, i18next.t)("close"),
3269
+ "data-i18n-aria-label": "close"
3265
3270
  }], [
3266
3271
  "section",
3267
3272
  { class: "CONFIRM_BODY modal-card-body has-text-centered" },
@@ -3761,7 +3766,8 @@ function build_ui$17(gobj) {
3761
3766
  {
3762
3767
  class: "WINDOW_MIN yui-wc wc-min",
3763
3768
  type: "button",
3764
- "aria-label": "minimize",
3769
+ "aria-label": (0, i18next.t)("minimize"),
3770
+ "data-i18n-aria-label": "minimize",
3765
3771
  style: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "showMin") && (0, _yuneta_gobj_js.gobj_read_pointer_attr)(gobj, "manager") ? "" : "display:none;"
3766
3772
  },
3767
3773
  WC_MIN,
@@ -3775,7 +3781,8 @@ function build_ui$17(gobj) {
3775
3781
  {
3776
3782
  class: "WINDOW_MAX yui-wc wc-max",
3777
3783
  type: "button",
3778
- "aria-label": "maximize",
3784
+ "aria-label": (0, i18next.t)("maximize"),
3785
+ "data-i18n-aria-label": "maximize",
3779
3786
  style: (0, _yuneta_gobj_js.gobj_read_bool_attr)(gobj, "showMax") ? "" : "display:none;"
3780
3787
  },
3781
3788
  WC_MAX,
@@ -3789,7 +3796,8 @@ function build_ui$17(gobj) {
3789
3796
  {
3790
3797
  class: "WINDOW_CLOSE yui-wc wc-close",
3791
3798
  type: "button",
3792
- "aria-label": "close"
3799
+ "aria-label": (0, i18next.t)("close"),
3800
+ "data-i18n-aria-label": "close"
3793
3801
  },
3794
3802
  WC_CLOSE,
3795
3803
  { click: (evt) => {
@@ -4671,7 +4679,8 @@ function ac_register_window(gobj, event, kw, src) {
4671
4679
  {
4672
4680
  class: "yui-dock-close",
4673
4681
  type: "button",
4674
- "aria-label": "close"
4682
+ "aria-label": (0, i18next.t)("close"),
4683
+ "data-i18n-aria-label": "close"
4675
4684
  },
4676
4685
  WC_X,
4677
4686
  { click: (evt) => {
@@ -4934,7 +4943,8 @@ function build_ui$16(gobj) {
4934
4943
  "button",
4935
4944
  {
4936
4945
  class: "yui-pager-back button is-white is-hidden",
4937
- "aria-label": "back"
4946
+ "aria-label": (0, i18next.t)("back"),
4947
+ "data-i18n-aria-label": "back"
4938
4948
  },
4939
4949
  [[
4940
4950
  "span",
@@ -4958,7 +4968,8 @@ function build_ui$16(gobj) {
4958
4968
  "button",
4959
4969
  {
4960
4970
  class: "yui-pager-discard button is-white is-hidden",
4961
- "aria-label": "discard"
4971
+ "aria-label": (0, i18next.t)("discard"),
4972
+ "data-i18n-aria-label": "discard"
4962
4973
  },
4963
4974
  [[
4964
4975
  "span",
@@ -5498,7 +5509,8 @@ function build_ui$15(gobj) {
5498
5509
  "button",
5499
5510
  {
5500
5511
  class: "yui-wizard-back button",
5501
- "aria-label": "back"
5512
+ "aria-label": (0, i18next.t)("back"),
5513
+ "data-i18n-aria-label": "back"
5502
5514
  },
5503
5515
  [[
5504
5516
  "span",
@@ -5520,7 +5532,8 @@ function build_ui$15(gobj) {
5520
5532
  "button",
5521
5533
  {
5522
5534
  class: "yui-wizard-primary button is-link",
5523
- "aria-label": "next"
5535
+ "aria-label": (0, i18next.t)("next"),
5536
+ "data-i18n-aria-label": "next"
5524
5537
  },
5525
5538
  [[
5526
5539
  "span",
@@ -6256,7 +6269,8 @@ function yui_file_control(gobj, { name, value, readonly, accept, on_pick }) {
6256
6269
  type: "button",
6257
6270
  class: "FILE_PICK button is-small",
6258
6271
  "data-i18n-title": "choose a file",
6259
- "aria-label": "choose a file"
6272
+ "aria-label": (0, i18next.t)("choose a file"),
6273
+ "data-i18n-aria-label": "choose a file"
6260
6274
  },
6261
6275
  [["span", { class: "FILE_PICK_ICON yi-upload" }], [
6262
6276
  "span",
@@ -6273,7 +6287,8 @@ function yui_file_control(gobj, { name, value, readonly, accept, on_pick }) {
6273
6287
  type: "button",
6274
6288
  class: "FILE_CLEAR button is-small",
6275
6289
  "data-i18n-title": "remove the file",
6276
- "aria-label": "remove the file"
6290
+ "aria-label": (0, i18next.t)("remove the file"),
6291
+ "data-i18n-aria-label": "remove the file"
6277
6292
  },
6278
6293
  [["span", { class: "FILE_CLEAR_ICON yi-trash" }]]
6279
6294
  ]);
@@ -8368,7 +8383,10 @@ function create_coordinates(gobj, attrs) {
8368
8383
  {
8369
8384
  class: "input",
8370
8385
  type: "text",
8371
- placeholder: (0, i18next.t)("coordinates") + "..."
8386
+ placeholder: (0, i18next.t)("coordinates..."),
8387
+ "data-i18n-placeholder": "coordinates...",
8388
+ "aria-label": (0, i18next.t)("coordinates"),
8389
+ "data-i18n-aria-label": "coordinates"
8372
8390
  },
8373
8391
  "",
8374
8392
  { "input": function(evt) {
@@ -13721,7 +13739,10 @@ function make_toolbar$4(gobj) {
13721
13739
  {
13722
13740
  class: "JSON_SEARCH input",
13723
13741
  type: "text",
13724
- placeholder: (0, i18next.t)("search")
13742
+ placeholder: (0, i18next.t)("search"),
13743
+ "data-i18n-placeholder": "search",
13744
+ "aria-label": (0, i18next.t)("search"),
13745
+ "data-i18n-aria-label": "search"
13725
13746
  },
13726
13747
  [],
13727
13748
  { input: function(evt) {
@@ -16084,7 +16105,10 @@ function make_toolbar$2(gobj) {
16084
16105
  {
16085
16106
  class: "GCLASS_SEARCH input",
16086
16107
  type: "text",
16087
- placeholder: (0, i18next.t)("search")
16108
+ placeholder: (0, i18next.t)("search"),
16109
+ "data-i18n-placeholder": "search",
16110
+ "aria-label": (0, i18next.t)("search"),
16111
+ "data-i18n-aria-label": "search"
16088
16112
  },
16089
16113
  [],
16090
16114
  { input: function(evt) {
@@ -20861,7 +20885,8 @@ function render_breadcrumb(gobj, items) {
20861
20885
  "nav",
20862
20886
  {
20863
20887
  class: "breadcrumb is-small",
20864
- "aria-label": "breadcrumbs"
20888
+ "aria-label": (0, i18next.t)("breadcrumbs"),
20889
+ "data-i18n-aria-label": "breadcrumbs"
20865
20890
  },
20866
20891
  [[
20867
20892
  "ul",
@@ -2978,7 +2978,8 @@ function show_notification(shell, kind, message, opts) {
2978
2978
  },
2979
2979
  [["button", {
2980
2980
  class: "TOAST_CLOSE delete",
2981
- "aria-label": "close"
2981
+ "aria-label": t("close"),
2982
+ "data-i18n-aria-label": "close"
2982
2983
  }], [
2983
2984
  "p",
2984
2985
  {
@@ -3058,7 +3059,8 @@ function yui_shell_show_modal(shell, content, opts) {
3058
3059
  {
3059
3060
  class: "MODAL_BACK yui-dialog-back",
3060
3061
  type: "button",
3061
- "aria-label": "back"
3062
+ "aria-label": t("back"),
3063
+ "data-i18n-aria-label": "back"
3062
3064
  },
3063
3065
  [["i", { class: "yi-arrow-left" }]]
3064
3066
  ],
@@ -3083,7 +3085,8 @@ function yui_shell_show_modal(shell, content, opts) {
3083
3085
  {
3084
3086
  class: "MODAL_CLOSE yui-dialog-x",
3085
3087
  type: "button",
3086
- "aria-label": "close"
3088
+ "aria-label": t("close"),
3089
+ "data-i18n-aria-label": "close"
3087
3090
  },
3088
3091
  [["i", { class: "yi-xmark" }]]
3089
3092
  ]
@@ -3103,7 +3106,8 @@ function yui_shell_show_modal(shell, content, opts) {
3103
3106
  ]];
3104
3107
  if (with_close) modal_children.push(["button", {
3105
3108
  class: "MODAL_CLOSE modal-close is-large",
3106
- "aria-label": "close"
3109
+ "aria-label": t("close"),
3110
+ "data-i18n-aria-label": "close"
3107
3111
  }]);
3108
3112
  }
3109
3113
  let logical = opts && opts.logical_class || "";
@@ -3256,7 +3260,8 @@ function build_dialog(shell, message, buttons, opts) {
3256
3260
  ]);
3257
3261
  $card_children.push(["button", {
3258
3262
  class: "CONFIRM_CLOSE delete yui-confirm-x",
3259
- "aria-label": "close"
3263
+ "aria-label": t("close"),
3264
+ "data-i18n-aria-label": "close"
3260
3265
  }], [
3261
3266
  "section",
3262
3267
  { class: "CONFIRM_BODY modal-card-body has-text-centered" },
@@ -3756,7 +3761,8 @@ function build_ui$17(gobj) {
3756
3761
  {
3757
3762
  class: "WINDOW_MIN yui-wc wc-min",
3758
3763
  type: "button",
3759
- "aria-label": "minimize",
3764
+ "aria-label": t("minimize"),
3765
+ "data-i18n-aria-label": "minimize",
3760
3766
  style: gobj_read_bool_attr(gobj, "showMin") && gobj_read_pointer_attr(gobj, "manager") ? "" : "display:none;"
3761
3767
  },
3762
3768
  WC_MIN,
@@ -3770,7 +3776,8 @@ function build_ui$17(gobj) {
3770
3776
  {
3771
3777
  class: "WINDOW_MAX yui-wc wc-max",
3772
3778
  type: "button",
3773
- "aria-label": "maximize",
3779
+ "aria-label": t("maximize"),
3780
+ "data-i18n-aria-label": "maximize",
3774
3781
  style: gobj_read_bool_attr(gobj, "showMax") ? "" : "display:none;"
3775
3782
  },
3776
3783
  WC_MAX,
@@ -3784,7 +3791,8 @@ function build_ui$17(gobj) {
3784
3791
  {
3785
3792
  class: "WINDOW_CLOSE yui-wc wc-close",
3786
3793
  type: "button",
3787
- "aria-label": "close"
3794
+ "aria-label": t("close"),
3795
+ "data-i18n-aria-label": "close"
3788
3796
  },
3789
3797
  WC_CLOSE,
3790
3798
  { click: (evt) => {
@@ -4666,7 +4674,8 @@ function ac_register_window(gobj, event, kw, src) {
4666
4674
  {
4667
4675
  class: "yui-dock-close",
4668
4676
  type: "button",
4669
- "aria-label": "close"
4677
+ "aria-label": t("close"),
4678
+ "data-i18n-aria-label": "close"
4670
4679
  },
4671
4680
  WC_X,
4672
4681
  { click: (evt) => {
@@ -4929,7 +4938,8 @@ function build_ui$16(gobj) {
4929
4938
  "button",
4930
4939
  {
4931
4940
  class: "yui-pager-back button is-white is-hidden",
4932
- "aria-label": "back"
4941
+ "aria-label": t("back"),
4942
+ "data-i18n-aria-label": "back"
4933
4943
  },
4934
4944
  [[
4935
4945
  "span",
@@ -4953,7 +4963,8 @@ function build_ui$16(gobj) {
4953
4963
  "button",
4954
4964
  {
4955
4965
  class: "yui-pager-discard button is-white is-hidden",
4956
- "aria-label": "discard"
4966
+ "aria-label": t("discard"),
4967
+ "data-i18n-aria-label": "discard"
4957
4968
  },
4958
4969
  [[
4959
4970
  "span",
@@ -5493,7 +5504,8 @@ function build_ui$15(gobj) {
5493
5504
  "button",
5494
5505
  {
5495
5506
  class: "yui-wizard-back button",
5496
- "aria-label": "back"
5507
+ "aria-label": t("back"),
5508
+ "data-i18n-aria-label": "back"
5497
5509
  },
5498
5510
  [[
5499
5511
  "span",
@@ -5515,7 +5527,8 @@ function build_ui$15(gobj) {
5515
5527
  "button",
5516
5528
  {
5517
5529
  class: "yui-wizard-primary button is-link",
5518
- "aria-label": "next"
5530
+ "aria-label": t("next"),
5531
+ "data-i18n-aria-label": "next"
5519
5532
  },
5520
5533
  [[
5521
5534
  "span",
@@ -6251,7 +6264,8 @@ function yui_file_control(gobj, { name, value, readonly, accept, on_pick }) {
6251
6264
  type: "button",
6252
6265
  class: "FILE_PICK button is-small",
6253
6266
  "data-i18n-title": "choose a file",
6254
- "aria-label": "choose a file"
6267
+ "aria-label": t("choose a file"),
6268
+ "data-i18n-aria-label": "choose a file"
6255
6269
  },
6256
6270
  [["span", { class: "FILE_PICK_ICON yi-upload" }], [
6257
6271
  "span",
@@ -6268,7 +6282,8 @@ function yui_file_control(gobj, { name, value, readonly, accept, on_pick }) {
6268
6282
  type: "button",
6269
6283
  class: "FILE_CLEAR button is-small",
6270
6284
  "data-i18n-title": "remove the file",
6271
- "aria-label": "remove the file"
6285
+ "aria-label": t("remove the file"),
6286
+ "data-i18n-aria-label": "remove the file"
6272
6287
  },
6273
6288
  [["span", { class: "FILE_CLEAR_ICON yi-trash" }]]
6274
6289
  ]);
@@ -8363,7 +8378,10 @@ function create_coordinates(gobj, attrs) {
8363
8378
  {
8364
8379
  class: "input",
8365
8380
  type: "text",
8366
- placeholder: t("coordinates") + "..."
8381
+ placeholder: t("coordinates..."),
8382
+ "data-i18n-placeholder": "coordinates...",
8383
+ "aria-label": t("coordinates"),
8384
+ "data-i18n-aria-label": "coordinates"
8367
8385
  },
8368
8386
  "",
8369
8387
  { "input": function(evt) {
@@ -13716,7 +13734,10 @@ function make_toolbar$4(gobj) {
13716
13734
  {
13717
13735
  class: "JSON_SEARCH input",
13718
13736
  type: "text",
13719
- placeholder: t("search")
13737
+ placeholder: t("search"),
13738
+ "data-i18n-placeholder": "search",
13739
+ "aria-label": t("search"),
13740
+ "data-i18n-aria-label": "search"
13720
13741
  },
13721
13742
  [],
13722
13743
  { input: function(evt) {
@@ -16079,7 +16100,10 @@ function make_toolbar$2(gobj) {
16079
16100
  {
16080
16101
  class: "GCLASS_SEARCH input",
16081
16102
  type: "text",
16082
- placeholder: t("search")
16103
+ placeholder: t("search"),
16104
+ "data-i18n-placeholder": "search",
16105
+ "aria-label": t("search"),
16106
+ "data-i18n-aria-label": "search"
16083
16107
  },
16084
16108
  [],
16085
16109
  { input: function(evt) {
@@ -20856,7 +20880,8 @@ function render_breadcrumb(gobj, items) {
20856
20880
  "nav",
20857
20881
  {
20858
20882
  class: "breadcrumb is-small",
20859
- "aria-label": "breadcrumbs"
20883
+ "aria-label": t("breadcrumbs"),
20884
+ "data-i18n-aria-label": "breadcrumbs"
20860
20885
  },
20861
20886
  [[
20862
20887
  "ul",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.128",
3
+ "version": "7.23.130",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
package/src/c_yui_form.js CHANGED
@@ -1718,7 +1718,16 @@ function create_coordinates(gobj, attrs)
1718
1718
  ['div', {class: 'control has-icons-left'}, [
1719
1719
  [
1720
1720
  'input',
1721
- {class: 'input', type: 'text', placeholder: t('coordinates') + '...'},
1721
+ {class: 'input', type: 'text',
1722
+ /* A placeholder is not a NAME: it disappears the moment
1723
+ * something is typed, and a reader is not obliged to
1724
+ * announce it. And the key must be whole -- a composed
1725
+ * `t('coordinates') + '...'` cannot carry one, so it
1726
+ * froze in the language it was built in. */
1727
+ placeholder: t('coordinates...'),
1728
+ 'data-i18n-placeholder': 'coordinates...',
1729
+ 'aria-label': t('coordinates'),
1730
+ 'data-i18n-aria-label': 'coordinates'},
1722
1731
  '',
1723
1732
  {
1724
1733
  'input': function (evt) {
@@ -305,7 +305,12 @@ function make_toolbar(gobj)
305
305
  {
306
306
  let $search_input = createElement2(
307
307
  ['input', {class: 'GCLASS_SEARCH input', type: 'text',
308
- placeholder: t("search")}, [], {
308
+ placeholder: t("search"),
309
+ 'data-i18n-placeholder': "search",
310
+ /* A placeholder is not a name: it is gone as soon as
311
+ * something is typed. */
312
+ 'aria-label': t("search"),
313
+ 'data-i18n-aria-label': "search"}, [], {
309
314
  input: function(evt) {
310
315
  gobj_send_event(gobj, "EV_SEARCH", {text: evt.target.value}, gobj);
311
316
  }
package/src/c_yui_json.js CHANGED
@@ -379,7 +379,12 @@ function make_toolbar(gobj)
379
379
  * which re-fires EV_SEARCH with an empty term through the FSM. */
380
380
  let $search_input = createElement2(
381
381
  ['input', {class: 'JSON_SEARCH input', type: 'text',
382
- placeholder: t("search")}, [], {
382
+ placeholder: t("search"),
383
+ 'data-i18n-placeholder': "search",
384
+ /* A placeholder is not a name: it is gone as soon as
385
+ * something is typed. */
386
+ 'aria-label': t("search"),
387
+ 'data-i18n-aria-label': "search"}, [], {
383
388
  input: function(evt) {
384
389
  gobj_send_event(gobj, "EV_SEARCH", {text: evt.target.value}, gobj);
385
390
  }
package/src/c_yui_nav.js CHANGED
@@ -495,7 +495,7 @@ function render_breadcrumb(gobj, items)
495
495
  }
496
496
 
497
497
  return createElement2(
498
- ["nav", {class: "breadcrumb is-small", "aria-label": "breadcrumbs"},
498
+ ["nav", {class: "breadcrumb is-small", "aria-label": t("breadcrumbs"), "data-i18n-aria-label": "breadcrumbs"},
499
499
  [["ul", {}, lis]]]
500
500
  );
501
501
  }
@@ -148,7 +148,7 @@ function build_ui(gobj)
148
148
  ['div', {class: 'C_YUI_PAGER', style: 'height:100%; display:flex; flex-direction:column;'}, [
149
149
  ['div', {class: 'yui-pager-header is-flex is-align-items-center is-flex-grow-0',
150
150
  style: 'gap:.25rem; padding:.25rem .25rem;'}, [
151
- ['button', {class: 'yui-pager-back button is-white is-hidden', 'aria-label': 'back'}, [
151
+ ['button', {class: 'yui-pager-back button is-white is-hidden', 'aria-label': t('back'), 'data-i18n-aria-label': 'back'}, [
152
152
  ['span', {class: 'icon'}, ['i', {class: 'yi-arrow-left'}]]
153
153
  ], {
154
154
  click: function(evt) {
@@ -157,7 +157,7 @@ function build_ui(gobj)
157
157
  }
158
158
  }],
159
159
  ['span', {class: 'yui-pager-title is-flex-grow-1', style: 'font-weight:600;'}, ''],
160
- ['button', {class: 'yui-pager-discard button is-white is-hidden', 'aria-label': 'discard'}, [
160
+ ['button', {class: 'yui-pager-discard button is-white is-hidden', 'aria-label': t('discard'), 'data-i18n-aria-label': 'discard'}, [
161
161
  ['span', {class: 'icon'}, ['i', {class: 'yi-broom'}]],
162
162
  ['span', {class: 'is-hidden-mobile', i18n: 'discard'}, 'discard']
163
163
  ], {
@@ -550,7 +550,7 @@ function build_ui(gobj)
550
550
  * Minimize (to dock)
551
551
  *----------------------------*/
552
552
  ['button', {
553
- class: 'WINDOW_MIN yui-wc wc-min', type: 'button', 'aria-label': 'minimize',
553
+ class: 'WINDOW_MIN yui-wc wc-min', type: 'button', 'aria-label': t('minimize'), 'data-i18n-aria-label': 'minimize',
554
554
  style: (gobj_read_bool_attr(gobj, "showMin") &&
555
555
  gobj_read_pointer_attr(gobj, "manager")) ? '' : 'display:none;',
556
556
  }, WC_MIN, {
@@ -563,7 +563,7 @@ function build_ui(gobj)
563
563
  * Maximize / restore
564
564
  *----------------------------*/
565
565
  ['button', {
566
- class: 'WINDOW_MAX yui-wc wc-max', type: 'button', 'aria-label': 'maximize',
566
+ class: 'WINDOW_MAX yui-wc wc-max', type: 'button', 'aria-label': t('maximize'), 'data-i18n-aria-label': 'maximize',
567
567
  style: gobj_read_bool_attr(gobj, "showMax") ? '' : 'display:none;',
568
568
  }, WC_MAX, {
569
569
  click: (evt) => {
@@ -575,7 +575,7 @@ function build_ui(gobj)
575
575
  * Close
576
576
  *----------------------------*/
577
577
  ['button', {
578
- class: 'WINDOW_CLOSE yui-wc wc-close', type: 'button', 'aria-label': 'close',
578
+ class: 'WINDOW_CLOSE yui-wc wc-close', type: 'button', 'aria-label': t('close'), 'data-i18n-aria-label': 'close',
579
579
  }, WC_CLOSE, {
580
580
  click: (evt) => {
581
581
  evt.stopPropagation();
@@ -44,6 +44,8 @@ import {
44
44
  gobj_name,
45
45
  } from "@yuneta/gobj-js";
46
46
 
47
+ import {t} from "i18next";
48
+
47
49
 
48
50
  /***************************************************************
49
51
  * Constants
@@ -494,7 +496,7 @@ function ac_register_window(gobj, event, kw, src)
494
496
  ), [
495
497
  chip_lead(kw.icon),
496
498
  ['span', {class: 'yui-dock-label'}, label_items],
497
- ['button', {class: 'yui-dock-close', type: 'button', 'aria-label': 'close'}, WC_X, {
499
+ ['button', {class: 'yui-dock-close', type: 'button', 'aria-label': t('close'), 'data-i18n-aria-label': 'close'}, WC_X, {
498
500
  click: (evt) => {
499
501
  evt.stopPropagation();
500
502
  gobj_send_event(entry.gobj, "EV_CLOSE_WINDOW", {}, gobj);
@@ -50,6 +50,8 @@ import {
50
50
  wizard_should_validate,
51
51
  } from "./wizard_helpers.js";
52
52
 
53
+ import {t} from "i18next";
54
+
53
55
 
54
56
  /***************************************************************
55
57
  * Constants
@@ -166,7 +168,7 @@ function build_ui(gobj)
166
168
  ],
167
169
  ['div', {class: 'yui-wizard-footer is-flex is-justify-content-space-between is-flex-grow-0',
168
170
  style: 'gap:.5rem; padding:.5rem;'}, [
169
- ['button', {class: 'yui-wizard-back button', 'aria-label': 'back'}, [
171
+ ['button', {class: 'yui-wizard-back button', 'aria-label': t('back'), 'data-i18n-aria-label': 'back'}, [
170
172
  ['span', {class: 'icon'}, ['i', {class: 'yi-arrow-left'}]],
171
173
  ['span', {class: 'is-hidden-mobile', i18n: 'back'}, 'back']
172
174
  ], {
@@ -175,7 +177,7 @@ function build_ui(gobj)
175
177
  gobj_send_event(gobj, "EV_PREV", {}, gobj);
176
178
  }
177
179
  }],
178
- ['button', {class: 'yui-wizard-primary button is-link', 'aria-label': 'next'}, [
180
+ ['button', {class: 'yui-wizard-primary button is-link', 'aria-label': t('next'), 'data-i18n-aria-label': 'next'}, [
179
181
  ['span', {class: 'yui-wizard-primary-label', i18n: 'next'}, 'next']
180
182
  ], {
181
183
  click: function(evt) {
@@ -35,6 +35,8 @@ import {
35
35
  } from "@yuneta/gobj-js";
36
36
  import {yui_tint} from "./bulma_tint.js";
37
37
 
38
+
39
+ import {t} from "i18next";
38
40
  import {
39
41
  activate_focus_trap_on,
40
42
  } from "./shell_focus_trap.js";
@@ -125,7 +127,7 @@ function show_notification(shell, kind, message, opts)
125
127
  ["div", {class: `TOAST notification yui-notification ${yui_tint(kind)}`,
126
128
  role: kind === "danger" ? "alert" : "status"},
127
129
  [
128
- ["button", {class: "TOAST_CLOSE delete", "aria-label": "close"}],
130
+ ["button", {class: "TOAST_CLOSE delete", "aria-label": t("close"), "data-i18n-aria-label": "close"}],
129
131
  ["p", {...p_attrs, class: "TOAST_MSG"}, message]
130
132
  ]
131
133
  ]
@@ -226,14 +228,14 @@ export function yui_shell_show_modal(shell, content, opts)
226
228
  let modal_children;
227
229
  if(dialog) {
228
230
  let header = ["div", {class: "MODAL_HEADER yui-dialog-header"}, [
229
- ["button", {class: "MODAL_BACK yui-dialog-back", type: "button", "aria-label": "back"},
231
+ ["button", {class: "MODAL_BACK yui-dialog-back", type: "button", "aria-label": t("back"), "data-i18n-aria-label": "back"},
230
232
  [["i", {class: "yi-arrow-left"}]]],
231
233
  ["span", {class: "MODAL_TITLE yui-dialog-title"},
232
234
  (title_prefix ? [["span", {class: "MODAL_TITLE_PREFIX"}, title_prefix]] : [])
233
235
  .concat(title
234
236
  ? [["span", {class: "MODAL_TITLE_KIND", i18n: title}, title]]
235
237
  : [])],
236
- ["button", {class: "MODAL_CLOSE yui-dialog-x", type: "button", "aria-label": "close"},
238
+ ["button", {class: "MODAL_CLOSE yui-dialog-x", type: "button", "aria-label": t("close"), "data-i18n-aria-label": "close"},
237
239
  [["i", {class: "yi-xmark"}]]],
238
240
  ]];
239
241
  let body = ["div", {class: "MODAL_BODY yui-dialog-body"}, inner ? [inner] : []];
@@ -253,7 +255,7 @@ export function yui_shell_show_modal(shell, content, opts)
253
255
  if(with_close) {
254
256
  modal_children.push(
255
257
  ["button", {class: "MODAL_CLOSE modal-close is-large",
256
- "aria-label": "close"}]
258
+ "aria-label": t("close"), "data-i18n-aria-label": "close"}]
257
259
  );
258
260
  }
259
261
  }
@@ -468,7 +470,7 @@ function build_dialog(shell, message, buttons, opts)
468
470
  );
469
471
  }
470
472
  $card_children.push(
471
- ["button", {class: "CONFIRM_CLOSE delete yui-confirm-x", "aria-label": "close"}],
473
+ ["button", {class: "CONFIRM_CLOSE delete yui-confirm-x", "aria-label": t("close"), "data-i18n-aria-label": "close"}],
472
474
  ["section", {class: "CONFIRM_BODY modal-card-body has-text-centered"},
473
475
  $body_children],
474
476
  ["footer", {class: "CONFIRM_FOOT modal-card-foot"}, $footer_children]
package/src/yui_dev.js CHANGED
@@ -66,6 +66,21 @@ const TRAFFIC_TS_FIELDS = {
66
66
  * repainted from it by `refresh_dev_chrome()` on every toggle, so a
67
67
  * label translated once at build time would come back in English at
68
68
  * the first click. */
69
+ /* ⚠️ The keys of this window are a BLIND SPOT for a consumer's
70
+ * `validate-locales`: the table below and the `mk_expand` / `mk_dir` /
71
+ * `mk_out` helpers pass their key as a VARIABLE, so a scan of `t("…")`
72
+ * sees none of them and reports OK with the whole window in English --
73
+ * which is how it shipped in gui_agent and gui_treedb. The full set a
74
+ * consumer must define, kept here so it can be copied:
75
+ *
76
+ * automata, creation, start / stop, subscriptions, i18n, traffic,
77
+ * no poll, output, window, console, both, view, detailed, expanded,
78
+ * name only, expand, schema, data, metadata, show, outgoing,
79
+ * incoming, errors, find, log, traces, developer, yuno monitor,
80
+ * copied, muted, unmute
81
+ *
82
+ * wattyzer and the yunovatios GUIs carry them; check a new consumer
83
+ * against this list, and confirm it by DUMPING the window. */
69
84
  const TRACE_DEFS = [
70
85
  ["trace_automata", "automata", trace_automata],
71
86
  ["trace_creation", "creation", trace_creation],
@@ -41,6 +41,8 @@ import {
41
41
 
42
42
  import "./yui_file_field.css";
43
43
 
44
+
45
+ import {t} from "i18next";
44
46
  /*
45
47
  * What the treedb's default ceiling accepts, as an `accept` attribute:
46
48
  * a hint to the file dialog, never a check. The check is treedb's, on
@@ -261,7 +263,8 @@ function yui_file_control(gobj, {name, value, readonly, accept, on_pick})
261
263
  type: "button",
262
264
  class: "FILE_PICK button is-small",
263
265
  "data-i18n-title": "choose a file",
264
- "aria-label": "choose a file"
266
+ "aria-label": t("choose a file"),
267
+ "data-i18n-aria-label": "choose a file"
265
268
  }, [
266
269
  ["span", {class: "FILE_PICK_ICON yi-upload"}],
267
270
  /* The label stays: this control is alone in its row, so nothing
@@ -274,7 +277,8 @@ function yui_file_control(gobj, {name, value, readonly, accept, on_pick})
274
277
  type: "button",
275
278
  class: "FILE_CLEAR button is-small",
276
279
  "data-i18n-title": "remove the file",
277
- "aria-label": "remove the file"
280
+ "aria-label": t("remove the file"),
281
+ "data-i18n-aria-label": "remove the file"
278
282
  }, [
279
283
  ["span", {class: "FILE_CLEAR_ICON yi-trash"}]
280
284
  ]]);