@yuneta/gobj-ui 7.23.112 → 7.23.114

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.
@@ -68243,6 +68243,14 @@ function open_dialog(gobj, $content, title, logical, title_prefix) {
68243
68243
  * a language change does not have to know the form exists.
68244
68244
  ***************************************************************/
68245
68245
  function field(logical, name, label, $control, help) {
68246
+ if ((0, _yuneta_gobj_js.is_array)($control) && (0, _yuneta_gobj_js.is_object)($control[1]) && [
68247
+ "input",
68248
+ "select",
68249
+ "textarea"
68250
+ ].includes($control[0]) && !$control[1]["aria-label"]) {
68251
+ $control[1]["aria-label"] = (0, i18next.t)(label);
68252
+ $control[1]["data-i18n-aria-label"] = label;
68253
+ }
68246
68254
  return [
68247
68255
  "div",
68248
68256
  { class: `${logical} field mb-3` },
@@ -72101,37 +72109,37 @@ var TRAFFIC_TS_FIELDS = {
72101
72109
  var TRACE_DEFS = [
72102
72110
  [
72103
72111
  "trace_automata",
72104
- "Automata",
72112
+ "automata",
72105
72113
  trace_automata
72106
72114
  ],
72107
72115
  [
72108
72116
  "trace_creation",
72109
- "Creation",
72117
+ "creation",
72110
72118
  trace_creation
72111
72119
  ],
72112
72120
  [
72113
72121
  "trace_start_stop",
72114
- "Start/Stop",
72122
+ "start / stop",
72115
72123
  trace_start_stop
72116
72124
  ],
72117
72125
  [
72118
72126
  "trace_subscriptions",
72119
- "Subscriptions",
72127
+ "subscriptions",
72120
72128
  trace_subscriptions
72121
72129
  ],
72122
72130
  [
72123
72131
  "trace_i18n",
72124
- "I18n",
72132
+ "i18n",
72125
72133
  trace_i18n
72126
72134
  ],
72127
72135
  [
72128
72136
  "trace_traffic",
72129
- "Traffic",
72137
+ "traffic",
72130
72138
  trace_traffic
72131
72139
  ],
72132
72140
  [
72133
72141
  "no_poll",
72134
- "No Poll",
72142
+ "no poll",
72135
72143
  set_no_poll
72136
72144
  ]
72137
72145
  ];
@@ -72605,7 +72613,8 @@ function mute_button(sig) {
72605
72613
  {
72606
72614
  class: "TRAFFIC_MUTE",
72607
72615
  type: "button",
72608
- title: "Mute " + sig
72616
+ title: (0, i18next.t)("mute this message"),
72617
+ "data-i18n-title": "mute this message"
72609
72618
  },
72610
72619
  "⊘",
72611
72620
  { click: (ev) => {
@@ -73105,7 +73114,7 @@ function set_no_poll() {
73105
73114
  function refresh_dev_chrome() {
73106
73115
  document.querySelectorAll(".YDEV_CHIP[data-trace]").forEach(($b) => {
73107
73116
  let key = $b.getAttribute("data-trace");
73108
- let label = $b.getAttribute("data-label") || "";
73117
+ let label = (0, i18next.t)($b.getAttribute("data-label") || "");
73109
73118
  let v = dev_num(key, 0);
73110
73119
  $b.textContent = key === "trace_automata" && v > 0 ? label + " " + v : label;
73111
73120
  $b.classList.toggle("is-active", v > 0);
@@ -73139,7 +73148,8 @@ function refresh_dev_chrome() {
73139
73148
  if (set.size) {
73140
73149
  let $lbl = document.createElement("span");
73141
73150
  $lbl.className = "YDEV_LABEL";
73142
- $lbl.textContent = "Muted";
73151
+ $lbl.textContent = (0, i18next.t)("muted");
73152
+ $lbl.setAttribute("data-i18n", "muted");
73143
73153
  $m.appendChild($lbl);
73144
73154
  set.forEach((sig) => {
73145
73155
  $m.appendChild((0, _yuneta_gobj_js.createElement2)([
@@ -73147,7 +73157,8 @@ function refresh_dev_chrome() {
73147
73157
  {
73148
73158
  class: "YDEV_MUTED_CHIP",
73149
73159
  type: "button",
73150
- title: "Unmute"
73160
+ title: (0, i18next.t)("unmute"),
73161
+ "data-i18n-title": "unmute"
73151
73162
  },
73152
73163
  "⊘ " + sig + " ✕",
73153
73164
  { click: (ev) => {
@@ -73202,15 +73213,16 @@ function dev_fallback_copy(text) {
73202
73213
  document.body.removeChild(ta);
73203
73214
  }
73204
73215
  function build_control_bar() {
73205
- let trace_chips = TRACE_DEFS.map(([key, label, fn]) => [
73216
+ let trace_chips = TRACE_DEFS.map(([key, label_key, fn]) => [
73206
73217
  "button",
73207
73218
  {
73208
73219
  class: "YDEV_CHIP",
73209
73220
  "data-trace": key,
73210
- "data-label": label,
73221
+ "data-label": label_key,
73222
+ "data-i18n": label_key,
73211
73223
  type: "button"
73212
73224
  },
73213
- label,
73225
+ (0, i18next.t)(label_key),
73214
73226
  { click: (ev) => {
73215
73227
  ev.stopPropagation();
73216
73228
  fn();
@@ -73222,9 +73234,11 @@ function build_control_bar() {
73222
73234
  class: "YDEV_CHIP",
73223
73235
  "data-toggle": "automata-simple",
73224
73236
  type: "button",
73225
- title: "Machine trace shape. On (default): one line per transition, event first, like the C kernel. Off: the legacy three-line shape (the call, the state change and the return)"
73237
+ title: (0, i18next.t)("machine trace shape"),
73238
+ "data-i18n-title": "machine trace shape",
73239
+ "data-i18n": "simple mach"
73226
73240
  },
73227
- "Simple mach",
73241
+ (0, i18next.t)("simple mach"),
73228
73242
  { click: (ev) => {
73229
73243
  ev.stopPropagation();
73230
73244
  let v = dev_simple_mach() ? 0 : 1;
@@ -73238,9 +73252,10 @@ function build_control_bar() {
73238
73252
  {
73239
73253
  class: "YDEV_SEG_BTN",
73240
73254
  "data-view": v,
73255
+ "data-i18n": label,
73241
73256
  type: "button"
73242
73257
  },
73243
- label,
73258
+ (0, i18next.t)(label),
73244
73259
  { click: (ev) => {
73245
73260
  ev.stopPropagation();
73246
73261
  set_view(v);
@@ -73253,16 +73268,16 @@ function build_control_bar() {
73253
73268
  id: "ydev-seg"
73254
73269
  },
73255
73270
  [
73256
- mk_view("detailed", "Detailed"),
73257
- mk_view("full", "Expanded"),
73258
- mk_view("compact", "Compact"),
73259
- mk_view("name", "Name only")
73271
+ mk_view("detailed", "detailed"),
73272
+ mk_view("full", "expanded"),
73273
+ mk_view("compact", "compact"),
73274
+ mk_view("name", "name only")
73260
73275
  ]
73261
73276
  ];
73262
73277
  let OUT_TITLES = {
73263
- window: "Dev window only (browser console stays clean)",
73264
- console: "Browser console only (nothing shown in this window)",
73265
- both: "Dev window and browser console"
73278
+ window: "dev window only",
73279
+ console: "browser console only",
73280
+ both: "dev window and browser console"
73266
73281
  };
73267
73282
  let mk_out = (v, label) => [
73268
73283
  "button",
@@ -73270,9 +73285,11 @@ function build_control_bar() {
73270
73285
  class: "YDEV_SEG_BTN",
73271
73286
  "data-output": v,
73272
73287
  type: "button",
73273
- title: OUT_TITLES[v]
73288
+ title: (0, i18next.t)(OUT_TITLES[v]),
73289
+ "data-i18n-title": OUT_TITLES[v],
73290
+ "data-i18n": label
73274
73291
  },
73275
- label,
73292
+ (0, i18next.t)(label),
73276
73293
  { click: (ev) => {
73277
73294
  ev.stopPropagation();
73278
73295
  set_output_route(v);
@@ -73285,9 +73302,9 @@ function build_control_bar() {
73285
73302
  id: "ydev-output"
73286
73303
  },
73287
73304
  [
73288
- mk_out("window", "Window"),
73289
- mk_out("console", "Console"),
73290
- mk_out("both", "Both")
73305
+ mk_out("window", "window"),
73306
+ mk_out("console", "console"),
73307
+ mk_out("both", "both")
73291
73308
  ]
73292
73309
  ];
73293
73310
  let mk_expand = (key, label) => [
@@ -73296,9 +73313,11 @@ function build_control_bar() {
73296
73313
  class: "YDEV_CHIP",
73297
73314
  "data-expand": key,
73298
73315
  type: "button",
73299
- title: "Show " + label + " in the Expanded view"
73316
+ title: (0, i18next.t)("show this section in the expanded view"),
73317
+ "data-i18n-title": "show this section in the expanded view",
73318
+ "data-i18n": label
73300
73319
  },
73301
- label,
73320
+ (0, i18next.t)(label),
73302
73321
  { click: (ev) => {
73303
73322
  ev.stopPropagation();
73304
73323
  toggle_pref(key, key === "dev_full_data" ? 1 : 0);
@@ -73313,12 +73332,15 @@ function build_control_bar() {
73313
73332
  [
73314
73333
  [
73315
73334
  "span",
73316
- { class: "YDEV_LABEL" },
73317
- "Expand"
73335
+ {
73336
+ class: "YDEV_LABEL",
73337
+ "data-i18n": "expand"
73338
+ },
73339
+ (0, i18next.t)("expand")
73318
73340
  ],
73319
- mk_expand("dev_full_schema", "Schema"),
73320
- mk_expand("dev_full_data", "Data"),
73321
- mk_expand("dev_full_meta", "Metadata")
73341
+ mk_expand("dev_full_schema", "schema"),
73342
+ mk_expand("dev_full_data", "data"),
73343
+ mk_expand("dev_full_meta", "metadata")
73322
73344
  ]
73323
73345
  ];
73324
73346
  let mk_dir = (dir, glyph, key, title) => [
@@ -73327,7 +73349,8 @@ function build_control_bar() {
73327
73349
  class: "YDEV_CHIP s-" + dir,
73328
73350
  "data-dir": key,
73329
73351
  type: "button",
73330
- title
73352
+ title: (0, i18next.t)(title),
73353
+ "data-i18n-title": title
73331
73354
  },
73332
73355
  glyph,
73333
73356
  { click: (ev) => {
@@ -73336,9 +73359,9 @@ function build_control_bar() {
73336
73359
  } }
73337
73360
  ];
73338
73361
  let dir_chips = [
73339
- mk_dir("out", "⇢", "dev_filter_out", "Outgoing"),
73340
- mk_dir("in", "⇠", "dev_filter_in", "Incoming"),
73341
- mk_dir("err", "⚠", "dev_filter_err", "Errors")
73362
+ mk_dir("out", "⇢", "dev_filter_out", "outgoing"),
73363
+ mk_dir("in", "⇠", "dev_filter_in", "incoming"),
73364
+ mk_dir("err", "⚠", "dev_filter_err", "errors")
73342
73365
  ];
73343
73366
  let periodic_chip = [
73344
73367
  "button",
@@ -73346,9 +73369,18 @@ function build_control_bar() {
73346
73369
  class: "YDEV_CHIP",
73347
73370
  "data-toggle": "periodic",
73348
73371
  type: "button",
73349
- title: "Hide the timers: EV_TIMEOUT / PERIODIC / HEARTBEAT / PING transitions, and recurring traffic. On by default"
73372
+ title: (0, i18next.t)("hide the timers and the recurring traffic"),
73373
+ "data-i18n-title": "hide the timers and the recurring traffic"
73350
73374
  },
73351
- "⊘ Periodic",
73375
+ [[
73376
+ "span",
73377
+ { class: "YDEV_GLYPH" },
73378
+ "⊘"
73379
+ ], [
73380
+ "span",
73381
+ { "data-i18n": "periodic" },
73382
+ (0, i18next.t)("periodic")
73383
+ ]],
73352
73384
  { click: (ev) => {
73353
73385
  ev.stopPropagation();
73354
73386
  toggle_pref("dev_hide_periodic", HIDE_PERIODIC_DEFAULT);
@@ -73359,8 +73391,9 @@ function build_control_bar() {
73359
73391
  {
73360
73392
  class: "YDEV_SEARCH",
73361
73393
  type: "search",
73362
- placeholder: "filter events / payload…",
73363
- "data-role": "search"
73394
+ "data-role": "search",
73395
+ placeholder: (0, i18next.t)("filter events / payload"),
73396
+ "data-i18n-placeholder": "filter events / payload"
73364
73397
  },
73365
73398
  "",
73366
73399
  { input: (ev) => {
@@ -73373,15 +73406,17 @@ function build_control_bar() {
73373
73406
  {
73374
73407
  class: "YDEV_CHIP",
73375
73408
  type: "button",
73376
- title: "Copy visible traffic to clipboard"
73409
+ title: (0, i18next.t)("copy visible traffic to clipboard"),
73410
+ "data-i18n-title": "copy visible traffic to clipboard",
73411
+ "data-i18n": "copy"
73377
73412
  },
73378
- "Copy",
73413
+ (0, i18next.t)("copy"),
73379
73414
  { click: (ev) => {
73380
73415
  ev.stopPropagation();
73381
73416
  let btn = ev.currentTarget;
73382
73417
  dev_copy_text(traffic_to_text()).then(() => {
73383
73418
  let prev = btn.textContent;
73384
- btn.textContent = "Copied";
73419
+ btn.textContent = (0, i18next.t)("copied");
73385
73420
  setTimeout(() => {
73386
73421
  btn.textContent = prev;
73387
73422
  }, 1e3);
@@ -73393,9 +73428,11 @@ function build_control_bar() {
73393
73428
  {
73394
73429
  class: "YDEV_CHIP",
73395
73430
  type: "button",
73396
- title: "Clear captured traffic"
73431
+ title: (0, i18next.t)("clear captured traffic"),
73432
+ "data-i18n-title": "clear captured traffic",
73433
+ "data-i18n": "clear"
73397
73434
  },
73398
- "Clear",
73435
+ (0, i18next.t)("clear"),
73399
73436
  { click: (ev) => {
73400
73437
  ev.stopPropagation();
73401
73438
  clear_traffic();
@@ -73406,8 +73443,11 @@ function build_control_bar() {
73406
73443
  { class: "YDEV_GROUP" },
73407
73444
  [[
73408
73445
  "span",
73409
- { class: "YDEV_LABEL" },
73410
- label
73446
+ {
73447
+ class: "YDEV_LABEL",
73448
+ "data-i18n": label
73449
+ },
73450
+ (0, i18next.t)(label)
73411
73451
  ], ...items]
73412
73452
  ];
73413
73453
  let sep = () => [
@@ -73419,18 +73459,18 @@ function build_control_bar() {
73419
73459
  "div",
73420
73460
  { class: "YDEV_BAR" },
73421
73461
  [
73422
- grp("Traces", [...trace_chips, simple_mach]),
73462
+ grp("traces", [...trace_chips, simple_mach]),
73423
73463
  sep(),
73424
- grp("Output", [output_seg]),
73464
+ grp("output", [output_seg]),
73425
73465
  sep(),
73426
- grp("View", [view_seg]),
73466
+ grp("view", [view_seg]),
73427
73467
  expand_grp,
73428
73468
  sep(),
73429
- grp("Show", [...dir_chips, periodic_chip]),
73469
+ grp("show", [...dir_chips, periodic_chip]),
73430
73470
  sep(),
73431
- grp("Find", [search]),
73471
+ grp("find", [search]),
73432
73472
  sep(),
73433
- grp("Log", [copy, clear])
73473
+ grp("log", [copy, clear])
73434
73474
  ]
73435
73475
  ]);
73436
73476
  }
@@ -73440,12 +73480,18 @@ function build_title_header() {
73440
73480
  { class: "YDEV_TITLE" },
73441
73481
  [[
73442
73482
  "span",
73443
- { class: "YDEV_TITLE_MAIN" },
73444
- "Developer"
73483
+ {
73484
+ class: "YDEV_TITLE_MAIN",
73485
+ "data-i18n": "developer"
73486
+ },
73487
+ (0, i18next.t)("developer")
73445
73488
  ], [
73446
73489
  "span",
73447
- { class: "YDEV_TITLE_SUB" },
73448
- "yuno monitor · traffic & traces"
73490
+ {
73491
+ class: "YDEV_TITLE_SUB",
73492
+ "data-i18n": "yuno monitor"
73493
+ },
73494
+ (0, i18next.t)("yuno monitor")
73449
73495
  ]]
73450
73496
  ]);
73451
73497
  }
@@ -73543,7 +73589,7 @@ function setup_dev(self, show) {
73543
73589
  showFooter: false,
73544
73590
  auto_save_size_and_position: true,
73545
73591
  center: false,
73546
- title: "Developer",
73592
+ title: "developer",
73547
73593
  icon: "yi-terminal",
73548
73594
  manager: (0, _yuneta_gobj_js.gobj_find_service)("__window_manager__", false) || null,
73549
73595
  keep_on_navigate: true,
@@ -68238,6 +68238,14 @@ function open_dialog(gobj, $content, title, logical, title_prefix) {
68238
68238
  * a language change does not have to know the form exists.
68239
68239
  ***************************************************************/
68240
68240
  function field(logical, name, label, $control, help) {
68241
+ if (is_array($control) && is_object($control[1]) && [
68242
+ "input",
68243
+ "select",
68244
+ "textarea"
68245
+ ].includes($control[0]) && !$control[1]["aria-label"]) {
68246
+ $control[1]["aria-label"] = t(label);
68247
+ $control[1]["data-i18n-aria-label"] = label;
68248
+ }
68241
68249
  return [
68242
68250
  "div",
68243
68251
  { class: `${logical} field mb-3` },
@@ -72096,37 +72104,37 @@ var TRAFFIC_TS_FIELDS = {
72096
72104
  var TRACE_DEFS = [
72097
72105
  [
72098
72106
  "trace_automata",
72099
- "Automata",
72107
+ "automata",
72100
72108
  trace_automata
72101
72109
  ],
72102
72110
  [
72103
72111
  "trace_creation",
72104
- "Creation",
72112
+ "creation",
72105
72113
  trace_creation
72106
72114
  ],
72107
72115
  [
72108
72116
  "trace_start_stop",
72109
- "Start/Stop",
72117
+ "start / stop",
72110
72118
  trace_start_stop
72111
72119
  ],
72112
72120
  [
72113
72121
  "trace_subscriptions",
72114
- "Subscriptions",
72122
+ "subscriptions",
72115
72123
  trace_subscriptions
72116
72124
  ],
72117
72125
  [
72118
72126
  "trace_i18n",
72119
- "I18n",
72127
+ "i18n",
72120
72128
  trace_i18n
72121
72129
  ],
72122
72130
  [
72123
72131
  "trace_traffic",
72124
- "Traffic",
72132
+ "traffic",
72125
72133
  trace_traffic
72126
72134
  ],
72127
72135
  [
72128
72136
  "no_poll",
72129
- "No Poll",
72137
+ "no poll",
72130
72138
  set_no_poll
72131
72139
  ]
72132
72140
  ];
@@ -72600,7 +72608,8 @@ function mute_button(sig) {
72600
72608
  {
72601
72609
  class: "TRAFFIC_MUTE",
72602
72610
  type: "button",
72603
- title: "Mute " + sig
72611
+ title: t("mute this message"),
72612
+ "data-i18n-title": "mute this message"
72604
72613
  },
72605
72614
  "⊘",
72606
72615
  { click: (ev) => {
@@ -73100,7 +73109,7 @@ function set_no_poll() {
73100
73109
  function refresh_dev_chrome() {
73101
73110
  document.querySelectorAll(".YDEV_CHIP[data-trace]").forEach(($b) => {
73102
73111
  let key = $b.getAttribute("data-trace");
73103
- let label = $b.getAttribute("data-label") || "";
73112
+ let label = t($b.getAttribute("data-label") || "");
73104
73113
  let v = dev_num(key, 0);
73105
73114
  $b.textContent = key === "trace_automata" && v > 0 ? label + " " + v : label;
73106
73115
  $b.classList.toggle("is-active", v > 0);
@@ -73134,7 +73143,8 @@ function refresh_dev_chrome() {
73134
73143
  if (set.size) {
73135
73144
  let $lbl = document.createElement("span");
73136
73145
  $lbl.className = "YDEV_LABEL";
73137
- $lbl.textContent = "Muted";
73146
+ $lbl.textContent = t("muted");
73147
+ $lbl.setAttribute("data-i18n", "muted");
73138
73148
  $m.appendChild($lbl);
73139
73149
  set.forEach((sig) => {
73140
73150
  $m.appendChild(createElement2([
@@ -73142,7 +73152,8 @@ function refresh_dev_chrome() {
73142
73152
  {
73143
73153
  class: "YDEV_MUTED_CHIP",
73144
73154
  type: "button",
73145
- title: "Unmute"
73155
+ title: t("unmute"),
73156
+ "data-i18n-title": "unmute"
73146
73157
  },
73147
73158
  "⊘ " + sig + " ✕",
73148
73159
  { click: (ev) => {
@@ -73197,15 +73208,16 @@ function dev_fallback_copy(text) {
73197
73208
  document.body.removeChild(ta);
73198
73209
  }
73199
73210
  function build_control_bar() {
73200
- let trace_chips = TRACE_DEFS.map(([key, label, fn]) => [
73211
+ let trace_chips = TRACE_DEFS.map(([key, label_key, fn]) => [
73201
73212
  "button",
73202
73213
  {
73203
73214
  class: "YDEV_CHIP",
73204
73215
  "data-trace": key,
73205
- "data-label": label,
73216
+ "data-label": label_key,
73217
+ "data-i18n": label_key,
73206
73218
  type: "button"
73207
73219
  },
73208
- label,
73220
+ t(label_key),
73209
73221
  { click: (ev) => {
73210
73222
  ev.stopPropagation();
73211
73223
  fn();
@@ -73217,9 +73229,11 @@ function build_control_bar() {
73217
73229
  class: "YDEV_CHIP",
73218
73230
  "data-toggle": "automata-simple",
73219
73231
  type: "button",
73220
- title: "Machine trace shape. On (default): one line per transition, event first, like the C kernel. Off: the legacy three-line shape (the call, the state change and the return)"
73232
+ title: t("machine trace shape"),
73233
+ "data-i18n-title": "machine trace shape",
73234
+ "data-i18n": "simple mach"
73221
73235
  },
73222
- "Simple mach",
73236
+ t("simple mach"),
73223
73237
  { click: (ev) => {
73224
73238
  ev.stopPropagation();
73225
73239
  let v = dev_simple_mach() ? 0 : 1;
@@ -73233,9 +73247,10 @@ function build_control_bar() {
73233
73247
  {
73234
73248
  class: "YDEV_SEG_BTN",
73235
73249
  "data-view": v,
73250
+ "data-i18n": label,
73236
73251
  type: "button"
73237
73252
  },
73238
- label,
73253
+ t(label),
73239
73254
  { click: (ev) => {
73240
73255
  ev.stopPropagation();
73241
73256
  set_view(v);
@@ -73248,16 +73263,16 @@ function build_control_bar() {
73248
73263
  id: "ydev-seg"
73249
73264
  },
73250
73265
  [
73251
- mk_view("detailed", "Detailed"),
73252
- mk_view("full", "Expanded"),
73253
- mk_view("compact", "Compact"),
73254
- mk_view("name", "Name only")
73266
+ mk_view("detailed", "detailed"),
73267
+ mk_view("full", "expanded"),
73268
+ mk_view("compact", "compact"),
73269
+ mk_view("name", "name only")
73255
73270
  ]
73256
73271
  ];
73257
73272
  let OUT_TITLES = {
73258
- window: "Dev window only (browser console stays clean)",
73259
- console: "Browser console only (nothing shown in this window)",
73260
- both: "Dev window and browser console"
73273
+ window: "dev window only",
73274
+ console: "browser console only",
73275
+ both: "dev window and browser console"
73261
73276
  };
73262
73277
  let mk_out = (v, label) => [
73263
73278
  "button",
@@ -73265,9 +73280,11 @@ function build_control_bar() {
73265
73280
  class: "YDEV_SEG_BTN",
73266
73281
  "data-output": v,
73267
73282
  type: "button",
73268
- title: OUT_TITLES[v]
73283
+ title: t(OUT_TITLES[v]),
73284
+ "data-i18n-title": OUT_TITLES[v],
73285
+ "data-i18n": label
73269
73286
  },
73270
- label,
73287
+ t(label),
73271
73288
  { click: (ev) => {
73272
73289
  ev.stopPropagation();
73273
73290
  set_output_route(v);
@@ -73280,9 +73297,9 @@ function build_control_bar() {
73280
73297
  id: "ydev-output"
73281
73298
  },
73282
73299
  [
73283
- mk_out("window", "Window"),
73284
- mk_out("console", "Console"),
73285
- mk_out("both", "Both")
73300
+ mk_out("window", "window"),
73301
+ mk_out("console", "console"),
73302
+ mk_out("both", "both")
73286
73303
  ]
73287
73304
  ];
73288
73305
  let mk_expand = (key, label) => [
@@ -73291,9 +73308,11 @@ function build_control_bar() {
73291
73308
  class: "YDEV_CHIP",
73292
73309
  "data-expand": key,
73293
73310
  type: "button",
73294
- title: "Show " + label + " in the Expanded view"
73311
+ title: t("show this section in the expanded view"),
73312
+ "data-i18n-title": "show this section in the expanded view",
73313
+ "data-i18n": label
73295
73314
  },
73296
- label,
73315
+ t(label),
73297
73316
  { click: (ev) => {
73298
73317
  ev.stopPropagation();
73299
73318
  toggle_pref(key, key === "dev_full_data" ? 1 : 0);
@@ -73308,12 +73327,15 @@ function build_control_bar() {
73308
73327
  [
73309
73328
  [
73310
73329
  "span",
73311
- { class: "YDEV_LABEL" },
73312
- "Expand"
73330
+ {
73331
+ class: "YDEV_LABEL",
73332
+ "data-i18n": "expand"
73333
+ },
73334
+ t("expand")
73313
73335
  ],
73314
- mk_expand("dev_full_schema", "Schema"),
73315
- mk_expand("dev_full_data", "Data"),
73316
- mk_expand("dev_full_meta", "Metadata")
73336
+ mk_expand("dev_full_schema", "schema"),
73337
+ mk_expand("dev_full_data", "data"),
73338
+ mk_expand("dev_full_meta", "metadata")
73317
73339
  ]
73318
73340
  ];
73319
73341
  let mk_dir = (dir, glyph, key, title) => [
@@ -73322,7 +73344,8 @@ function build_control_bar() {
73322
73344
  class: "YDEV_CHIP s-" + dir,
73323
73345
  "data-dir": key,
73324
73346
  type: "button",
73325
- title
73347
+ title: t(title),
73348
+ "data-i18n-title": title
73326
73349
  },
73327
73350
  glyph,
73328
73351
  { click: (ev) => {
@@ -73331,9 +73354,9 @@ function build_control_bar() {
73331
73354
  } }
73332
73355
  ];
73333
73356
  let dir_chips = [
73334
- mk_dir("out", "⇢", "dev_filter_out", "Outgoing"),
73335
- mk_dir("in", "⇠", "dev_filter_in", "Incoming"),
73336
- mk_dir("err", "⚠", "dev_filter_err", "Errors")
73357
+ mk_dir("out", "⇢", "dev_filter_out", "outgoing"),
73358
+ mk_dir("in", "⇠", "dev_filter_in", "incoming"),
73359
+ mk_dir("err", "⚠", "dev_filter_err", "errors")
73337
73360
  ];
73338
73361
  let periodic_chip = [
73339
73362
  "button",
@@ -73341,9 +73364,18 @@ function build_control_bar() {
73341
73364
  class: "YDEV_CHIP",
73342
73365
  "data-toggle": "periodic",
73343
73366
  type: "button",
73344
- title: "Hide the timers: EV_TIMEOUT / PERIODIC / HEARTBEAT / PING transitions, and recurring traffic. On by default"
73367
+ title: t("hide the timers and the recurring traffic"),
73368
+ "data-i18n-title": "hide the timers and the recurring traffic"
73345
73369
  },
73346
- "⊘ Periodic",
73370
+ [[
73371
+ "span",
73372
+ { class: "YDEV_GLYPH" },
73373
+ "⊘"
73374
+ ], [
73375
+ "span",
73376
+ { "data-i18n": "periodic" },
73377
+ t("periodic")
73378
+ ]],
73347
73379
  { click: (ev) => {
73348
73380
  ev.stopPropagation();
73349
73381
  toggle_pref("dev_hide_periodic", HIDE_PERIODIC_DEFAULT);
@@ -73354,8 +73386,9 @@ function build_control_bar() {
73354
73386
  {
73355
73387
  class: "YDEV_SEARCH",
73356
73388
  type: "search",
73357
- placeholder: "filter events / payload…",
73358
- "data-role": "search"
73389
+ "data-role": "search",
73390
+ placeholder: t("filter events / payload"),
73391
+ "data-i18n-placeholder": "filter events / payload"
73359
73392
  },
73360
73393
  "",
73361
73394
  { input: (ev) => {
@@ -73368,15 +73401,17 @@ function build_control_bar() {
73368
73401
  {
73369
73402
  class: "YDEV_CHIP",
73370
73403
  type: "button",
73371
- title: "Copy visible traffic to clipboard"
73404
+ title: t("copy visible traffic to clipboard"),
73405
+ "data-i18n-title": "copy visible traffic to clipboard",
73406
+ "data-i18n": "copy"
73372
73407
  },
73373
- "Copy",
73408
+ t("copy"),
73374
73409
  { click: (ev) => {
73375
73410
  ev.stopPropagation();
73376
73411
  let btn = ev.currentTarget;
73377
73412
  dev_copy_text(traffic_to_text()).then(() => {
73378
73413
  let prev = btn.textContent;
73379
- btn.textContent = "Copied";
73414
+ btn.textContent = t("copied");
73380
73415
  setTimeout(() => {
73381
73416
  btn.textContent = prev;
73382
73417
  }, 1e3);
@@ -73388,9 +73423,11 @@ function build_control_bar() {
73388
73423
  {
73389
73424
  class: "YDEV_CHIP",
73390
73425
  type: "button",
73391
- title: "Clear captured traffic"
73426
+ title: t("clear captured traffic"),
73427
+ "data-i18n-title": "clear captured traffic",
73428
+ "data-i18n": "clear"
73392
73429
  },
73393
- "Clear",
73430
+ t("clear"),
73394
73431
  { click: (ev) => {
73395
73432
  ev.stopPropagation();
73396
73433
  clear_traffic();
@@ -73401,8 +73438,11 @@ function build_control_bar() {
73401
73438
  { class: "YDEV_GROUP" },
73402
73439
  [[
73403
73440
  "span",
73404
- { class: "YDEV_LABEL" },
73405
- label
73441
+ {
73442
+ class: "YDEV_LABEL",
73443
+ "data-i18n": label
73444
+ },
73445
+ t(label)
73406
73446
  ], ...items]
73407
73447
  ];
73408
73448
  let sep = () => [
@@ -73414,18 +73454,18 @@ function build_control_bar() {
73414
73454
  "div",
73415
73455
  { class: "YDEV_BAR" },
73416
73456
  [
73417
- grp("Traces", [...trace_chips, simple_mach]),
73457
+ grp("traces", [...trace_chips, simple_mach]),
73418
73458
  sep(),
73419
- grp("Output", [output_seg]),
73459
+ grp("output", [output_seg]),
73420
73460
  sep(),
73421
- grp("View", [view_seg]),
73461
+ grp("view", [view_seg]),
73422
73462
  expand_grp,
73423
73463
  sep(),
73424
- grp("Show", [...dir_chips, periodic_chip]),
73464
+ grp("show", [...dir_chips, periodic_chip]),
73425
73465
  sep(),
73426
- grp("Find", [search]),
73466
+ grp("find", [search]),
73427
73467
  sep(),
73428
- grp("Log", [copy, clear])
73468
+ grp("log", [copy, clear])
73429
73469
  ]
73430
73470
  ]);
73431
73471
  }
@@ -73435,12 +73475,18 @@ function build_title_header() {
73435
73475
  { class: "YDEV_TITLE" },
73436
73476
  [[
73437
73477
  "span",
73438
- { class: "YDEV_TITLE_MAIN" },
73439
- "Developer"
73478
+ {
73479
+ class: "YDEV_TITLE_MAIN",
73480
+ "data-i18n": "developer"
73481
+ },
73482
+ t("developer")
73440
73483
  ], [
73441
73484
  "span",
73442
- { class: "YDEV_TITLE_SUB" },
73443
- "yuno monitor · traffic & traces"
73485
+ {
73486
+ class: "YDEV_TITLE_SUB",
73487
+ "data-i18n": "yuno monitor"
73488
+ },
73489
+ t("yuno monitor")
73444
73490
  ]]
73445
73491
  ]);
73446
73492
  }
@@ -73538,7 +73584,7 @@ function setup_dev(self, show) {
73538
73584
  showFooter: false,
73539
73585
  auto_save_size_and_position: true,
73540
73586
  center: false,
73541
- title: "Developer",
73587
+ title: "developer",
73542
73588
  icon: "yi-terminal",
73543
73589
  manager: gobj_find_service("__window_manager__", false) || null,
73544
73590
  keep_on_navigate: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.112",
3
+ "version": "7.23.114",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -107,6 +107,7 @@ import {
107
107
  kw_get_str,
108
108
  kw_get_dict,
109
109
  is_object,
110
+ is_array,
110
111
  empty_string,
111
112
  } from "@yuneta/gobj-js";
112
113
  import {yui_tint} from "./bulma_tint.js";
@@ -1557,6 +1558,17 @@ function open_dialog(gobj, $content, title, logical, title_prefix)
1557
1558
  ***************************************************************/
1558
1559
  function field(logical, name, label, $control, help)
1559
1560
  {
1561
+ /* The label is a SIBLING of the control -- Bulma's `field` shape --
1562
+ * so it names it for the eye and for nothing else: no `for`, no
1563
+ * wrapping, and a reader announces the box as unlabelled. The name
1564
+ * is put on the control itself, from the label's own key, so the
1565
+ * two cannot drift and a language change reaches both. */
1566
+ if(is_array($control) && is_object($control[1]) &&
1567
+ ["input", "select", "textarea"].includes($control[0]) &&
1568
+ !$control[1]["aria-label"]) {
1569
+ $control[1]["aria-label"] = t(label);
1570
+ $control[1]["data-i18n-aria-label"] = label;
1571
+ }
1560
1572
  return ["div", {class: `${logical} field mb-3`}, [
1561
1573
  ["label", {class: "label", i18n: label}, t(label)],
1562
1574
  ["div", {class: "control"}, [$control]],
package/src/yui_dev.js CHANGED
@@ -31,7 +31,7 @@ import * as gobj_js from "@yuneta/gobj-js";
31
31
 
32
32
  import {log_signature, log_is_periodic} from "./dev_machine_trace.js";
33
33
 
34
- import i18next from 'i18next';
34
+ import i18next, {t} from 'i18next';
35
35
 
36
36
  /***********************************************************************
37
37
  * Traffic model (bounded ring buffer)
@@ -62,14 +62,18 @@ const TRAFFIC_TS_FIELDS = {
62
62
  };
63
63
 
64
64
  /* Trace toggles: [localStorage key, display label, handler]. */
65
+ /* `data-label` carries the i18n KEY and not the text: the chips are
66
+ * repainted from it by `refresh_dev_chrome()` on every toggle, so a
67
+ * label translated once at build time would come back in English at
68
+ * the first click. */
65
69
  const TRACE_DEFS = [
66
- ["trace_automata", "Automata", trace_automata],
67
- ["trace_creation", "Creation", trace_creation],
68
- ["trace_start_stop", "Start/Stop", trace_start_stop],
69
- ["trace_subscriptions", "Subscriptions", trace_subscriptions],
70
- ["trace_i18n", "I18n", trace_i18n],
71
- ["trace_traffic", "Traffic", trace_traffic],
72
- ["no_poll", "No Poll", set_no_poll],
70
+ ["trace_automata", "automata", trace_automata],
71
+ ["trace_creation", "creation", trace_creation],
72
+ ["trace_start_stop", "start / stop", trace_start_stop],
73
+ ["trace_subscriptions", "subscriptions", trace_subscriptions],
74
+ ["trace_i18n", "i18n", trace_i18n],
75
+ ["trace_traffic", "traffic", trace_traffic],
76
+ ["no_poll", "no poll", set_no_poll],
73
77
  ];
74
78
 
75
79
 
@@ -703,7 +707,10 @@ function traffic_bullets(obj)
703
707
  /* A small mute affordance that silences this signature (persistent). */
704
708
  function mute_button(sig)
705
709
  {
706
- return ['button', {class: 'TRAFFIC_MUTE', type: 'button', title: 'Mute ' + sig}, '⊘', {
710
+ /* `t('mute this message')` and not `'Mute ' + sig`: a composed
711
+ * title is no i18n key, and the row already says which message. */
712
+ return ['button', {class: 'TRAFFIC_MUTE', type: 'button',
713
+ title: t('mute this message'), 'data-i18n-title': 'mute this message'}, '⊘', {
707
714
  click: (ev) => {
708
715
  ev.stopPropagation();
709
716
  ev.preventDefault();
@@ -1328,7 +1335,7 @@ function refresh_dev_chrome()
1328
1335
  {
1329
1336
  document.querySelectorAll('.YDEV_CHIP[data-trace]').forEach(($b) => {
1330
1337
  let key = $b.getAttribute('data-trace');
1331
- let label = $b.getAttribute('data-label') || '';
1338
+ let label = t($b.getAttribute('data-label') || '');
1332
1339
  let v = dev_num(key, 0);
1333
1340
  $b.textContent = (key === "trace_automata" && v > 0) ? (label + " " + v) : label;
1334
1341
  $b.classList.toggle('is-active', v > 0);
@@ -1373,11 +1380,13 @@ function refresh_dev_chrome()
1373
1380
  if(set.size) {
1374
1381
  let $lbl = document.createElement('span');
1375
1382
  $lbl.className = 'YDEV_LABEL';
1376
- $lbl.textContent = 'Muted';
1383
+ $lbl.textContent = t('muted');
1384
+ $lbl.setAttribute('data-i18n', 'muted');
1377
1385
  $m.appendChild($lbl);
1378
1386
  set.forEach((sig) => {
1379
1387
  $m.appendChild(createElement2(
1380
- ['button', {class: 'YDEV_MUTED_CHIP', type: 'button', title: 'Unmute'},
1388
+ ['button', {class: 'YDEV_MUTED_CHIP', type: 'button',
1389
+ title: t('unmute'), 'data-i18n-title': 'unmute'},
1381
1390
  '⊘ ' + sig + ' ✕', {
1382
1391
  click: (ev) => {
1383
1392
  ev.stopPropagation();
@@ -1457,9 +1466,10 @@ function dev_fallback_copy(text)
1457
1466
  * periodic filters, free-text search, copy, clear. Returns an element. */
1458
1467
  function build_control_bar()
1459
1468
  {
1460
- let trace_chips = TRACE_DEFS.map(([key, label, fn]) => ['button', {
1461
- class: 'YDEV_CHIP', 'data-trace': key, 'data-label': label, type: 'button',
1462
- }, label, {
1469
+ let trace_chips = TRACE_DEFS.map(([key, label_key, fn]) => ['button', {
1470
+ class: 'YDEV_CHIP', 'data-trace': key, 'data-label': label_key,
1471
+ 'data-i18n': label_key, type: 'button',
1472
+ }, t(label_key), {
1463
1473
  click: (ev) => {
1464
1474
  ev.stopPropagation();
1465
1475
  fn();
@@ -1471,10 +1481,9 @@ function build_control_bar()
1471
1481
  * emitted while Automata is on. */
1472
1482
  let simple_mach = ['button', {
1473
1483
  class: 'YDEV_CHIP', 'data-toggle': 'automata-simple', type: 'button',
1474
- title: 'Machine trace shape. On (default): one line per transition, ' +
1475
- 'event first, like the C kernel. Off: the legacy three-line shape ' +
1476
- '(the call, the state change and the return)',
1477
- }, 'Simple mach', {
1484
+ title: t('machine trace shape'), 'data-i18n-title': 'machine trace shape',
1485
+ 'data-i18n': 'simple mach',
1486
+ }, t('simple mach'), {
1478
1487
  click: (ev) => {
1479
1488
  ev.stopPropagation();
1480
1489
  let v = dev_simple_mach() ? 0 : 1;
@@ -1484,7 +1493,8 @@ function build_control_bar()
1484
1493
  }
1485
1494
  }];
1486
1495
 
1487
- let mk_view = (v, label) => ['button', {class: 'YDEV_SEG_BTN', 'data-view': v, type: 'button'}, label, {
1496
+ let mk_view = (v, label) => ['button', {class: 'YDEV_SEG_BTN', 'data-view': v,
1497
+ 'data-i18n': label, type: 'button'}, t(label), {
1488
1498
  click: (ev) => {
1489
1499
  ev.stopPropagation();
1490
1500
  set_view(v);
@@ -1492,53 +1502,62 @@ function build_control_bar()
1492
1502
  }];
1493
1503
 
1494
1504
  let view_seg = ['div', {class: 'YDEV_SEG', id: 'ydev-seg'}, [
1495
- mk_view('detailed', 'Detailed'),
1496
- mk_view('full', 'Expanded'),
1497
- mk_view('compact', 'Compact'),
1498
- mk_view('name', 'Name only'),
1505
+ mk_view('detailed', 'detailed'),
1506
+ mk_view('full', 'expanded'),
1507
+ mk_view('compact', 'compact'),
1508
+ mk_view('name', 'name only'),
1499
1509
  ]];
1500
1510
 
1501
1511
  /* Output routing: send traffic + all logs + automata to the dev window,
1502
1512
  * the browser console, or both. */
1503
1513
  let OUT_TITLES = {
1504
- window: 'Dev window only (browser console stays clean)',
1505
- console: 'Browser console only (nothing shown in this window)',
1506
- both: 'Dev window and browser console',
1514
+ window: 'dev window only',
1515
+ console: 'browser console only',
1516
+ both: 'dev window and browser console',
1507
1517
  };
1508
1518
  let mk_out = (v, label) => ['button', {
1509
- class: 'YDEV_SEG_BTN', 'data-output': v, type: 'button', title: OUT_TITLES[v],
1510
- }, label, {
1519
+ class: 'YDEV_SEG_BTN', 'data-output': v, type: 'button',
1520
+ title: t(OUT_TITLES[v]), 'data-i18n-title': OUT_TITLES[v],
1521
+ 'data-i18n': label,
1522
+ }, t(label), {
1511
1523
  click: (ev) => {
1512
1524
  ev.stopPropagation();
1513
1525
  set_output_route(v);
1514
1526
  }
1515
1527
  }];
1516
1528
  let output_seg = ['div', {class: 'YDEV_SEG', id: 'ydev-output'}, [
1517
- mk_out('window', 'Window'),
1518
- mk_out('console', 'Console'),
1519
- mk_out('both', 'Both'),
1529
+ mk_out('window', 'window'),
1530
+ mk_out('console', 'console'),
1531
+ mk_out('both', 'both'),
1520
1532
  ]];
1521
1533
 
1522
1534
  /* Expanded-view section toggles (only meaningful in the 'full' view;
1523
1535
  * the group is shown/hidden by refresh_dev_chrome). */
1536
+ /* The title says WHAT it does and not which section: composing
1537
+ * `'Show ' + label + '...'` gives a string that is no i18n key, so
1538
+ * it could never re-translate -- and the button's own label is the
1539
+ * section anyway. */
1524
1540
  let mk_expand = (key, label) => ['button', {
1525
1541
  class: 'YDEV_CHIP', 'data-expand': key, type: 'button',
1526
- title: 'Show ' + label + ' in the Expanded view',
1527
- }, label, {
1542
+ title: t('show this section in the expanded view'),
1543
+ 'data-i18n-title': 'show this section in the expanded view',
1544
+ 'data-i18n': label,
1545
+ }, t(label), {
1528
1546
  click: (ev) => {
1529
1547
  ev.stopPropagation();
1530
1548
  toggle_pref(key, (key === 'dev_full_data') ? 1 : 0);
1531
1549
  }
1532
1550
  }];
1533
1551
  let expand_grp = ['div', {class: 'YDEV_GROUP', id: 'ydev-expand-grp'}, [
1534
- ['span', {class: 'YDEV_LABEL'}, 'Expand'],
1535
- mk_expand('dev_full_schema', 'Schema'),
1536
- mk_expand('dev_full_data', 'Data'),
1537
- mk_expand('dev_full_meta', 'Metadata'),
1552
+ ['span', {class: 'YDEV_LABEL', 'data-i18n': 'expand'}, t('expand')],
1553
+ mk_expand('dev_full_schema', 'schema'),
1554
+ mk_expand('dev_full_data', 'data'),
1555
+ mk_expand('dev_full_meta', 'metadata'),
1538
1556
  ]];
1539
1557
 
1540
1558
  let mk_dir = (dir, glyph, key, title) => ['button', {
1541
- class: 'YDEV_CHIP s-' + dir, 'data-dir': key, type: 'button', title: title,
1559
+ class: 'YDEV_CHIP s-' + dir, 'data-dir': key, type: 'button',
1560
+ title: t(title), 'data-i18n-title': title,
1542
1561
  }, glyph, {
1543
1562
  click: (ev) => {
1544
1563
  ev.stopPropagation();
@@ -1547,16 +1566,23 @@ function build_control_bar()
1547
1566
  }];
1548
1567
 
1549
1568
  let dir_chips = [
1550
- mk_dir('out', '⇢', 'dev_filter_out', 'Outgoing'),
1551
- mk_dir('in', '⇠', 'dev_filter_in', 'Incoming'),
1552
- mk_dir('err', '⚠', 'dev_filter_err', 'Errors'),
1569
+ mk_dir('out', '⇢', 'dev_filter_out', 'outgoing'),
1570
+ mk_dir('in', '⇠', 'dev_filter_in', 'incoming'),
1571
+ mk_dir('err', '⚠', 'dev_filter_err', 'errors'),
1553
1572
  ];
1554
1573
 
1555
1574
  let periodic_chip = ['button', {
1556
1575
  class: 'YDEV_CHIP', 'data-toggle': 'periodic', type: 'button',
1557
- title: 'Hide the timers: EV_TIMEOUT / PERIODIC / HEARTBEAT / PING ' +
1558
- 'transitions, and recurring traffic. On by default',
1559
- }, '⊘ Periodic', {
1576
+ title: t('hide the timers and the recurring traffic'),
1577
+ 'data-i18n-title': 'hide the timers and the recurring traffic',
1578
+ }, [
1579
+ /* The glyph is its own element so the label beside it can carry
1580
+ * its key: `refresh_language()` replaces the FIRST text node of
1581
+ * the element that carries `data-i18n`, and that would have
1582
+ * eaten the glyph with the word. */
1583
+ ['span', {class: 'YDEV_GLYPH'}, '⊘'],
1584
+ ['span', {'data-i18n': 'periodic'}, t('periodic')]
1585
+ ], {
1560
1586
  click: (ev) => {
1561
1587
  ev.stopPropagation();
1562
1588
  toggle_pref('dev_hide_periodic', HIDE_PERIODIC_DEFAULT);
@@ -1564,7 +1590,9 @@ function build_control_bar()
1564
1590
  }];
1565
1591
 
1566
1592
  let search = ['input', {
1567
- class: 'YDEV_SEARCH', type: 'search', placeholder: 'filter events / payload…', 'data-role': 'search',
1593
+ class: 'YDEV_SEARCH', type: 'search', 'data-role': 'search',
1594
+ placeholder: t('filter events / payload'),
1595
+ 'data-i18n-placeholder': 'filter events / payload',
1568
1596
  }, '', {
1569
1597
  input: (ev) => {
1570
1598
  SEARCH_TEXT = String(ev.target.value || '').toLowerCase().trim();
@@ -1572,35 +1600,42 @@ function build_control_bar()
1572
1600
  }
1573
1601
  }];
1574
1602
 
1575
- let copy = ['button', {class: 'YDEV_CHIP', type: 'button', title: 'Copy visible traffic to clipboard'}, 'Copy', {
1603
+ let copy = ['button', {class: 'YDEV_CHIP', type: 'button',
1604
+ title: t('copy visible traffic to clipboard'),
1605
+ 'data-i18n-title': 'copy visible traffic to clipboard',
1606
+ 'data-i18n': 'copy'}, t('copy'), {
1576
1607
  click: (ev) => {
1577
1608
  ev.stopPropagation();
1578
1609
  let btn = ev.currentTarget;
1579
1610
  dev_copy_text(traffic_to_text()).then(() => {
1580
1611
  let prev = btn.textContent;
1581
- btn.textContent = 'Copied';
1612
+ btn.textContent = t('copied');
1582
1613
  setTimeout(() => { btn.textContent = prev; }, 1000);
1583
1614
  });
1584
1615
  }
1585
1616
  }];
1586
1617
 
1587
- let clear = ['button', {class: 'YDEV_CHIP', type: 'button', title: 'Clear captured traffic'}, 'Clear', {
1618
+ let clear = ['button', {class: 'YDEV_CHIP', type: 'button',
1619
+ title: t('clear captured traffic'),
1620
+ 'data-i18n-title': 'clear captured traffic',
1621
+ 'data-i18n': 'clear'}, t('clear'), {
1588
1622
  click: (ev) => {
1589
1623
  ev.stopPropagation();
1590
1624
  clear_traffic();
1591
1625
  }
1592
1626
  }];
1593
1627
 
1594
- let grp = (label, items) => ['div', {class: 'YDEV_GROUP'}, [['span', {class: 'YDEV_LABEL'}, label], ...items]];
1628
+ let grp = (label, items) => ['div', {class: 'YDEV_GROUP'},
1629
+ [['span', {class: 'YDEV_LABEL', 'data-i18n': label}, t(label)], ...items]];
1595
1630
  let sep = () => ['span', {class: 'YDEV_SEP'}, ''];
1596
1631
 
1597
1632
  return createElement2(['div', {class: 'YDEV_BAR'}, [
1598
- grp('Traces', [...trace_chips, simple_mach]), sep(),
1599
- grp('Output', [output_seg]), sep(),
1600
- grp('View', [view_seg]), expand_grp, sep(),
1601
- grp('Show', [...dir_chips, periodic_chip]), sep(),
1602
- grp('Find', [search]), sep(),
1603
- grp('Log', [copy, clear]),
1633
+ grp('traces', [...trace_chips, simple_mach]), sep(),
1634
+ grp('output', [output_seg]), sep(),
1635
+ grp('view', [view_seg]), expand_grp, sep(),
1636
+ grp('show', [...dir_chips, periodic_chip]), sep(),
1637
+ grp('find', [search]), sep(),
1638
+ grp('log', [copy, clear]),
1604
1639
  ]]);
1605
1640
  }
1606
1641
 
@@ -1608,8 +1643,9 @@ function build_control_bar()
1608
1643
  function build_title_header()
1609
1644
  {
1610
1645
  return createElement2(['div', {class: 'YDEV_TITLE'}, [
1611
- ['span', {class: 'YDEV_TITLE_MAIN'}, 'Developer'],
1612
- ['span', {class: 'YDEV_TITLE_SUB'}, 'yuno monitor · traffic & traces'],
1646
+ ['span', {class: 'YDEV_TITLE_MAIN', 'data-i18n': 'developer'}, t('developer')],
1647
+ ['span', {class: 'YDEV_TITLE_SUB', 'data-i18n': 'yuno monitor'},
1648
+ t('yuno monitor')],
1613
1649
  ]]);
1614
1650
  }
1615
1651
 
@@ -1710,7 +1746,7 @@ function setup_dev(self, show)
1710
1746
  showFooter: false,
1711
1747
  auto_save_size_and_position: true,
1712
1748
  center: false,
1713
- title: "Developer",
1749
+ title: "developer",
1714
1750
  icon: "yi-terminal",
1715
1751
  /* Opt into the dock/taskbar if the app provides one. `|| null`
1716
1752
  * because gobj_find_service returns undefined when absent, and