@agimon-ai/po-remote 0.0.0-alpha.195 → 0.0.0-alpha.197

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.
@@ -1,4 +1,4 @@
1
- import { defineFill, defineSettingsPanel, defineWebLifecycle, defineWebPlugin, hostRevisionTopic, subscribeHubRevision } from "@agimon-ai/po-core/web";
1
+ import { defineFill, defineSettingsPanel, defineWebLifecycle, defineWebPlugin, hostRevisionTopic, subscribeHubRevision, t, useLocale, useT } from "@agimon-ai/po-core/web";
2
2
  import { AlertIcon, Badge, Button, CheckIcon, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Dot, Input, OptionRow, QrCode, RadioGroup, RadioGroupCard, SectionLabel, SettingsActions, SettingsCard, SettingsDescription, SettingsField, SettingsNote, SettingsRow, SettingsRowDescription, SettingsRowText, SettingsRowTitle, SettingsSection, SettingsSectionDescription, SettingsSectionHeader, SettingsSectionTitle, ShieldIcon, Skeleton, Spinner, Switch, Tabs, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipTrigger } from "@agimon-ai/po-web-components";
3
3
  import { useStore } from "@tanstack/react-store";
4
4
  import { browserTransport, fetchWithStepUp, passkeysAvailable, registerPasskey } from "@agimon-ai/po-web-security/browser";
@@ -27,7 +27,6 @@ const TRUSTED_DEVICES_ROUTE = `${REMOTE_API_ROUTE}/trusted-devices`;
27
27
  const NATIVE_PAIRING_LINK_PREFIX = "po://pair?link=";
28
28
  //#endregion
29
29
  //#region src/extensions/(frontend)/_lib/remoteApi.ts
30
- const UNREACHABLE$1 = "The cockpit hub is unreachable.";
31
30
  const JSON_HEADERS$1 = { "Content-Type": "application/json" };
32
31
  function isRecord$1(value) {
33
32
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -42,7 +41,7 @@ async function request(input, init, pick, send = (target, options) => browserTra
42
41
  try {
43
42
  response = await send(input, init);
44
43
  } catch {
45
- return { error: UNREACHABLE$1 };
44
+ return { error: t("remote.ui.hubUnreachable", "The cockpit hub is unreachable.") };
46
45
  }
47
46
  let body;
48
47
  try {
@@ -55,7 +54,7 @@ async function request(input, init, pick, send = (target, options) => browserTra
55
54
  if (picked !== void 0) return picked;
56
55
  }
57
56
  if (isRecord$1(body) && typeof body.error === "string") return { error: body.error };
58
- return { error: `The hub answered ${String(response.status)}.` };
57
+ return { error: t("remote.ui.hubStatus", "The hub answered {status}.", { status: response.status }) };
59
58
  }
60
59
  function pickState(body) {
61
60
  return isRecord$1(body.state) ? { state: body.state } : void 0;
@@ -369,7 +368,7 @@ async function advanceRelaySetup() {
369
368
  if (!relay.active) {
370
369
  const outcome = await enablePrivateRelay();
371
370
  if ("error" in outcome || outcome.state.status !== "on") {
372
- connectionError("relay", "error" in outcome ? outcome.error : "Po Cloud did not admit this computer.");
371
+ connectionError("relay", "error" in outcome ? outcome.error : t("remote.ui.notAdmitted", "Po Cloud did not admit this computer."));
373
372
  return;
374
373
  }
375
374
  connectionState("relay", outcome.state);
@@ -566,6 +565,7 @@ async function updateRemoteSettings(patch) {
566
565
  * access permanent.
567
566
  */
568
567
  function PairingApprovalDialog() {
568
+ const t = useT();
569
569
  const state = useStore(remoteAccessStore);
570
570
  const relayRequest = state.relayView?.pending?.[0];
571
571
  const request = relayRequest ?? state.view?.pending?.[0];
@@ -580,10 +580,10 @@ function PairingApprovalDialog() {
580
580
  children: [
581
581
  /* @__PURE__ */ jsxs(DialogHeader, {
582
582
  className: "flex-col items-start",
583
- children: [/* @__PURE__ */ jsx(DialogTitle, { children: "Pair this device?" }), /* @__PURE__ */ jsxs(DialogDescription, { children: [
584
- route === "relay" ? "This device is pairing through the private relay." : route === "tunnel" ? "This device is pairing through the public tunnel." : "Something scanned your code.",
583
+ children: [/* @__PURE__ */ jsx(DialogTitle, { children: t("remote.ui.pairThisDevice", "Pair this device?") }), /* @__PURE__ */ jsxs(DialogDescription, { children: [
584
+ route === "relay" ? t("remote.ui.thisDeviceIsPairingThroughThePrivateRelay", "This device is pairing through the private relay.") : route === "tunnel" ? t("remote.ui.thisDeviceIsPairingThroughThePublicTunnel", "This device is pairing through the public tunnel.") : t("remote.ui.somethingScannedYourCode", "Something scanned your code."),
585
585
  " ",
586
- "Approve it only if it is the device in your hand."
586
+ t("remote.ui.approveItOnlyIfItIsTheDeviceInYourHand", "Approve it only if it is the device in your hand.")
587
587
  ] })]
588
588
  }),
589
589
  /* @__PURE__ */ jsxs(DialogBody, {
@@ -594,18 +594,18 @@ function PairingApprovalDialog() {
594
594
  className: "break-words text-base text-po-text",
595
595
  children: request.userAgent
596
596
  }),
597
- /* @__PURE__ */ jsxs("p", {
597
+ /* @__PURE__ */ jsx("p", {
598
598
  className: "text-sm text-po-dim",
599
- children: ["Address reported by the edge: ", request.edgeIp]
599
+ children: t("remote.ui.edgeAddress", "Address reported by the edge: {address}", { address: request.edgeIp })
600
600
  }),
601
601
  /* @__PURE__ */ jsx("p", {
602
602
  className: "text-sm text-po-dim",
603
- children: "Approving grants the same access you have here, including running shell commands."
603
+ children: t("remote.ui.approvingGrantsTheSameAccessYouHaveHereIncludingRunningShellCommands", "Approving grants the same access you have here, including running shell commands.")
604
604
  }),
605
605
  state.busy ? /* @__PURE__ */ jsx("p", {
606
606
  role: "status",
607
607
  className: "text-sm text-po-dim",
608
- children: "Waiting for the current remote access action."
608
+ children: t("remote.ui.waitingForTheCurrentRemoteAccessAction", "Waiting for the current remote access action.")
609
609
  }) : null,
610
610
  error ? /* @__PURE__ */ jsx("p", {
611
611
  role: "alert",
@@ -621,13 +621,13 @@ function PairingApprovalDialog() {
621
621
  "data-testid": "pairing-deny",
622
622
  disabled: state.busy,
623
623
  onClick: () => void denyDevice(request.id, route),
624
- children: "Deny"
624
+ children: t("remote.ui.deny", "Deny")
625
625
  }), /* @__PURE__ */ jsx(Button, {
626
626
  variant: "primary",
627
627
  "data-testid": "pairing-approve",
628
628
  disabled: state.busy,
629
629
  onClick: () => void approveDevice(request.id, route),
630
- children: "Approve"
630
+ children: t("remote.ui.approve", "Approve")
631
631
  })]
632
632
  })
633
633
  ]
@@ -650,6 +650,7 @@ var PairingApproval_overlay_web_default = defineFill({ component: PairingApprova
650
650
  * spot is read before paint; a spot this fill does not know draws nothing.
651
651
  */
652
652
  function RemoteRailStatus() {
653
+ const t = useT();
653
654
  const marker = useRef(null);
654
655
  const [spot, setSpot] = useState();
655
656
  useLayoutEffect(() => {
@@ -661,10 +662,16 @@ function RemoteRailStatus() {
661
662
  const deviceCount = (view?.devices.length ?? 0) + (relayView?.devices.length ?? 0);
662
663
  const host = !independent && view?.publicUrl !== void 0 ? new URL(view.publicUrl).host : void 0;
663
664
  const live = status === "on" || status === "starting";
664
- const devices = independent ? `${String(deviceCount)} session${deviceCount === 1 ? "" : "s"}` : `${String(deviceCount)} device${deviceCount === 1 ? "" : "s"}`;
665
- const failure = relayView?.status === "failed" && view?.status !== "failed" ? `Private relay failed: ${relayView.error ?? "the relay stopped"}` : `Remote access failed: ${view?.error ?? "the tunnel stopped"}`;
665
+ const devices = independent ? deviceCount === 1 ? t("remote.ui.oneSession", "{count} session", { count: deviceCount }) : t("remote.ui.sessions", "{count} sessions", { count: deviceCount }) : deviceCount === 1 ? t("remote.ui.oneDevice", "{count} device", { count: deviceCount }) : t("remote.ui.devices", "{count} devices", { count: deviceCount });
666
+ const failure = relayView?.status === "failed" && view?.status !== "failed" ? t("remote.ui.relayFailed", "Private relay failed: {error}", { error: relayView.error ?? t("remote.ui.theRelayStopped", "the relay stopped") }) : t("remote.ui.accessFailed", "Remote access failed: {error}", { error: view?.error ?? t("remote.ui.theTunnelStopped", "the tunnel stopped") });
667
+ const statusText = {
668
+ on: t("remote.ui.accessOn", "Remote access is on"),
669
+ starting: t("remote.ui.accessStarting", "Remote access is starting"),
670
+ failed: t("remote.ui.accessHasFailed", "Remote access is failed"),
671
+ off: t("remote.ui.accessOff", "Remote access is off")
672
+ }[status];
666
673
  const banner = status === "off" ? null : status === "failed" ? "red" : "yellow";
667
- const remoteDetail = status === "on" ? `Remote access on, ${devices} paired` : void 0;
674
+ const remoteDetail = status === "on" ? t("remote.ui.onPaired", "Remote access on, {devices} paired", { devices }) : void 0;
668
675
  if (spot === void 0) return /* @__PURE__ */ jsx("span", {
669
676
  ref: marker,
670
677
  hidden: true
@@ -677,21 +684,21 @@ function RemoteRailStatus() {
677
684
  /* @__PURE__ */ jsx(Dot, { tone: banner }),
678
685
  /* @__PURE__ */ jsx("span", {
679
686
  className: "min-w-0 flex-1 truncate",
680
- children: status === "failed" ? failure : `Remote access ${status === "starting" ? "starting" : "on"}${host === void 0 ? "" : ` · ${host}`} · ${devices}`
687
+ children: status === "failed" ? failure : `${status === "starting" ? t("remote.ui.bannerStarting", "Remote access starting") : t("remote.ui.bannerOn", "Remote access on")}${host === void 0 ? "" : ` · ${host}`} · ${devices}`
681
688
  }),
682
689
  /* @__PURE__ */ jsx(Button, {
683
690
  variant: "ghost",
684
691
  size: "xs",
685
692
  "data-testid": "remote-banner-open",
686
693
  onClick: openRemoteDialog,
687
- children: "Manage"
694
+ children: t("remote.ui.manage", "Manage")
688
695
  }),
689
696
  /* @__PURE__ */ jsx(Button, {
690
697
  variant: "ghost",
691
698
  size: "xs",
692
699
  "data-testid": "remote-banner-off",
693
700
  onClick: () => void turnRemoteAccessOff(),
694
- children: onCount > 1 ? "Turn both off" : "Turn off"
701
+ children: onCount > 1 ? t("remote.ui.turnBothOff", "Turn both off") : t("remote.ui.turnOff", "Turn off")
695
702
  })
696
703
  ]
697
704
  }),
@@ -702,7 +709,11 @@ function RemoteRailStatus() {
702
709
  className: "flex min-w-0 items-center gap-2",
703
710
  children: [/* @__PURE__ */ jsx(Dot, { tone: banner }), /* @__PURE__ */ jsx("span", {
704
711
  className: "truncate",
705
- children: status === "failed" ? failure : `Remote access is ${status === "starting" ? "starting" : "on"}${host === void 0 ? "" : ` · ${host}`} · ${devices} paired`
712
+ children: status === "failed" ? failure : t("remote.ui.bannerPaired", "{status}{host} · {devices} paired", {
713
+ status: statusText,
714
+ host: host === void 0 ? "" : ` · ${host}`,
715
+ devices
716
+ })
706
717
  })]
707
718
  }), /* @__PURE__ */ jsxs("span", {
708
719
  className: "flex items-center justify-end gap-1",
@@ -711,13 +722,13 @@ function RemoteRailStatus() {
711
722
  size: "sm",
712
723
  "data-testid": "remote-banner-open",
713
724
  onClick: openRemoteDialog,
714
- children: "Manage"
725
+ children: t("remote.ui.manage", "Manage")
715
726
  }), /* @__PURE__ */ jsx(Button, {
716
727
  variant: "ghost",
717
728
  size: "sm",
718
729
  "data-testid": "remote-banner-off",
719
730
  onClick: () => void turnRemoteAccessOff(),
720
- children: onCount > 1 ? "Turn both off" : "Turn off"
731
+ children: onCount > 1 ? t("remote.ui.turnBothOff", "Turn both off") : t("remote.ui.turnOff", "Turn off")
721
732
  })]
722
733
  })]
723
734
  }),
@@ -725,7 +736,7 @@ function RemoteRailStatus() {
725
736
  variant: "ghost",
726
737
  size: "md",
727
738
  "data-testid": "remote-access-open",
728
- "aria-label": `Remote access is ${status}`,
739
+ "aria-label": statusText,
729
740
  onClick: openRemoteDialog,
730
741
  className: `h-9 w-full justify-start gap-3 rounded-lg border-0 px-2.5 text-base font-medium outline-none hover:bg-po-panel/50 focus-visible:ring-2 focus-visible:ring-po-green/50 ${status === "failed" ? "text-po-red" : "text-po-text"}`,
731
742
  children: [
@@ -738,7 +749,7 @@ function RemoteRailStatus() {
738
749
  }),
739
750
  /* @__PURE__ */ jsx("span", {
740
751
  className: "flex-1 text-left",
741
- children: "Remote access"
752
+ children: t("remote.ui.remoteAccess", "Remote access")
742
753
  }),
743
754
  live ? /* @__PURE__ */ jsxs("span", {
744
755
  className: "flex items-center gap-1.5 text-sm font-normal text-po-dim",
@@ -746,10 +757,10 @@ function RemoteRailStatus() {
746
757
  tone: "yellow",
747
758
  pulse: true,
748
759
  "data-testid": "remote-access-live"
749
- }), status === "starting" ? "Starting" : devices]
760
+ }), status === "starting" ? t("remote.ui.starting", "Starting") : devices]
750
761
  }) : /* @__PURE__ */ jsx("span", {
751
762
  className: "text-sm font-normal text-po-faint",
752
- children: status === "failed" ? "Failed" : "Off"
763
+ children: status === "failed" ? t("remote.ui.failed", "Failed") : t("remote.ui.off", "Off")
753
764
  })
754
765
  ]
755
766
  }),
@@ -757,21 +768,21 @@ function RemoteRailStatus() {
757
768
  variant: status === "failed" ? "danger-outline" : "outline",
758
769
  size: "md",
759
770
  "data-testid": "remote-access-open",
760
- title: remoteDetail ?? "Remote access",
761
- "aria-label": remoteDetail ?? `Remote access is ${status}`,
771
+ title: remoteDetail ?? t("remote.ui.remoteAccess", "Remote access"),
772
+ "aria-label": remoteDetail ?? statusText,
762
773
  onClick: openRemoteDialog,
763
774
  className: `gap-1.5 rounded-md ${status === "failed" ? "" : "bg-po-panel"}`,
764
775
  children: [live ? /* @__PURE__ */ jsx(Dot, {
765
776
  tone: "yellow",
766
777
  pulse: true,
767
778
  "data-testid": "remote-access-live"
768
- }) : /* @__PURE__ */ jsx(ShieldIcon, { className: "size-4" }), "Remote access"]
779
+ }) : /* @__PURE__ */ jsx(ShieldIcon, { className: "size-4" }), t("remote.ui.remoteAccess", "Remote access")]
769
780
  }),
770
781
  spot !== "desktop-action" ? null : /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
771
782
  asChild: true,
772
783
  children: /* @__PURE__ */ jsx("button", {
773
784
  type: "button",
774
- "aria-label": status === "on" ? "Remote access is on" : "Remote access",
785
+ "aria-label": status === "on" ? t("remote.ui.remoteAccessIsOn", "Remote access is on") : t("remote.ui.remoteAccess", "Remote access"),
775
786
  "data-testid": "desktop-remote",
776
787
  onClick: openRemoteDialog,
777
788
  className: `relative grid size-10 shrink-0 place-items-center rounded-xl focus-visible:ring-2 focus-visible:ring-po-green focus-visible:outline-none ${status === "on" ? "bg-po-panel text-po-hi shadow-sm" : "text-po-dim hover:bg-po-panel/70"}`,
@@ -783,7 +794,7 @@ function RemoteRailStatus() {
783
794
  }), /* @__PURE__ */ jsx(TooltipContent, {
784
795
  side: "top",
785
796
  sideOffset: 8,
786
- children: status === "on" ? "Remote access is on" : "Remote access"
797
+ children: status === "on" ? t("remote.ui.remoteAccessIsOn", "Remote access is on") : t("remote.ui.remoteAccess", "Remote access")
787
798
  })] })
788
799
  ] });
789
800
  }
@@ -810,7 +821,6 @@ const DEV_PROXY_PREFIX = "/devproxy/";
810
821
  * proxied dev site itself is the deliberate exception, and it never comes
811
822
  * through here, because the browser fetches those bytes on its own.
812
823
  */
813
- const UNREACHABLE = "The cockpit hub is unreachable.";
814
824
  const JSON_HEADERS = { "Content-Type": "application/json" };
815
825
  const NO_CONTENT = 204;
816
826
  function isRecord(value) {
@@ -821,18 +831,18 @@ async function readError(response) {
821
831
  const body = await response.json();
822
832
  if (isRecord(body) && typeof body.error === "string") return body.error;
823
833
  } catch {}
824
- return `The hub answered ${String(response.status)}.`;
834
+ return t("remote.ui.hubStatus", "The hub answered {status}.", { status: response.status });
825
835
  }
826
836
  async function fetchDevProxyTargets() {
827
837
  let response;
828
838
  try {
829
839
  response = await browserTransport.fetch(DEV_PROXY_TARGETS_ROUTE);
830
840
  } catch {
831
- return { error: UNREACHABLE };
841
+ return { error: t("remote.ui.hubUnreachable", "The cockpit hub is unreachable.") };
832
842
  }
833
843
  if (!response.ok) return { error: await readError(response) };
834
844
  const body = await response.json().catch(() => void 0);
835
- if (!isRecord(body) || !Array.isArray(body.targets)) return { error: "The hub sent no dev proxy targets." };
845
+ if (!isRecord(body) || !Array.isArray(body.targets)) return { error: t("remote.ui.noDevTargets", "The hub sent no dev proxy targets.") };
836
846
  return { state: {
837
847
  targets: body.targets,
838
848
  canRegister: body.canRegister === true
@@ -850,11 +860,11 @@ async function addDevProxyTarget(name, port) {
850
860
  })
851
861
  });
852
862
  } catch {
853
- return { error: UNREACHABLE };
863
+ return { error: t("remote.ui.hubUnreachable", "The cockpit hub is unreachable.") };
854
864
  }
855
865
  if (!response.ok) return { error: await readError(response) };
856
866
  const body = await response.json().catch(() => void 0);
857
- if (!isRecord(body) || !isRecord(body.target)) return { error: "The hub did not confirm the target." };
867
+ if (!isRecord(body) || !isRecord(body.target)) return { error: t("remote.ui.targetNotConfirmed", "The hub did not confirm the target.") };
858
868
  return { target: body.target };
859
869
  }
860
870
  async function removeDevProxyTarget(name) {
@@ -862,7 +872,7 @@ async function removeDevProxyTarget(name) {
862
872
  try {
863
873
  response = await browserTransport.fetch(`${DEV_PROXY_TARGETS_ROUTE}/${encodeURIComponent(name)}`, { method: "DELETE" });
864
874
  } catch {
865
- return { error: UNREACHABLE };
875
+ return { error: t("remote.ui.hubUnreachable", "The cockpit hub is unreachable.") };
866
876
  }
867
877
  if (response.status !== NO_CONTENT && !response.ok) return { error: await readError(response) };
868
878
  return { ok: true };
@@ -968,6 +978,7 @@ function useUiState(key, initial) {
968
978
  * reason rather than rendered as a button that would be refused.
969
979
  */
970
980
  function DevProxyTargets() {
981
+ const t = useT();
971
982
  const state = useStore(devProxyStore);
972
983
  const [name, setName] = useUiState("dev-proxy/name", "");
973
984
  const [port, setPort] = useUiState("dev-proxy/port", "");
@@ -983,10 +994,10 @@ function DevProxyTargets() {
983
994
  return /* @__PURE__ */ jsxs("div", {
984
995
  className: "flex w-full flex-col gap-1.5",
985
996
  children: [
986
- /* @__PURE__ */ jsx(SectionLabel, { children: "dev sites" }),
997
+ /* @__PURE__ */ jsx(SectionLabel, { children: t("remote.ui.devSites", "dev sites") }),
987
998
  /* @__PURE__ */ jsx("span", {
988
999
  className: "text-sm text-po-dim",
989
- children: "Reach a local dev server from a paired device, on this same address."
1000
+ children: t("remote.ui.reachALocalDevServerFromAPairedDeviceOnThisSameAddress", "Reach a local dev server from a paired device, on this same address.")
990
1001
  }),
991
1002
  state.targets.map((target) => /* @__PURE__ */ jsxs("div", {
992
1003
  "data-testid": `dev-proxy-target-${target.name}`,
@@ -1004,38 +1015,34 @@ function DevProxyTargets() {
1004
1015
  target.name,
1005
1016
  "/"
1006
1017
  ]
1007
- }), /* @__PURE__ */ jsxs("span", {
1018
+ }), /* @__PURE__ */ jsx("span", {
1008
1019
  className: "truncate text-sm text-po-dim",
1009
- children: [
1010
- "port ",
1011
- target.port,
1012
- " · set base: '",
1013
- DEV_PROXY_PREFIX,
1014
- target.name,
1015
- "/' in the dev server"
1016
- ]
1020
+ children: t("remote.ui.devTargetHint", "port {port} · set base: '{base}' in the dev server", {
1021
+ port: target.port,
1022
+ base: `${DEV_PROXY_PREFIX}${target.name}/`
1023
+ })
1017
1024
  })]
1018
1025
  }), state.canRegister ? /* @__PURE__ */ jsx(Button, {
1019
1026
  variant: "ghost",
1020
1027
  size: "sm",
1021
1028
  "data-testid": `dev-proxy-remove-${target.name}`,
1022
1029
  onClick: () => void deleteDevProxyTarget(target.name),
1023
- children: "Remove"
1030
+ children: t("remote.ui.remove", "Remove")
1024
1031
  }) : null]
1025
1032
  }, target.name)),
1026
1033
  state.canRegister ? /* @__PURE__ */ jsxs("div", {
1027
1034
  className: "flex items-center gap-2",
1028
1035
  children: [
1029
1036
  /* @__PURE__ */ jsx(Input, {
1030
- "aria-label": "dev site name",
1037
+ "aria-label": t("remote.ui.devSiteName", "dev site name"),
1031
1038
  "data-testid": "dev-proxy-name",
1032
- placeholder: "storefront",
1039
+ placeholder: t("remote.ui.storefront", "storefront"),
1033
1040
  className: "min-w-0 flex-1",
1034
1041
  value: name,
1035
1042
  onChange: (event) => setName(event.target.value)
1036
1043
  }),
1037
1044
  /* @__PURE__ */ jsx(Input, {
1038
- "aria-label": "dev site port",
1045
+ "aria-label": t("remote.ui.devSitePort", "dev site port"),
1039
1046
  "data-testid": "dev-proxy-port",
1040
1047
  type: "number",
1041
1048
  min: 1,
@@ -1051,12 +1058,12 @@ function DevProxyTargets() {
1051
1058
  "data-testid": "dev-proxy-add",
1052
1059
  disabled: state.busy || name.trim() === "" || port === "",
1053
1060
  onClick: () => void submit(),
1054
- children: "Add"
1061
+ children: t("remote.ui.add", "Add")
1055
1062
  })
1056
1063
  ]
1057
1064
  }) : /* @__PURE__ */ jsx("span", {
1058
1065
  className: "text-sm text-po-dim",
1059
- children: "Add a dev site on the host. A paired device can open the ones already listed, but not name new ones."
1066
+ children: t("remote.ui.addADevSiteOnTheHostAPairedDeviceCanOpenTheOnesAlreadyListedButNotNameNewOnes", "Add a dev site on the host. A paired device can open the ones already listed, but not name new ones.")
1060
1067
  }),
1061
1068
  state.error === void 0 ? null : /* @__PURE__ */ jsx("span", {
1062
1069
  "data-testid": "dev-proxy-error",
@@ -1070,19 +1077,20 @@ function DevProxyTargets() {
1070
1077
  //#region src/extensions/(frontend)/_components/PairedDeviceList.tsx
1071
1078
  /** Every device currently holding a session, with the one way to take it back. */
1072
1079
  function PairedDeviceList({ route }) {
1080
+ const t = useT();
1073
1081
  const state = useStore(remoteAccessStore);
1074
1082
  const devices = (route === "relay" ? state.relayView : state.view)?.devices ?? [];
1075
1083
  if (devices.length === 0) return null;
1076
1084
  return /* @__PURE__ */ jsxs("div", {
1077
1085
  className: "flex w-full flex-col gap-1.5",
1078
- children: [/* @__PURE__ */ jsx(SectionLabel, { children: "paired devices" }), devices.map((device) => /* @__PURE__ */ jsxs("div", {
1086
+ children: [/* @__PURE__ */ jsx(SectionLabel, { children: t("remote.ui.pairedDevices", "paired devices") }), devices.map((device) => /* @__PURE__ */ jsxs("div", {
1079
1087
  "data-testid": `remote-device-${device.id}`,
1080
1088
  className: "flex items-center justify-between gap-3 rounded border border-po-border px-2.5 py-1.5",
1081
1089
  children: [/* @__PURE__ */ jsxs("span", {
1082
1090
  className: "flex min-w-0 flex-col",
1083
1091
  children: [/* @__PURE__ */ jsxs("span", {
1084
1092
  className: "truncate text-base font-semibold text-po-hi",
1085
- children: [device.label, device.self ? " · this device" : ""]
1093
+ children: [device.label, device.self ? t("remote.ui.thisDevice", " · this device") : ""]
1086
1094
  }), /* @__PURE__ */ jsx("span", {
1087
1095
  className: "truncate text-sm text-po-dim",
1088
1096
  children: device.userAgent
@@ -1092,7 +1100,7 @@ function PairedDeviceList({ route }) {
1092
1100
  size: "sm",
1093
1101
  "data-testid": `remote-revoke-${device.id}`,
1094
1102
  onClick: () => void revokePairedDevice(device.id, route),
1095
- children: "Revoke"
1103
+ children: t("remote.ui.revoke", "Revoke")
1096
1104
  })]
1097
1105
  }, device.id))]
1098
1106
  });
@@ -1105,15 +1113,16 @@ const PLATFORM_LABEL = {
1105
1113
  };
1106
1114
  /** Native devices that sign back in with their own key, each with the one way to take that back. */
1107
1115
  function TrustedDeviceListView({ devices, busy = false, onRevoke }) {
1116
+ const t = useT();
1108
1117
  if (devices.length === 0) return null;
1109
1118
  return /* @__PURE__ */ jsxs("div", {
1110
1119
  className: "flex w-full flex-col gap-1.5",
1111
1120
  "data-testid": "remote-trusted-devices",
1112
1121
  children: [
1113
- /* @__PURE__ */ jsx(SectionLabel, { children: "trusted phones" }),
1122
+ /* @__PURE__ */ jsx(SectionLabel, { children: t("remote.ui.trustedPhones", "trusted phones") }),
1114
1123
  /* @__PURE__ */ jsx("p", {
1115
1124
  className: "text-sm text-po-dim",
1116
- children: "A trusted phone signs back in on its own. Revoking one signs it out now, and it pairs again by QR."
1125
+ children: t("remote.ui.aTrustedPhoneSignsBackInOnItsOwnRevokingOneSignsItOutNowAndItPairsAgainByQR", "A trusted phone signs back in on its own. Revoking one signs it out now, and it pairs again by QR.")
1117
1126
  }),
1118
1127
  devices.map((device) => /* @__PURE__ */ jsxs("div", {
1119
1128
  "data-testid": `remote-trusted-device-${device.id}`,
@@ -1122,16 +1131,13 @@ function TrustedDeviceListView({ devices, busy = false, onRevoke }) {
1122
1131
  className: "flex min-w-0 flex-col",
1123
1132
  children: [/* @__PURE__ */ jsxs("span", {
1124
1133
  className: "truncate text-base font-semibold text-po-hi",
1125
- children: [device.label, device.self ? " · this device" : ""]
1126
- }), /* @__PURE__ */ jsxs("span", {
1134
+ children: [device.label, device.self ? t("remote.ui.thisDevice", " · this device") : ""]
1135
+ }), /* @__PURE__ */ jsx("span", {
1127
1136
  className: "truncate text-sm text-po-dim",
1128
- children: [
1129
- PLATFORM_LABEL[device.platform],
1130
- " ",
1131
- "·",
1132
- " trusted since ",
1133
- device.createdAt.slice(0, 10)
1134
- ]
1137
+ children: t("remote.ui.trustedSinceDate", "{platform} · trusted since {date}", {
1138
+ platform: PLATFORM_LABEL[device.platform],
1139
+ date: device.createdAt.slice(0, 10)
1140
+ })
1135
1141
  })]
1136
1142
  }), /* @__PURE__ */ jsx(Button, {
1137
1143
  variant: "ghost",
@@ -1139,7 +1145,7 @@ function TrustedDeviceListView({ devices, busy = false, onRevoke }) {
1139
1145
  disabled: busy,
1140
1146
  "data-testid": `remote-trusted-revoke-${device.id}`,
1141
1147
  onClick: () => onRevoke(device.id),
1142
- children: "Revoke"
1148
+ children: t("remote.ui.revoke", "Revoke")
1143
1149
  })]
1144
1150
  }, device.id))
1145
1151
  ]
@@ -1166,6 +1172,7 @@ const MAX_HOURS = 720;
1166
1172
  * that is still open next week.
1167
1173
  */
1168
1174
  function RemoteAccessOptions() {
1175
+ const t = useT();
1169
1176
  const state = useStore(remoteAccessStore);
1170
1177
  const settings = state.view?.settings;
1171
1178
  if (settings === void 0) return /* @__PURE__ */ jsx(Spinner, {});
@@ -1179,10 +1186,10 @@ function RemoteAccessOptions() {
1179
1186
  className: "flex flex-col gap-0.5",
1180
1187
  children: [/* @__PURE__ */ jsx("span", {
1181
1188
  className: "text-base font-medium text-po-text",
1182
- children: state.independent ? "Close connections automatically" : "Close the tunnel automatically"
1189
+ children: state.independent ? t("remote.ui.closeConnectionsAutomatically", "Close connections automatically") : t("remote.ui.closeTheTunnelAutomatically", "Close the tunnel automatically")
1183
1190
  }), /* @__PURE__ */ jsx("span", {
1184
1191
  className: "text-sm text-po-dim",
1185
- children: state.independent ? "Each connection closes when its own timer ends." : "So a tunnel you forgot about does not stay open for weeks."
1192
+ children: state.independent ? t("remote.ui.eachConnectionClosesWhenItsOwnTimerEnds", "Each connection closes when its own timer ends.") : t("remote.ui.soATunnelYouForgotAboutDoesNotStayOpenForWeeks", "So a tunnel you forgot about does not stay open for weeks.")
1186
1193
  })]
1187
1194
  }), /* @__PURE__ */ jsx(Switch, {
1188
1195
  id: "remote-autoclose-switch",
@@ -1196,7 +1203,7 @@ function RemoteAccessOptions() {
1196
1203
  className: "flex items-center justify-between gap-4 pl-4",
1197
1204
  children: [/* @__PURE__ */ jsx("span", {
1198
1205
  className: "text-base font-medium text-po-text",
1199
- children: "After this many minutes"
1206
+ children: t("remote.ui.afterThisManyMinutes", "After this many minutes")
1200
1207
  }), /* @__PURE__ */ jsx(Input, {
1201
1208
  id: "remote-autoclose-minutes",
1202
1209
  "data-testid": "remote-autoclose-minutes",
@@ -1215,10 +1222,10 @@ function RemoteAccessOptions() {
1215
1222
  className: "flex flex-col gap-0.5",
1216
1223
  children: [/* @__PURE__ */ jsx("span", {
1217
1224
  className: "text-base font-medium text-po-text",
1218
- children: "Expire paired sessions"
1225
+ children: t("remote.ui.expirePairedSessions", "Expire paired sessions")
1219
1226
  }), /* @__PURE__ */ jsx("span", {
1220
1227
  className: "text-sm text-po-dim",
1221
- children: "A device that goes quiet, or has simply been paired a long time, has to pair again."
1228
+ children: t("remote.ui.aDeviceThatGoesQuietOrHasSimplyBeenPairedALongTimeHasToPairAgain", "A device that goes quiet, or has simply been paired a long time, has to pair again.")
1222
1229
  })]
1223
1230
  }), /* @__PURE__ */ jsx(Switch, {
1224
1231
  id: "remote-expiry-switch",
@@ -1232,7 +1239,7 @@ function RemoteAccessOptions() {
1232
1239
  children: [/* @__PURE__ */ jsxs("label", {
1233
1240
  htmlFor: "remote-idle-minutes",
1234
1241
  className: "flex items-center gap-2 text-base font-medium text-po-text",
1235
- children: ["Idle minutes", /* @__PURE__ */ jsx(Input, {
1242
+ children: [t("remote.ui.idleMinutes", "Idle minutes"), /* @__PURE__ */ jsx(Input, {
1236
1243
  id: "remote-idle-minutes",
1237
1244
  "data-testid": "remote-idle-minutes",
1238
1245
  type: "number",
@@ -1245,7 +1252,7 @@ function RemoteAccessOptions() {
1245
1252
  }), /* @__PURE__ */ jsxs("label", {
1246
1253
  htmlFor: "remote-absolute-hours",
1247
1254
  className: "flex items-center gap-2 text-base font-medium text-po-text",
1248
- children: ["Total hours", /* @__PURE__ */ jsx(Input, {
1255
+ children: [t("remote.ui.totalHours", "Total hours"), /* @__PURE__ */ jsx(Input, {
1249
1256
  id: "remote-absolute-hours",
1250
1257
  "data-testid": "remote-absolute-hours",
1251
1258
  type: "number",
@@ -1259,11 +1266,7 @@ function RemoteAccessOptions() {
1259
1266
  }) : null,
1260
1267
  /* @__PURE__ */ jsx("p", {
1261
1268
  className: "text-sm text-po-dim",
1262
- children: state.independent ? "Stopping a connection ends its sessions. Revoking a trusted phone removes its access on both connections." : /* @__PURE__ */ jsxs(Fragment, { children: [
1263
- "Switching remote access off always revokes every paired device. Requires ",
1264
- /* @__PURE__ */ jsx("code", { children: "cloudflared" }),
1265
- " on PATH."
1266
- ] })
1269
+ children: state.independent ? t("remote.ui.stoppingAConnectionEndsItsSessionsRevokingATrustedPhoneRemovesItsAccessOnBothConnections", "Stopping a connection ends its sessions. Revoking a trusted phone removes its access on both connections.") : t("remote.ui.switchOffNotice", "Switching remote access off always revokes every paired device. Requires cloudflared on PATH.")
1267
1270
  }),
1268
1271
  /* @__PURE__ */ jsx(PairedDeviceList, { route: state.independent ? "tunnel" : void 0 }),
1269
1272
  state.independent ? /* @__PURE__ */ jsx(PairedDeviceList, { route: "relay" }) : null,
@@ -1276,6 +1279,7 @@ function RemoteAccessOptions() {
1276
1279
  //#region src/extensions/(frontend)/_components/RemoteAccessPairing.tsx
1277
1280
  /** The QR credential, a short manual code, and the direct address. */
1278
1281
  function RemoteAccessPairing({ route }) {
1282
+ const t = useT();
1279
1283
  const state = useStore(remoteAccessStore);
1280
1284
  const relay = route === "relay";
1281
1285
  if (state.pairUrl === void 0 || state.pairCode === void 0 || state.pairFingerprint === void 0) return state.busy ? /* @__PURE__ */ jsx(Spinner, {}) : null;
@@ -1288,33 +1292,33 @@ function RemoteAccessPairing({ route }) {
1288
1292
  value: target,
1289
1293
  onValueChange: (value) => choosePairTarget(value),
1290
1294
  children: /* @__PURE__ */ jsxs(TabsList, {
1291
- "aria-label": "Pair with",
1295
+ "aria-label": t("remote.ui.pairWith", "Pair with"),
1292
1296
  children: [/* @__PURE__ */ jsx(TabsTrigger, {
1293
1297
  value: "web",
1294
1298
  "data-testid": "remote-pair-target-web",
1295
- children: "Browser"
1299
+ children: t("remote.ui.browser", "Browser")
1296
1300
  }), /* @__PURE__ */ jsx(TabsTrigger, {
1297
1301
  value: "native",
1298
1302
  "data-testid": "remote-pair-target-native",
1299
- children: "Po app"
1303
+ children: t("remote.ui.poApp", "Po app")
1300
1304
  })]
1301
1305
  })
1302
1306
  }),
1303
1307
  /* @__PURE__ */ jsx("p", {
1304
1308
  className: "text-center text-sm text-po-dim",
1305
- children: relay ? "Scan or paste this link in the Po app. A device already trusted by this computer can use its existing key." : target === "native" ? "Scan with the phone camera to open the Po app. Scanning from inside Po? Use the Browser code, or paste the address below." : "Scan with the phone camera to open Po in the phone browser."
1309
+ children: relay ? t("remote.ui.scanOrPasteThisLinkInThePoAppADeviceAlreadyTrustedByThisComputerCanUseItsExistingKey", "Scan or paste this link in the Po app. A device already trusted by this computer can use its existing key.") : target === "native" ? t("remote.ui.scanWithThePhoneCameraToOpenThePoAppScanningFromInsidePoUseTheBrowserCodeOrPasteTheAddressBelow", "Scan with the phone camera to open the Po app. Scanning from inside Po? Use the Browser code, or paste the address below.") : t("remote.ui.scanWithThePhoneCameraToOpenPoInThePhoneBrowser", "Scan with the phone camera to open Po in the phone browser.")
1306
1310
  }),
1307
1311
  /* @__PURE__ */ jsx("div", {
1308
1312
  className: "rounded-lg bg-po-hi p-3 text-po-deep",
1309
1313
  children: /* @__PURE__ */ jsx(QrCode, {
1310
1314
  value: qrValue,
1311
1315
  size: 288,
1312
- label: "Scan to pair this device"
1316
+ label: t("remote.ui.scanToPairThisDevice", "Scan to pair this device")
1313
1317
  })
1314
1318
  }),
1315
1319
  target === "web" ? /* @__PURE__ */ jsxs("div", {
1316
1320
  className: "flex w-full flex-col gap-1",
1317
- children: [/* @__PURE__ */ jsx(SectionLabel, { children: "or enter this pairing code" }), /* @__PURE__ */ jsx("code", {
1321
+ children: [/* @__PURE__ */ jsx(SectionLabel, { children: t("remote.ui.orEnterThisPairingCode", "or enter this pairing code") }), /* @__PURE__ */ jsx("code", {
1318
1322
  "data-testid": "remote-pair-code",
1319
1323
  className: "rounded bg-po-deep p-2 text-center font-mono text-lg tracking-widest text-po-text",
1320
1324
  children: state.pairCode
@@ -1323,7 +1327,7 @@ function RemoteAccessPairing({ route }) {
1323
1327
  /* @__PURE__ */ jsxs("div", {
1324
1328
  className: "flex w-full flex-col gap-1",
1325
1329
  children: [
1326
- /* @__PURE__ */ jsx(SectionLabel, { children: "signing-key fingerprint" }),
1330
+ /* @__PURE__ */ jsx(SectionLabel, { children: t("remote.ui.signingKeyFingerprint", "signing-key fingerprint") }),
1327
1331
  /* @__PURE__ */ jsx("code", {
1328
1332
  "data-testid": "remote-signing-fingerprint",
1329
1333
  className: "break-all rounded bg-po-deep p-2 text-center font-mono text-sm text-po-text",
@@ -1331,18 +1335,13 @@ function RemoteAccessPairing({ route }) {
1331
1335
  }),
1332
1336
  /* @__PURE__ */ jsxs("p", {
1333
1337
  className: "text-sm text-po-dim",
1334
- children: [
1335
- target === "web" ? "Compare this on the phone when entering the manual code. " : "",
1336
- "Bundle revision ",
1337
- String(state.pairRevision),
1338
- "."
1339
- ]
1338
+ children: [target === "web" ? t("remote.ui.compareThisOnThePhoneWhenEnteringTheManualCode", "Compare this on the phone when entering the manual code. ") : "", t("remote.ui.bundleVersion", "Bundle revision {revision}.", { revision: String(state.pairRevision) })]
1340
1339
  })
1341
1340
  ]
1342
1341
  }),
1343
1342
  /* @__PURE__ */ jsxs("div", {
1344
1343
  className: "flex w-full flex-col gap-1",
1345
- children: [/* @__PURE__ */ jsx(SectionLabel, { children: target === "native" ? "or paste this address in the app" : "or open this address" }), /* @__PURE__ */ jsx("code", {
1344
+ children: [/* @__PURE__ */ jsx(SectionLabel, { children: target === "native" ? t("remote.ui.orPasteThisAddressInTheApp", "or paste this address in the app") : t("remote.ui.orOpenThisAddress", "or open this address") }), /* @__PURE__ */ jsx("code", {
1346
1345
  "data-testid": "remote-pair-url",
1347
1346
  className: "break-all rounded bg-po-deep p-2 text-sm text-po-dim",
1348
1347
  children: state.pairUrl
@@ -1354,22 +1353,22 @@ function RemoteAccessPairing({ route }) {
1354
1353
  "data-testid": "remote-new-code",
1355
1354
  disabled: state.busy,
1356
1355
  onClick: () => void (route ? pairRemoteConnection(route) : newPairingCode()),
1357
- children: "Show a new code"
1356
+ children: t("remote.ui.showANewCode", "Show a new code")
1358
1357
  }),
1359
1358
  relay ? null : state.passkeys?.supported === true ? /* @__PURE__ */ jsxs("div", {
1360
1359
  className: "flex w-full flex-col gap-1.5 border-t border-po-border pt-3",
1361
1360
  children: [
1362
- /* @__PURE__ */ jsx(SectionLabel, { children: "passkeys" }),
1361
+ /* @__PURE__ */ jsx(SectionLabel, { children: t("remote.ui.passkeys", "passkeys") }),
1363
1362
  /* @__PURE__ */ jsx("p", {
1364
1363
  className: "text-sm text-po-dim",
1365
- children: state.passkeys.count === 0 ? "Add one on the device you just paired and it will not need the code again." : `${String(state.passkeys.count)} registered. A paired device signs in with a gesture instead of a code.`
1364
+ children: state.passkeys.count === 0 ? t("remote.ui.addOneOnTheDeviceYouJustPairedAndItWillNotNeedTheCodeAgain", "Add one on the device you just paired and it will not need the code again.") : t("remote.ui.registeredPasskeys", "{count} registered. A paired device signs in with a gesture instead of a code.", { count: state.passkeys.count })
1366
1365
  }),
1367
1366
  /* @__PURE__ */ jsx(Button, {
1368
1367
  variant: "outline",
1369
1368
  size: "sm",
1370
1369
  "data-testid": "remote-add-passkey",
1371
1370
  onClick: () => void addPasskey(),
1372
- children: "Add a passkey for this device"
1371
+ children: t("remote.ui.addAPasskeyForThisDevice", "Add a passkey for this device")
1373
1372
  })
1374
1373
  ]
1375
1374
  }) : state.passkeys?.reason === void 0 ? null : /* @__PURE__ */ jsx("p", {
@@ -1382,9 +1381,58 @@ function RemoteAccessPairing({ route }) {
1382
1381
  });
1383
1382
  }
1384
1383
  //#endregion
1384
+ //#region src/extensions/(frontend)/_lib/remoteSummary.ts
1385
+ /** The one-line state a settings list shows beside Remote control, such as "On · po.example.com". */
1386
+ function remoteSummaryText(remote) {
1387
+ if (remote.status === "on") return remote.publicUrl ? t("remote.ui.summaryOnHost", "On · {host}", { host: remote.publicUrl.replace(/^https?:\/\//u, "") }) : t("remote.ui.summaryOn", "On");
1388
+ if (remote.status === "starting") return t("remote.ui.summaryStarting", "Starting");
1389
+ if (remote.status === "failed") return remote.error ? t("remote.ui.summaryError", "Failed · {error}", { error: remoteFailureMessage(remote.error, t) }) : t("remote.ui.summaryFailed", "Failed");
1390
+ return t("remote.ui.summaryOff", "Off");
1391
+ }
1392
+ /** Reads the state through the host's transport; any failure shows no summary rather than a wrong one. */
1393
+ async function readRemoteSummary(request) {
1394
+ const response = await request(REMOTE_API_ROUTE);
1395
+ if (!response.ok) return void 0;
1396
+ const body = await response.json();
1397
+ return body.state === void 0 ? void 0 : remoteSummaryText(body.state);
1398
+ }
1399
+ /** Localize known Po wrappers only, preserving the appended process or provider detail. */
1400
+ function remoteFailureMessage(message, t) {
1401
+ if (message.startsWith("cloudflared is not installed. Install it (brew install cloudflared) or set PO_CLOUDFLARED.")) return t("remote.error.notInstalled", "cloudflared is not installed. Install it (brew install cloudflared) or set PO_CLOUDFLARED.") + message.slice(90);
1402
+ if (message.startsWith("cloudflared could not be started.")) return t("remote.error.spawnFailed", "cloudflared could not be started.") + message.slice(33);
1403
+ if (message.startsWith("cloudflared did not report a public URL in time.")) return t("remote.error.timeout", "cloudflared did not report a public URL in time.") + message.slice(48);
1404
+ if (message.startsWith("The tunnel came up unguarded and was closed immediately.")) return t("remote.error.selfTestFailed", "The tunnel came up unguarded and was closed immediately.") + message.slice(56);
1405
+ if (message.startsWith("cloudflared stopped on its own.")) return t("remote.error.exited", "cloudflared stopped on its own.") + message.slice(31);
1406
+ if (message.startsWith("Tunnel startup was cancelled.")) return t("remote.error.cancelled", "Tunnel startup was cancelled.") + message.slice(29);
1407
+ if (message.startsWith("The tunnel did not answer:")) return t("remote.error.noAnswer", "The tunnel did not answer:") + message.slice(26);
1408
+ if (message.startsWith("Private network and relay remote access never start a tunnel.")) return t("remote.error.noTunnel", "Private network and relay remote access never start a tunnel.") + message.slice(61);
1409
+ switch (message) {
1410
+ case "Enter a Po Cloud HTTPS address.": return t("remote.error.relay.httpsAddress", "Enter a Po Cloud HTTPS address.");
1411
+ case "Enter the Po Cloud HTTPS origin without a path.": return t("remote.error.relay.originOnly", "Enter the Po Cloud HTTPS origin without a path.");
1412
+ case "Po Cloud returned an invalid link response.": return t("remote.error.relay.invalidResponse", "Po Cloud returned an invalid link response.");
1413
+ case "Po Cloud returned no link response.": return t("remote.error.relay.noResponse", "Po Cloud returned no link response.");
1414
+ case "Po Cloud link response was too large.": return t("remote.error.relay.responseTooLarge", "Po Cloud link response was too large.");
1415
+ case "Invalid saved Po Cloud relay link.": return t("remote.error.relay.invalidSavedLink", "Invalid saved Po Cloud relay link.");
1416
+ case "Po Cloud could not be reached. Check the address and try again.": return t("remote.error.relay.unreachable", "Po Cloud could not be reached. Check the address and try again.");
1417
+ case "Link this computer to Po Cloud before turning on the relay.": return t("remote.error.relay.linkFirst", "Link this computer to Po Cloud before turning on the relay.");
1418
+ case "Po Cloud link is already in progress.": return t("remote.error.relay.inProgress", "Po Cloud link is already in progress.");
1419
+ case "The computer signing key is not ready. Try again shortly.": return t("remote.error.relay.keyNotReady", "The computer signing key is not ready. Try again shortly.");
1420
+ case "This Po Cloud site could not start a relay link.": return t("remote.error.relay.startFailed", "This Po Cloud site could not start a relay link.");
1421
+ case "Po Cloud returned an invalid link request.": return t("remote.error.relay.invalidRequest", "Po Cloud returned an invalid link request.");
1422
+ case "Po Cloud returned an unexpected approval address.": return t("remote.error.relay.approvalAddress", "Po Cloud returned an unexpected approval address.");
1423
+ case "Start a new Po Cloud link. The previous link expired.": return t("remote.error.relay.expired", "Start a new Po Cloud link. The previous link expired.");
1424
+ case "Po Cloud did not approve the link. Start a new link.": return t("remote.error.relay.notApproved", "Po Cloud did not approve the link. Start a new link.");
1425
+ case "Po Cloud returned an invalid approved link.": return t("remote.error.relay.invalidApprovedLink", "Po Cloud returned an invalid approved link.");
1426
+ case "Private relay needs this computer to be enrolled in a team first.": return t("remote.error.relay.enrollFirst", "Private relay needs this computer to be enrolled in a team first.");
1427
+ case "The private relay did not admit this computer. Check that it is enrolled and the origin is right.": return t("remote.error.relay.notAdmitted", "The private relay did not admit this computer. Check that it is enrolled and the origin is right.");
1428
+ default: return message;
1429
+ }
1430
+ }
1431
+ //#endregion
1385
1432
  //#region src/extensions/(frontend)/_components/RemoteAccessRelayTarget.tsx
1386
1433
  /** Presentation shared by the live dialog and its approved state stories. */
1387
1434
  function RemoteAccessRelayTarget({ phase, address, error, busy, locked, linked, accountRelay, approvalUrl, approvalCode, qr, illustrative, onAddressChange, onTunnel, onAdvance, onClose }) {
1435
+ const t = useT();
1388
1436
  const pending = approvalUrl !== void 0 || phase === "pending";
1389
1437
  const connected = phase === "connected" && (accountRelay || qr !== void 0);
1390
1438
  return /* @__PURE__ */ jsx(Dialog, {
@@ -1396,7 +1444,7 @@ function RemoteAccessRelayTarget({ phase, address, error, busy, locked, linked,
1396
1444
  width: "lg",
1397
1445
  "data-testid": "remote-relay-target",
1398
1446
  children: [
1399
- /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: "Remote access" }), /* @__PURE__ */ jsx(DialogDescription, { children: "Reach this cockpit from your phone through a private relay." })] }),
1447
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: t("remote.ui.remoteAccess", "Remote access") }), /* @__PURE__ */ jsx(DialogDescription, { children: t("remote.ui.reachThisCockpitFromYourPhoneThroughAPrivateRelay", "Reach this cockpit from your phone through a private relay.") })] }),
1400
1448
  /* @__PURE__ */ jsxs(DialogBody, {
1401
1449
  className: "flex flex-col gap-5",
1402
1450
  children: [
@@ -1405,7 +1453,7 @@ function RemoteAccessRelayTarget({ phase, address, error, busy, locked, linked,
1405
1453
  children: [
1406
1454
  /* @__PURE__ */ jsx("label", {
1407
1455
  htmlFor: "remote-relay-address",
1408
- children: /* @__PURE__ */ jsx(SectionLabel, { children: "Po Cloud address" })
1456
+ children: /* @__PURE__ */ jsx(SectionLabel, { children: t("remote.ui.poCloudAddress", "Po Cloud address") })
1409
1457
  }),
1410
1458
  /* @__PURE__ */ jsx(Input, {
1411
1459
  id: "remote-relay-address",
@@ -1420,14 +1468,14 @@ function RemoteAccessRelayTarget({ phase, address, error, busy, locked, linked,
1420
1468
  /* @__PURE__ */ jsx("p", {
1421
1469
  id: "remote-relay-address-help",
1422
1470
  className: "text-sm text-po-dim",
1423
- children: "HTTPS only. Change it only if you run your own Po Cloud."
1471
+ children: t("remote.ui.hTTPSOnlyChangeItOnlyIfYouRunYourOwnPoCloud", "HTTPS only. Change it only if you run your own Po Cloud.")
1424
1472
  })
1425
1473
  ]
1426
1474
  }),
1427
1475
  /* @__PURE__ */ jsxs("div", {
1428
1476
  className: "flex flex-col gap-1.5",
1429
1477
  children: [
1430
- /* @__PURE__ */ jsx(SectionLabel, { children: "Route" }),
1478
+ /* @__PURE__ */ jsx(SectionLabel, { children: t("remote.ui.route", "Route") }),
1431
1479
  /* @__PURE__ */ jsxs(OptionRow, {
1432
1480
  active: true,
1433
1481
  marker: "•",
@@ -1439,14 +1487,14 @@ function RemoteAccessRelayTarget({ phase, address, error, busy, locked, linked,
1439
1487
  className: "flex flex-1 flex-col",
1440
1488
  children: [/* @__PURE__ */ jsx("span", {
1441
1489
  className: "text-base font-medium text-po-text",
1442
- children: "Private relay"
1490
+ children: t("remote.ui.privateRelay", "Private relay")
1443
1491
  }), /* @__PURE__ */ jsx("span", {
1444
1492
  className: "text-sm text-po-dim",
1445
- children: accountRelay ? "Po Cloud can read the requests it forwards over an encrypted connection." : "Traffic is encrypted end to end. Po Cloud only forwards it."
1493
+ children: accountRelay ? t("remote.ui.poCloudCanReadTheRequestsItForwardsOverAnEncryptedConnection", "Po Cloud can read the requests it forwards over an encrypted connection.") : t("remote.ui.trafficIsEncryptedEndToEndPoCloudOnlyForwardsIt", "Traffic is encrypted end to end. Po Cloud only forwards it.")
1446
1494
  })]
1447
1495
  }), /* @__PURE__ */ jsx(Badge, {
1448
1496
  tone: "green",
1449
- children: "Selected"
1497
+ children: t("remote.ui.selected", "Selected")
1450
1498
  })]
1451
1499
  }),
1452
1500
  /* @__PURE__ */ jsx(OptionRow, {
@@ -1461,10 +1509,10 @@ function RemoteAccessRelayTarget({ phase, address, error, busy, locked, linked,
1461
1509
  className: "flex flex-1 flex-col",
1462
1510
  children: [/* @__PURE__ */ jsx("span", {
1463
1511
  className: "text-base font-medium text-po-text",
1464
- children: "Public tunnel"
1512
+ children: t("remote.ui.publicTunnel", "Public tunnel")
1465
1513
  }), /* @__PURE__ */ jsx("span", {
1466
1514
  className: "text-sm text-po-dim",
1467
- children: "Existing option. Requires cloudflared on PATH."
1515
+ children: t("remote.ui.existingOptionRequiresCloudflaredOnPATH", "Existing option. Requires cloudflared on PATH.")
1468
1516
  })]
1469
1517
  })
1470
1518
  })
@@ -1475,37 +1523,37 @@ function RemoteAccessRelayTarget({ phase, address, error, busy, locked, linked,
1475
1523
  children: [
1476
1524
  /* @__PURE__ */ jsx(Badge, {
1477
1525
  tone: "green",
1478
- children: "Connected"
1526
+ children: t("remote.ui.connected", "Connected")
1479
1527
  }),
1480
1528
  /* @__PURE__ */ jsx("p", {
1481
1529
  className: "text-center text-sm text-po-dim",
1482
- children: accountRelay ? "Sign in to Po on your phone with this account. No QR code needed." : illustrative ? "Scan with the phone camera. Illustrative code, not a real credential." : "Scan to open the Po app. Then approve the phone on this computer."
1530
+ children: accountRelay ? t("remote.ui.signInToPoOnYourPhoneWithThisAccountNoQRCodeNeeded", "Sign in to Po on your phone with this account. No QR code needed.") : illustrative ? t("remote.ui.scanWithThePhoneCameraIllustrativeCodeNotARealCredential", "Scan with the phone camera. Illustrative code, not a real credential.") : t("remote.ui.scanToOpenThePoAppThenApproveThePhoneOnThisComputer", "Scan to open the Po app. Then approve the phone on this computer.")
1483
1531
  }),
1484
1532
  !accountRelay && qr ? /* @__PURE__ */ jsx("div", {
1485
1533
  className: "rounded-lg bg-po-hi p-3 text-po-deep",
1486
1534
  children: /* @__PURE__ */ jsx(QrCode, {
1487
1535
  value: qr,
1488
1536
  size: 200,
1489
- label: illustrative ? "Illustrative pairing code" : "Scan to pair this device"
1537
+ label: illustrative ? t("remote.ui.illustrativePairingCode", "Illustrative pairing code") : t("remote.ui.scanToPairThisDevice", "Scan to pair this device")
1490
1538
  })
1491
1539
  }) : null
1492
1540
  ]
1493
1541
  }) : /* @__PURE__ */ jsxs("p", {
1494
1542
  "data-testid": "remote-relay-passkey-step",
1495
1543
  className: "text-sm leading-relaxed text-po-dim",
1496
- children: [pending ? approvalCode ? `Approve in Po Cloud and check it shows ${approvalCode}, then come back here to check approval.` : "Approve in Po Cloud, then come back here to check approval." : linked ? accountRelay ? "This computer is linked. Turn on the relay to reach it from Po on your phone." : "This computer is linked. Connect to Po Cloud to pair a device." : "Approve in Po Cloud to link this computer to your account, not the whole team.", approvalUrl ? /* @__PURE__ */ jsxs(Fragment, { children: [" ", /* @__PURE__ */ jsx("a", {
1544
+ children: [pending ? approvalCode ? t("remote.ui.approveCode", "Approve in Po Cloud and check it shows {code}, then come back here to check approval.", { code: approvalCode }) : t("remote.ui.approveInPoCloudThenComeBackHereToCheckApproval", "Approve in Po Cloud, then come back here to check approval.") : linked ? accountRelay ? t("remote.ui.thisComputerIsLinkedTurnOnTheRelayToReachItFromPoOnYourPhone", "This computer is linked. Turn on the relay to reach it from Po on your phone.") : t("remote.ui.thisComputerIsLinkedConnectToPoCloudToPairADevice", "This computer is linked. Connect to Po Cloud to pair a device.") : t("remote.ui.approveInPoCloudToLinkThisComputerToYourAccountNotTheWholeTeam", "Approve in Po Cloud to link this computer to your account, not the whole team."), approvalUrl ? /* @__PURE__ */ jsxs(Fragment, { children: [" ", /* @__PURE__ */ jsx("a", {
1497
1545
  className: "underline text-po-blue",
1498
1546
  href: approvalUrl,
1499
1547
  target: "_blank",
1500
1548
  rel: "noopener noreferrer",
1501
- children: "Open Po Cloud"
1549
+ children: t("remote.ui.openPoCloud", "Open Po Cloud")
1502
1550
  })] }) : null]
1503
1551
  }),
1504
1552
  error !== void 0 ? /* @__PURE__ */ jsx("p", {
1505
1553
  role: "alert",
1506
1554
  "data-testid": "remote-relay-error",
1507
1555
  className: "text-sm text-po-red",
1508
- children: error
1556
+ children: remoteFailureMessage(error, t)
1509
1557
  }) : null
1510
1558
  ]
1511
1559
  }),
@@ -1514,13 +1562,13 @@ function RemoteAccessRelayTarget({ phase, address, error, busy, locked, linked,
1514
1562
  children: connected ? /* @__PURE__ */ jsx(Button, {
1515
1563
  variant: "primary",
1516
1564
  onClick: onClose,
1517
- children: "Done"
1565
+ children: t("remote.ui.done", "Done")
1518
1566
  }) : /* @__PURE__ */ jsx(Button, {
1519
1567
  variant: "primary",
1520
1568
  "data-testid": "remote-relay-link",
1521
1569
  loading: busy,
1522
1570
  onClick: onAdvance,
1523
- children: pending ? "Check approval" : phase === "failed" ? "Try again" : linked ? accountRelay ? "Turn on relay" : "Connect and show code" : "Link to Po Cloud"
1571
+ children: pending ? t("remote.ui.checkApproval", "Check approval") : phase === "failed" ? t("remote.ui.tryAgain", "Try again") : linked ? accountRelay ? t("remote.ui.turnOnRelay", "Turn on relay") : t("remote.ui.connectAndShowCode", "Connect and show code") : t("remote.ui.linkToPoCloud", "Link to Po Cloud")
1524
1572
  })
1525
1573
  })
1526
1574
  ]
@@ -1529,13 +1577,14 @@ function RemoteAccessRelayTarget({ phase, address, error, busy, locked, linked,
1529
1577
  }
1530
1578
  //#endregion
1531
1579
  //#region src/extensions/(frontend)/_components/RemoteConnectionsDialog.tsx
1532
- const statusLabel = {
1533
- off: "Off",
1534
- starting: "Starting",
1535
- on: "Connected",
1536
- failed: "Failed"
1537
- };
1538
1580
  function ConnectionStatus({ status }) {
1581
+ const t = useT();
1582
+ const statusLabel = {
1583
+ off: t("remote.ui.off", "Off"),
1584
+ starting: t("remote.ui.starting", "Starting"),
1585
+ on: t("remote.ui.connected", "Connected"),
1586
+ failed: t("remote.ui.failed", "Failed")
1587
+ };
1539
1588
  return /* @__PURE__ */ jsx(Badge, {
1540
1589
  tone: status === "on" ? "green" : status === "failed" ? "red" : "neutral",
1541
1590
  children: statusLabel[status]
@@ -1543,21 +1592,20 @@ function ConnectionStatus({ status }) {
1543
1592
  }
1544
1593
  /** A time limit is the owner's own setting doing its job, so it reads as a quiet note, never as a failure. */
1545
1594
  function ClosedAtLimit({ at }) {
1595
+ const locale = useLocale();
1596
+ const t = useT();
1546
1597
  if (!at) return null;
1547
- const time = new Date(at).toLocaleTimeString([], {
1598
+ const time = new Date(at).toLocaleTimeString(locale, {
1548
1599
  hour: "numeric",
1549
1600
  minute: "2-digit"
1550
1601
  });
1551
- return /* @__PURE__ */ jsxs("p", {
1602
+ return /* @__PURE__ */ jsx("p", {
1552
1603
  className: "text-sm text-po-dim",
1553
- children: [
1554
- "Turned off at its time limit at ",
1555
- time,
1556
- "."
1557
- ]
1604
+ children: t("remote.ui.closedAt", "Turned off at its time limit at {time}.", { time })
1558
1605
  });
1559
1606
  }
1560
1607
  function RemoteConnectionsDialog(props) {
1608
+ const t = useT();
1561
1609
  const { address, relayStatus, tunnelStatus, approvalUrl, approvalCode, linked, busy, relayError, tunnelError } = props;
1562
1610
  const relayOn = relayStatus === "on";
1563
1611
  const tunnelOn = tunnelStatus === "on";
@@ -1572,21 +1620,21 @@ function RemoteConnectionsDialog(props) {
1572
1620
  width: "lg",
1573
1621
  "data-testid": "remote-access-dialog",
1574
1622
  children: [
1575
- /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: "Remote access" }), /* @__PURE__ */ jsx(DialogDescription, { children: "Use either connection, or keep both on." })] }),
1623
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: t("remote.ui.remoteAccess", "Remote access") }), /* @__PURE__ */ jsx(DialogDescription, { children: t("remote.ui.useEitherConnectionOrKeepBothOn", "Use either connection, or keep both on.") })] }),
1576
1624
  /* @__PURE__ */ jsxs(DialogBody, {
1577
1625
  className: "flex flex-col gap-4",
1578
1626
  children: [
1579
1627
  /* @__PURE__ */ jsxs("section", {
1580
- "aria-label": "Private relay",
1628
+ "aria-label": t("remote.ui.privateRelay", "Private relay"),
1581
1629
  className: "flex flex-col gap-3 rounded-lg border border-po-border p-3",
1582
1630
  children: [
1583
1631
  /* @__PURE__ */ jsxs("div", {
1584
1632
  className: "flex items-center justify-between gap-2",
1585
- children: [/* @__PURE__ */ jsx(SectionLabel, { children: "Private relay" }), /* @__PURE__ */ jsx(ConnectionStatus, { status: relayStatus })]
1633
+ children: [/* @__PURE__ */ jsx(SectionLabel, { children: t("remote.ui.privateRelay", "Private relay") }), /* @__PURE__ */ jsx(ConnectionStatus, { status: relayStatus })]
1586
1634
  }),
1587
1635
  /* @__PURE__ */ jsx("p", {
1588
1636
  className: "text-sm text-po-dim",
1589
- children: props.accountRelay ? "Po Cloud can read the requests it forwards over an encrypted connection. Only your account can use this computer through Po Cloud." : "Traffic is encrypted end to end. Po Cloud only forwards it. You approve this computer in Po Cloud, for your account, not the whole team."
1637
+ children: props.accountRelay ? t("remote.ui.poCloudCanReadTheRequestsItForwardsOverAnEncryptedConnectionOnlyYourAccountCanUseThisComputerThroughPoCloud", "Po Cloud can read the requests it forwards over an encrypted connection. Only your account can use this computer through Po Cloud.") : t("remote.ui.trafficIsEncryptedEndToEndPoCloudOnlyForwardsItYouApproveThisComputerInPoCloudForYourAccountNotTheWholeTeam", "Traffic is encrypted end to end. Po Cloud only forwards it. You approve this computer in Po Cloud, for your account, not the whole team.")
1590
1638
  }),
1591
1639
  relayOn ? /* @__PURE__ */ jsxs("div", {
1592
1640
  className: "flex flex-col gap-1",
@@ -1595,14 +1643,14 @@ function RemoteConnectionsDialog(props) {
1595
1643
  children: address
1596
1644
  }), props.accountRelay ? /* @__PURE__ */ jsx("p", {
1597
1645
  className: "text-sm text-po-dim",
1598
- children: "Sign in to Po on your phone with this account. No QR code needed."
1646
+ children: t("remote.ui.signInToPoOnYourPhoneWithThisAccountNoQRCodeNeeded", "Sign in to Po on your phone with this account. No QR code needed.")
1599
1647
  }) : null]
1600
1648
  }) : /* @__PURE__ */ jsxs("div", {
1601
1649
  className: "flex flex-col gap-1.5",
1602
1650
  children: [
1603
1651
  /* @__PURE__ */ jsx("label", {
1604
1652
  htmlFor: "remote-cloud-address",
1605
- children: /* @__PURE__ */ jsx(SectionLabel, { children: "Po Cloud address" })
1653
+ children: /* @__PURE__ */ jsx(SectionLabel, { children: t("remote.ui.poCloudAddress", "Po Cloud address") })
1606
1654
  }),
1607
1655
  /* @__PURE__ */ jsx(Input, {
1608
1656
  id: "remote-cloud-address",
@@ -1615,7 +1663,7 @@ function RemoteConnectionsDialog(props) {
1615
1663
  /* @__PURE__ */ jsx("p", {
1616
1664
  id: "remote-cloud-address-help",
1617
1665
  className: "text-sm text-po-dim",
1618
- children: "HTTPS only. Change this if you run your own Po Cloud."
1666
+ children: t("remote.ui.hTTPSOnlyChangeThisIfYouRunYourOwnPoCloud", "HTTPS only. Change this if you run your own Po Cloud.")
1619
1667
  })
1620
1668
  ]
1621
1669
  }),
@@ -1627,24 +1675,25 @@ function RemoteConnectionsDialog(props) {
1627
1675
  href: approvalUrl,
1628
1676
  target: "_blank",
1629
1677
  rel: "noopener noreferrer",
1630
- children: "Open approval in Po Cloud"
1678
+ children: t("remote.ui.openApprovalInPoCloud", "Open approval in Po Cloud")
1631
1679
  }),
1632
1680
  approvalCode ? /* @__PURE__ */ jsxs(Fragment, { children: [
1633
1681
  " ",
1634
- "and check it shows ",
1682
+ t("remote.ui.andCheckItShows", "and check it shows"),
1683
+ " ",
1635
1684
  /* @__PURE__ */ jsx("strong", {
1636
1685
  className: "font-mono text-po-text",
1637
1686
  children: approvalCode
1638
1687
  })
1639
1688
  ] }) : null,
1640
- ", then return here to check it."
1689
+ t("remote.ui.thenReturnHereToCheckIt", ", then return here to check it.")
1641
1690
  ]
1642
1691
  }) : null,
1643
1692
  /* @__PURE__ */ jsx(ClosedAtLimit, { at: props.relayClosedAt }),
1644
1693
  relayError ? /* @__PURE__ */ jsx("p", {
1645
1694
  role: "alert",
1646
1695
  className: "text-sm text-po-red",
1647
- children: relayError
1696
+ children: remoteFailureMessage(relayError, t)
1648
1697
  }) : null,
1649
1698
  /* @__PURE__ */ jsxs("div", {
1650
1699
  className: "flex flex-wrap gap-2",
@@ -1652,37 +1701,39 @@ function RemoteConnectionsDialog(props) {
1652
1701
  variant: relayOn ? "outline" : "primary",
1653
1702
  disabled: relayBusy,
1654
1703
  onClick: props.onRelayAdvance,
1655
- children: relayOn ? "Pair through relay" : approvalUrl ? "Check approval" : linked ? "Turn on relay" : "Link to Po Cloud"
1704
+ children: relayOn ? t("remote.ui.pairThroughRelay", "Pair through relay") : approvalUrl ? t("remote.ui.checkApproval", "Check approval") : linked ? t("remote.ui.turnOnRelay", "Turn on relay") : t("remote.ui.linkToPoCloud", "Link to Po Cloud")
1656
1705
  }) : null, relayOn ? /* @__PURE__ */ jsx(Button, {
1657
1706
  variant: "ghost",
1658
1707
  disabled: busy,
1659
1708
  onClick: props.onRelayStop,
1660
- children: "Turn off relay"
1709
+ children: t("remote.ui.turnOffRelay", "Turn off relay")
1661
1710
  }) : null]
1662
1711
  })
1663
1712
  ]
1664
1713
  }),
1665
1714
  /* @__PURE__ */ jsxs("section", {
1666
- "aria-label": "Public tunnel",
1715
+ "aria-label": t("remote.ui.publicTunnel", "Public tunnel"),
1667
1716
  className: "flex flex-col gap-3 rounded-lg border border-po-border p-3",
1668
1717
  children: [
1669
1718
  /* @__PURE__ */ jsxs("div", {
1670
1719
  className: "flex items-center justify-between gap-2",
1671
- children: [/* @__PURE__ */ jsx(SectionLabel, { children: "Public tunnel" }), /* @__PURE__ */ jsx(ConnectionStatus, { status: tunnelStatus })]
1720
+ children: [/* @__PURE__ */ jsx(SectionLabel, { children: t("remote.ui.publicTunnel", "Public tunnel") }), /* @__PURE__ */ jsx(ConnectionStatus, { status: tunnelStatus })]
1672
1721
  }),
1673
1722
  /* @__PURE__ */ jsxs("p", {
1674
1723
  className: "text-sm text-po-dim",
1675
1724
  children: [
1676
- "Opens a public address. Requires ",
1725
+ t("remote.ui.opensAPublicAddressRequires", "Opens a public address. Requires"),
1726
+ " ",
1677
1727
  /* @__PURE__ */ jsx("code", { children: "cloudflared" }),
1678
- " on this computer."
1728
+ " ",
1729
+ t("remote.ui.onThisComputer", "on this computer.")
1679
1730
  ]
1680
1731
  }),
1681
1732
  /* @__PURE__ */ jsx(ClosedAtLimit, { at: props.tunnelClosedAt }),
1682
1733
  tunnelError ? /* @__PURE__ */ jsx("p", {
1683
1734
  role: "alert",
1684
1735
  className: "text-sm text-po-red",
1685
- children: tunnelError
1736
+ children: remoteFailureMessage(tunnelError, t)
1686
1737
  }) : null,
1687
1738
  /* @__PURE__ */ jsxs("div", {
1688
1739
  className: "flex flex-wrap gap-2",
@@ -1690,19 +1741,19 @@ function RemoteConnectionsDialog(props) {
1690
1741
  variant: "outline",
1691
1742
  disabled: tunnelBusy,
1692
1743
  onClick: props.onTunnelAdvance,
1693
- children: tunnelOn ? "Pair through tunnel" : "Turn on tunnel"
1744
+ children: tunnelOn ? t("remote.ui.pairThroughTunnel", "Pair through tunnel") : t("remote.ui.turnOnTunnel", "Turn on tunnel")
1694
1745
  }), tunnelOn ? /* @__PURE__ */ jsx(Button, {
1695
1746
  variant: "ghost",
1696
1747
  disabled: busy,
1697
1748
  onClick: props.onTunnelStop,
1698
- children: "Turn off tunnel"
1749
+ children: t("remote.ui.turnOffTunnel", "Turn off tunnel")
1699
1750
  }) : null]
1700
1751
  })
1701
1752
  ]
1702
1753
  }),
1703
1754
  /* @__PURE__ */ jsxs("div", {
1704
1755
  className: "flex flex-col gap-2 text-sm text-po-dim",
1705
- children: [/* @__PURE__ */ jsx("p", { children: "Paired devices can prompt the agent, approve tool calls, and run shell commands as you. Pair only devices you hold." }), /* @__PURE__ */ jsx("p", { children: props.accountRelay ? "Phones already paired through the relay stay paired until you forget them. A phone paired here and signed in to Po Cloud shows this computer once, and uses Po Cloud only while its own connection is off." : "An approved Po app can use its existing device key when you choose another connection. A phone signed in to Po Cloud uses it only while its own connection is off." })]
1756
+ children: [/* @__PURE__ */ jsx("p", { children: t("remote.ui.pairedDevicesCanPromptTheAgentApproveToolCallsAndRunShellCommandsAsYouPairOnlyDevicesYouHold", "Paired devices can prompt the agent, approve tool calls, and run shell commands as you. Pair only devices you hold.") }), /* @__PURE__ */ jsx("p", { children: props.accountRelay ? t("remote.ui.phonesAlreadyPairedThroughTheRelayStayPairedUntilYouForgetThemAPhonePairedHereAndSignedInToPoCloudShowsThisComputerOnceAndUsesPoCloudOnlyWhileItsOwnConnectionIsOff", "Phones already paired through the relay stay paired until you forget them. A phone paired here and signed in to Po Cloud shows this computer once, and uses Po Cloud only while its own connection is off.") : t("remote.ui.anApprovedPoAppCanUseItsExistingDeviceKeyWhenYouChooseAnotherConnectionAPhoneSignedInToPoCloudUsesItOnlyWhileItsOwnConnectionIsOff", "An approved Po app can use its existing device key when you choose another connection. A phone signed in to Po Cloud uses it only while its own connection is off.") })]
1706
1757
  })
1707
1758
  ]
1708
1759
  }),
@@ -1711,7 +1762,7 @@ function RemoteConnectionsDialog(props) {
1711
1762
  children: /* @__PURE__ */ jsx(Button, {
1712
1763
  variant: "ghost",
1713
1764
  onClick: props.onClose,
1714
- children: "Done"
1765
+ children: t("remote.ui.done", "Done")
1715
1766
  })
1716
1767
  })
1717
1768
  ]
@@ -1728,6 +1779,7 @@ function RemoteConnectionsDialog(props) {
1728
1779
  * those are answered.
1729
1780
  */
1730
1781
  function RemoteAccessDialog() {
1782
+ const t = useT();
1731
1783
  const state = useStore(remoteAccessStore);
1732
1784
  const view = state.view;
1733
1785
  const pairing = state.step === "pairing";
@@ -1763,7 +1815,7 @@ function RemoteAccessDialog() {
1763
1815
  children: /* @__PURE__ */ jsxs(DialogContent, {
1764
1816
  width: "lg",
1765
1817
  children: [
1766
- /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: "Pair through tunnel" }), /* @__PURE__ */ jsx(DialogDescription, { children: "Scan this with the device you want to use." })] }),
1818
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: t("remote.ui.pairThroughTunnel", "Pair through tunnel") }), /* @__PURE__ */ jsx(DialogDescription, { children: t("remote.ui.scanThisWithTheDeviceYouWantToUse", "Scan this with the device you want to use.") })] }),
1767
1819
  /* @__PURE__ */ jsxs(DialogBody, {
1768
1820
  className: "flex flex-col gap-4",
1769
1821
  children: [/* @__PURE__ */ jsx(RemoteAccessPairing, { route: state.route }), state.route && connectionError?.[state.route] ? /* @__PURE__ */ jsx("p", {
@@ -1777,7 +1829,7 @@ function RemoteAccessDialog() {
1777
1829
  children: /* @__PURE__ */ jsx(Button, {
1778
1830
  variant: "ghost",
1779
1831
  onClick: showRemoteOptions,
1780
- children: "Back to connections"
1832
+ children: t("remote.ui.backToConnections", "Back to connections")
1781
1833
  })
1782
1834
  })
1783
1835
  ]
@@ -1810,13 +1862,13 @@ function RemoteAccessDialog() {
1810
1862
  "data-testid": "remote-access-dialog",
1811
1863
  "aria-describedby": void 0,
1812
1864
  children: [
1813
- /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: pairing ? "Pair a device" : "Remote access" }), /* @__PURE__ */ jsx(DialogDescription, { children: pairing ? "Scan this with the device you want to use. You will be asked to approve it here." : "Reach this cockpit from your phone over a public tunnel." })] }),
1865
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: pairing ? t("remote.ui.pairADevice", "Pair a device") : t("remote.ui.remoteAccess", "Remote access") }), /* @__PURE__ */ jsx(DialogDescription, { children: pairing ? t("remote.ui.scanThisWithTheDeviceYouWantToUseYouWillBeAskedToApproveItHere", "Scan this with the device you want to use. You will be asked to approve it here.") : t("remote.ui.reachThisCockpitFromYourPhoneOverAPublicTunnel", "Reach this cockpit from your phone over a public tunnel.") })] }),
1814
1866
  /* @__PURE__ */ jsxs(DialogBody, {
1815
1867
  className: "flex flex-col gap-5",
1816
1868
  children: [
1817
1869
  /* @__PURE__ */ jsx("p", {
1818
1870
  className: "text-sm leading-relaxed text-po-dim",
1819
- children: "A paired device can prompt the agent, approve its tool calls, and run shell commands as you. Pair only devices you hold, and only when you mean to."
1871
+ children: t("remote.ui.aPairedDeviceCanPromptTheAgentApproveItsToolCallsAndRunShellCommandsAsYouPairOnlyDevicesYouHoldAndOnlyWhenYouMeanTo", "A paired device can prompt the agent, approve its tool calls, and run shell commands as you. Pair only devices you hold, and only when you mean to.")
1820
1872
  }),
1821
1873
  pairing ? /* @__PURE__ */ jsx(RemoteAccessPairing, {}) : /* @__PURE__ */ jsx(RemoteAccessOptions, {}),
1822
1874
  state.error === void 0 ? null : /* @__PURE__ */ jsx("p", {
@@ -1832,30 +1884,30 @@ function RemoteAccessDialog() {
1832
1884
  variant: "ghost",
1833
1885
  disabled: starting,
1834
1886
  onClick: () => chooseRemoteRoute("relay"),
1835
- children: "Use private relay"
1887
+ children: t("remote.ui.usePrivateRelay", "Use private relay")
1836
1888
  }) : null, view?.status === "on" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
1837
1889
  variant: "danger-outline",
1838
1890
  "data-testid": "remote-access-off",
1839
1891
  disabled: state.busy,
1840
1892
  onClick: () => void turnRemoteAccessOff(),
1841
- children: "Turn off"
1893
+ children: t("remote.ui.turnOff", "Turn off")
1842
1894
  }), pairing ? /* @__PURE__ */ jsx(Button, {
1843
1895
  variant: "ghost",
1844
1896
  "data-testid": "remote-access-back",
1845
1897
  onClick: showRemoteOptions,
1846
- children: "Options"
1898
+ children: t("remote.ui.options", "Options")
1847
1899
  }) : /* @__PURE__ */ jsx(Button, {
1848
1900
  variant: "primary",
1849
1901
  "data-testid": "remote-access-pair",
1850
1902
  disabled: state.busy,
1851
1903
  onClick: () => void newPairingCode(),
1852
- children: "Pair a device"
1904
+ children: t("remote.ui.pairADevice", "Pair a device")
1853
1905
  })] }) : /* @__PURE__ */ jsxs(Button, {
1854
1906
  variant: "primary",
1855
1907
  "data-testid": "remote-access-on",
1856
1908
  disabled: starting,
1857
1909
  onClick: () => void turnRemoteAccessOn(),
1858
- children: [starting ? /* @__PURE__ */ jsx(Spinner, {}) : null, "Turn on and show the code"]
1910
+ children: [starting ? /* @__PURE__ */ jsx(Spinner, {}) : null, t("remote.ui.turnOnAndShowTheCode", "Turn on and show the code")]
1859
1911
  })]
1860
1912
  })
1861
1913
  ]
@@ -1879,22 +1931,6 @@ var start_web_default = defineWebLifecycle(() => {
1879
1931
  return stop;
1880
1932
  });
1881
1933
  //#endregion
1882
- //#region src/extensions/(frontend)/_lib/remoteSummary.ts
1883
- /** The one-line state a settings list shows beside Remote control, such as "On · po.example.com". */
1884
- function remoteSummaryText(remote) {
1885
- if (remote.status === "on") return remote.publicUrl ? `On · ${remote.publicUrl.replace(/^https?:\/\//u, "")}` : "On";
1886
- if (remote.status === "starting") return "Starting";
1887
- if (remote.status === "failed") return remote.error ? `Failed · ${remote.error}` : "Failed";
1888
- return "Off";
1889
- }
1890
- /** Reads the state through the host's transport; any failure shows no summary rather than a wrong one. */
1891
- async function readRemoteSummary(request) {
1892
- const response = await request(REMOTE_API_ROUTE);
1893
- if (!response.ok) return void 0;
1894
- const body = await response.json();
1895
- return body.state === void 0 ? void 0 : remoteSummaryText(body.state);
1896
- }
1897
- //#endregion
1898
1934
  //#region src/extensions/(frontend)/setting/_components/TunnelSettings.tsx
1899
1935
  const PUBLIC_HOSTNAME = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/iu;
1900
1936
  function namedTunnel(tunnel) {
@@ -1907,17 +1943,18 @@ function optional(value) {
1907
1943
  const trimmed = value.trim();
1908
1944
  return trimmed === "" ? void 0 : trimmed;
1909
1945
  }
1910
- const TUNNEL_KINDS = [{
1911
- kind: "quick",
1912
- label: "Quick tunnel",
1913
- detail: "No account needed. The address changes each time."
1914
- }, {
1915
- kind: "named",
1916
- label: "Named tunnel",
1917
- detail: "Your own domain, and the address stays put."
1918
- }];
1919
1946
  /** Selects a rotating quick tunnel or the stable named tunnel needed for a custom domain and passkeys. */
1920
1947
  function TunnelSettings({ tunnel }) {
1948
+ const t = useT();
1949
+ const TUNNEL_KINDS = [{
1950
+ kind: "quick",
1951
+ label: t("remote.ui.quickTunnel", "Quick tunnel"),
1952
+ detail: t("remote.ui.noAccountNeededTheAddressChangesEachTime", "No account needed. The address changes each time.")
1953
+ }, {
1954
+ kind: "named",
1955
+ label: t("remote.ui.namedTunnel", "Named tunnel"),
1956
+ detail: t("remote.ui.yourOwnDomainAndTheAddressStaysPut", "Your own domain, and the address stays put.")
1957
+ }];
1921
1958
  const [draft, setDraft] = useUiState("tunnel/draft", tunnel);
1922
1959
  const [lastTunnel, setLastTunnel] = useUiState("tunnel/source", tunnel);
1923
1960
  const [busy, setBusy, busyState] = useUiState("tunnel/saving", false);
@@ -1960,12 +1997,12 @@ function TunnelSettings({ tunnel }) {
1960
1997
  return /* @__PURE__ */ jsxs(SettingsSection, {
1961
1998
  "data-testid": "remote-tunnel-settings",
1962
1999
  children: [
1963
- /* @__PURE__ */ jsxs(SettingsSectionHeader, { children: [/* @__PURE__ */ jsx(SettingsSectionTitle, { children: "Tunnel" }), /* @__PURE__ */ jsx(SettingsSectionDescription, { children: "How your other devices reach Po. A named tunnel gives you a stable address, which passkeys need." })] }),
2000
+ /* @__PURE__ */ jsxs(SettingsSectionHeader, { children: [/* @__PURE__ */ jsx(SettingsSectionTitle, { children: t("remote.ui.tunnel", "Tunnel") }), /* @__PURE__ */ jsx(SettingsSectionDescription, { children: t("remote.ui.howYourOtherDevicesReachPoANamedTunnelGivesYouAStableAddressWhichPasskeysNeed", "How your other devices reach Po. A named tunnel gives you a stable address, which passkeys need.") })] }),
1964
2001
  /* @__PURE__ */ jsx(RadioGroup, {
1965
2002
  value: draft.kind,
1966
2003
  onValueChange: (kind) => setDraft(kind === "named" ? namedTunnel(draft) : { kind: "quick" }),
1967
2004
  className: "grid grid-cols-1 gap-3 min-[480px]:grid-cols-2",
1968
- "aria-label": "Tunnel type",
2005
+ "aria-label": t("remote.ui.tunnelType", "Tunnel type"),
1969
2006
  children: TUNNEL_KINDS.map((option) => /* @__PURE__ */ jsxs(RadioGroupCard, {
1970
2007
  value: option.kind,
1971
2008
  "data-testid": `remote-tunnel-${option.kind}`,
@@ -1985,11 +2022,11 @@ function TunnelSettings({ tunnel }) {
1985
2022
  draft.kind === "named" ? /* @__PURE__ */ jsxs(SettingsCard, { children: [
1986
2023
  /* @__PURE__ */ jsx(SettingsField, {
1987
2024
  id: "remote-tunnel-hostname",
1988
- label: "Hostname",
2025
+ label: t("remote.ui.hostname", "Hostname"),
1989
2026
  description: invalidHostname ? /* @__PURE__ */ jsx("span", {
1990
2027
  className: "text-po-red",
1991
- children: "Enter the hostname only, without https://, a port or a path."
1992
- }) : "The domain your devices will open.",
2028
+ children: t("remote.ui.enterTheHostnameOnlyWithoutHttpsAPortOrAPath", "Enter the hostname only, without https://, a port or a path.")
2029
+ }) : t("remote.ui.theDomainYourDevicesWillOpen", "The domain your devices will open."),
1993
2030
  children: /* @__PURE__ */ jsx(Input, {
1994
2031
  id: "remote-tunnel-hostname",
1995
2032
  "data-testid": "remote-tunnel-hostname",
@@ -2003,8 +2040,8 @@ function TunnelSettings({ tunnel }) {
2003
2040
  }),
2004
2041
  /* @__PURE__ */ jsx(SettingsField, {
2005
2042
  id: "remote-tunnel-token-file",
2006
- label: "Token file",
2007
- description: "A local file holding your Cloudflare connector token. Po reads the file and never stores the token itself.",
2043
+ label: t("remote.ui.tokenFile", "Token file"),
2044
+ description: t("remote.ui.aLocalFileHoldingYourCloudflareConnectorTokenPoReadsTheFileAndNeverStoresTheTokenItself", "A local file holding your Cloudflare connector token. Po reads the file and never stores the token itself."),
2008
2045
  children: /* @__PURE__ */ jsx(Input, {
2009
2046
  id: "remote-tunnel-token-file",
2010
2047
  "data-testid": "remote-tunnel-token-file",
@@ -2019,12 +2056,12 @@ function TunnelSettings({ tunnel }) {
2019
2056
  className: "group",
2020
2057
  children: [/* @__PURE__ */ jsx("summary", {
2021
2058
  className: "cursor-pointer px-5 py-3 text-sm text-po-dim hover:text-po-hi",
2022
- children: "Tunnel you manage with cloudflared"
2059
+ children: t("remote.ui.tunnelYouManageWithCloudflared", "Tunnel you manage with cloudflared")
2023
2060
  }), /* @__PURE__ */ jsxs("div", {
2024
2061
  className: "flex flex-col divide-y divide-po-border-soft border-t border-po-border-soft",
2025
2062
  children: [/* @__PURE__ */ jsx(SettingsField, {
2026
2063
  id: "remote-tunnel-name",
2027
- label: "Tunnel name",
2064
+ label: t("remote.ui.tunnelName", "Tunnel name"),
2028
2065
  children: /* @__PURE__ */ jsx(Input, {
2029
2066
  id: "remote-tunnel-name",
2030
2067
  "data-testid": "remote-tunnel-name",
@@ -2036,7 +2073,7 @@ function TunnelSettings({ tunnel }) {
2036
2073
  })
2037
2074
  }), /* @__PURE__ */ jsx(SettingsField, {
2038
2075
  id: "remote-tunnel-config-file",
2039
- label: "Config file",
2076
+ label: t("remote.ui.configFile", "Config file"),
2040
2077
  children: /* @__PURE__ */ jsx(Input, {
2041
2078
  id: "remote-tunnel-config-file",
2042
2079
  "data-testid": "remote-tunnel-config-file",
@@ -2057,14 +2094,16 @@ function TunnelSettings({ tunnel }) {
2057
2094
  loading: busy,
2058
2095
  disabled: busy || !changed || invalidHostname,
2059
2096
  onClick: () => void save(),
2060
- children: "Save tunnel"
2097
+ children: t("remote.ui.saveTunnel", "Save tunnel")
2061
2098
  }), /* @__PURE__ */ jsxs(SettingsNote, { children: [
2062
- "Takes effect the next time remote access starts. Install ",
2099
+ t("remote.ui.takesEffectTheNextTimeRemoteAccessStartsInstall", "Takes effect the next time remote access starts. Install"),
2100
+ " ",
2063
2101
  /* @__PURE__ */ jsx("code", {
2064
2102
  className: "font-mono",
2065
2103
  children: "cloudflared"
2066
2104
  }),
2067
- " on this machine first."
2105
+ " ",
2106
+ t("remote.ui.onThisMachineFirst", "on this machine first.")
2068
2107
  ] })] })
2069
2108
  ]
2070
2109
  });
@@ -2076,6 +2115,7 @@ function TunnelSettings({ tunnel }) {
2076
2115
  * frames the page with its label and detail, so this draws only the body.
2077
2116
  */
2078
2117
  function RemoteControlSettings() {
2118
+ const t = useT();
2079
2119
  const state = useStore(remoteAccessStore);
2080
2120
  useEffect(() => {
2081
2121
  refreshRemoteState();
@@ -2084,16 +2124,16 @@ function RemoteControlSettings() {
2084
2124
  return /* @__PURE__ */ jsxs("div", {
2085
2125
  "data-testid": "remote-control-settings",
2086
2126
  className: "flex flex-col gap-8",
2087
- children: [/* @__PURE__ */ jsx(SettingsDescription, { children: "You turn access on and pair devices from the remote access dialog; this page holds what stays the same between visits." }), state.view === void 0 && state.error ? /* @__PURE__ */ jsx(SettingsCard, { children: /* @__PURE__ */ jsxs(SettingsRow, {
2127
+ children: [/* @__PURE__ */ jsx(SettingsDescription, { children: t("remote.ui.youTurnAccessOnAndPairDevicesFromTheRemoteAccessDialogThisPageHoldsWhatStaysTheSameBetweenVisits", "You turn access on and pair devices from the remote access dialog; this page holds what stays the same between visits.") }), state.view === void 0 && state.error ? /* @__PURE__ */ jsx(SettingsCard, { children: /* @__PURE__ */ jsxs(SettingsRow, {
2088
2128
  title: state.error,
2089
2129
  children: [/* @__PURE__ */ jsxs(SettingsRowText, {
2090
2130
  role: "alert",
2091
- children: [/* @__PURE__ */ jsx(SettingsRowTitle, { children: "Po couldn't read your remote settings just now" }), /* @__PURE__ */ jsx(SettingsRowDescription, { children: "Nothing has changed. Remote access is as you left it." })]
2131
+ children: [/* @__PURE__ */ jsx(SettingsRowTitle, { children: t("remote.ui.poCouldnAposTReadYourRemoteSettingsJustNow", "Po couldn't read your remote settings just now") }), /* @__PURE__ */ jsx(SettingsRowDescription, { children: t("remote.ui.nothingHasChangedRemoteAccessIsAsYouLeftIt", "Nothing has changed. Remote access is as you left it.") })]
2092
2132
  }), /* @__PURE__ */ jsx(Button, {
2093
2133
  variant: "outline",
2094
2134
  size: "sm",
2095
2135
  onClick: () => void refreshRemoteState(),
2096
- children: "Try again"
2136
+ children: t("remote.ui.tryAgain", "Try again")
2097
2137
  })]
2098
2138
  }) }) : state.view === void 0 ? /* @__PURE__ */ jsxs(SettingsCard, {
2099
2139
  role: "status",
@@ -2102,7 +2142,7 @@ function RemoteControlSettings() {
2102
2142
  children: [
2103
2143
  /* @__PURE__ */ jsx("span", {
2104
2144
  className: "sr-only",
2105
- children: "Reading remote settings"
2145
+ children: t("remote.ui.readingRemoteSettings", "Reading remote settings")
2106
2146
  }),
2107
2147
  /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-48" }),
2108
2148
  /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-72" })