Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

feat(spaces): core returns message codes for the sidebar (CUA-1928) (#5608)

Francesco Bonacci4cddeec83088
diff --git a/apps/cua-spaces-desktop/src/bridge/machines.ts b/apps/cua-spaces-desktop/src/bridge/machines.ts
index fbf9cf0d23..5f0b7b8b50 100644
--- a/apps/cua-spaces-desktop/src/bridge/machines.ts
+++ b/apps/cua-spaces-desktop/src/bridge/machines.ts
@@ -12,6 +12,7 @@ import { withTimeout } from "../model/time";
import { optionalString, string } from "./args";
import type { BridgeContext } from "./context";
import { Failure, type Handlers } from "./host";
+import { messageText } from "../../../cua-spaces-web/src/lib/messages";
import { encode } from "./value";
/** This machine as a host (the core's flattened `HostStatus`), plus its relay machine id and setup progress; null until it answered. */
@@ -34,7 +35,8 @@ export function machinesState(model: AppModel) {
const sidebar = model.sidebar;
const devices = model.devices;
return {
- thisMachine: encode(sidebar.thisMachine),
+ // The web page reads the status as text.
+ thisMachine: sidebar.thisMachine ? { ...(encode(sidebar.thisMachine) as Record<string, unknown>), statusText: messageText({ code: sidebar.thisMachine.statusText.code, vars: Object.fromEntries(sidebar.thisMachine.statusText.vars) }) } : null,
sections: encode(sidebar.sections),
devices: devices.snapshot === null ? null : encode(devices.view),
accessNotice: encode(devices.accessNotice),
diff --git a/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts b/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
index 13dde05469..a116b005a7 100644
--- a/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
+++ b/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
@@ -33319,9 +33319,10 @@ export type AppPowerButton = {
symbol: string,
/**
* Tooltip and accessibility label: "Suspend", "Resume", "Turn off" or
- * "Turn on"; while it runs, "Suspending…" and the like.
+ * "Turn on" (`spaces.power.*`); while it runs, "Suspending…" and the
+ * like (`spaces.status.*`).
*/
- help: string,
+ help: AppMsg,
/**
* A press turns it on (else off): the shell's SDK call.
*/
@@ -33358,7 +33359,7 @@ const FfiConverterTypeAppPowerButton = (() => {
read(from: RustBuffer): TypeName {
return {
symbol: FfiConverterString.read(from),
- help: FfiConverterString.read(from),
+ help: FfiConverterTypeAppMsg.read(from),
turnOn: FfiConverterBool.read(from),
enabled: FfiConverterBool.read(from),
busy: FfiConverterBool.read(from)
@@ -33366,14 +33367,14 @@ const FfiConverterTypeAppPowerButton = (() => {
}
write(value: TypeName, into: RustBuffer): void {
FfiConverterString.write(value.symbol, into);
- FfiConverterString.write(value.help, into);
+ FfiConverterTypeAppMsg.write(value.help, into);
FfiConverterBool.write(value.turnOn, into);
FfiConverterBool.write(value.enabled, into);
FfiConverterBool.write(value.busy, into);
}
allocationSize(value: TypeName): number {
return FfiConverterString.allocationSize(value.symbol) +
- FfiConverterString.allocationSize(value.help) +
+ FfiConverterTypeAppMsg.allocationSize(value.help) +
FfiConverterBool.allocationSize(value.turnOn) +
FfiConverterBool.allocationSize(value.enabled) +
FfiConverterBool.allocationSize(value.busy);
@@ -37529,7 +37530,7 @@ export type AppSidebarRow = {
/**
* Status word (the dot's accessibility label).
*/
- statusText: string,
+ statusText: AppMsg,
/**
* Tooltip.
*/
@@ -37593,7 +37594,7 @@ const FfiConverterTypeAppSidebarRow = (() => {
name: FfiConverterString.read(from),
osIcon: FfiConverterString.read(from),
status: FfiConverterTypeAppSpaceStatus.read(from),
- statusText: FfiConverterString.read(from),
+ statusText: FfiConverterTypeAppMsg.read(from),
detail: FfiConverterString.read(from),
dim: FfiConverterBool.read(from),
selected: FfiConverterBool.read(from),
@@ -37609,7 +37610,7 @@ const FfiConverterTypeAppSidebarRow = (() => {
FfiConverterString.write(value.name, into);
FfiConverterString.write(value.osIcon, into);
FfiConverterTypeAppSpaceStatus.write(value.status, into);
- FfiConverterString.write(value.statusText, into);
+ FfiConverterTypeAppMsg.write(value.statusText, into);
FfiConverterString.write(value.detail, into);
FfiConverterBool.write(value.dim, into);
FfiConverterBool.write(value.selected, into);
@@ -37624,7 +37625,7 @@ const FfiConverterTypeAppSidebarRow = (() => {
FfiConverterString.allocationSize(value.name) +
FfiConverterString.allocationSize(value.osIcon) +
FfiConverterTypeAppSpaceStatus.allocationSize(value.status) +
- FfiConverterString.allocationSize(value.statusText) +
+ FfiConverterTypeAppMsg.allocationSize(value.statusText) +
FfiConverterString.allocationSize(value.detail) +
FfiConverterBool.allocationSize(value.dim) +
FfiConverterBool.allocationSize(value.selected) +
@@ -37641,9 +37642,10 @@ const FfiConverterTypeAppSidebarRow = (() => {
export type AppSidebarSection = {
/**
- * "Cua Cloud", "This Mac", "Connected", "My machines".
+ * "Cua Cloud", "This Mac", "Connected", "My computers"
+ * (`spaces.sidebar.section.*`).
*/
- title: string,
+ title: AppMsg,
/**
* Rows.
*/
@@ -37671,16 +37673,16 @@ const FfiConverterTypeAppSidebarSection = (() => {
class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
read(from: RustBuffer): TypeName {
return {
- title: FfiConverterString.read(from),
+ title: FfiConverterTypeAppMsg.read(from),
rows: FfiConverterSequenceTypeAppSidebarRow.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
- FfiConverterString.write(value.title, into);
+ FfiConverterTypeAppMsg.write(value.title, into);
FfiConverterSequenceTypeAppSidebarRow.write(value.rows, into);
}
allocationSize(value: TypeName): number {
- return FfiConverterString.allocationSize(value.title) +
+ return FfiConverterTypeAppMsg.allocationSize(value.title) +
FfiConverterSequenceTypeAppSidebarRow.allocationSize(value.rows);
}
@@ -37702,9 +37704,10 @@ export type AppSidebarView = {
*/
selectedId?: string,
/**
- * "No matches" / "No Spaces yet" when nothing is listed.
+ * "No matches" / "No Spaces yet" when nothing is listed
+ * (`spaces.sidebar.*`).
*/
- emptyText?: string
+ emptyText?: AppMsg
}
/**
@@ -37731,20 +37734,20 @@ const FfiConverterTypeAppSidebarView = (() => {
thisMachine: FfiConverterOptionalTypeAppSidebarRow.read(from),
sections: FfiConverterSequenceTypeAppSidebarSection.read(from),
selectedId: FfiConverterOptionalString.read(from),
- emptyText: FfiConverterOptionalString.read(from)
+ emptyText: FfiConverterOptionalTypeAppMsg.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
FfiConverterOptionalTypeAppSidebarRow.write(value.thisMachine, into);
FfiConverterSequenceTypeAppSidebarSection.write(value.sections, into);
FfiConverterOptionalString.write(value.selectedId, into);
- FfiConverterOptionalString.write(value.emptyText, into);
+ FfiConverterOptionalTypeAppMsg.write(value.emptyText, into);
}
allocationSize(value: TypeName): number {
return FfiConverterOptionalTypeAppSidebarRow.allocationSize(value.thisMachine) +
FfiConverterSequenceTypeAppSidebarSection.allocationSize(value.sections) +
FfiConverterOptionalString.allocationSize(value.selectedId) +
- FfiConverterOptionalString.allocationSize(value.emptyText);
+ FfiConverterOptionalTypeAppMsg.allocationSize(value.emptyText);
}
};
@@ -63377,6 +63380,9 @@ const FfiConverterOptionalTypeAppSidebarRow = new FfiConverterOptional(FfiConver
// FfiConverter for Array<AppSidebarSection>
const FfiConverterSequenceTypeAppSidebarSection = new FfiConverterArray(FfiConverterTypeAppSidebarSection);
+// FfiConverter for AppMsg | undefined
+const FfiConverterOptionalTypeAppMsg = new FfiConverterOptional(FfiConverterTypeAppMsg);
+
// FfiConverter for Array<AppDetailAction>
const FfiConverterSequenceTypeAppDetailAction = new FfiConverterArray(FfiConverterTypeAppDetailAction);
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Resources/Localizable.xcstrings b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Resources/Localizable.xcstrings
index 2fbb929cef..6b6c54ff07 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Resources/Localizable.xcstrings
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Resources/Localizable.xcstrings
@@ -99,6 +99,281 @@
}
}
}
+ },
+ "spaces.sidebar.section.cloud": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Cua Cloud"
+ }
+ }
+ }
+ },
+ "spaces.sidebar.section.this_mac": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "This Mac"
+ }
+ }
+ }
+ },
+ "spaces.sidebar.section.connected": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Connected"
+ }
+ }
+ }
+ },
+ "spaces.sidebar.section.my_computers": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "My computers"
+ }
+ }
+ }
+ },
+ "spaces.sidebar.empty": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "No Spaces yet"
+ }
+ }
+ }
+ },
+ "spaces.sidebar.no_matches": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "No matches"
+ }
+ }
+ }
+ },
+ "spaces.status.failed": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Failed"
+ }
+ }
+ }
+ },
+ "spaces.status.cancelling": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Cancelling…"
+ }
+ }
+ }
+ },
+ "spaces.status.this_mac": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "This Mac"
+ }
+ }
+ }
+ },
+ "spaces.status.running": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Running"
+ }
+ }
+ }
+ },
+ "spaces.status.local": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Local"
+ }
+ }
+ }
+ },
+ "spaces.status.approval": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Needs approval"
+ }
+ }
+ }
+ },
+ "spaces.status.suspended": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Suspended"
+ }
+ }
+ }
+ },
+ "spaces.status.starting": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Starting"
+ }
+ }
+ }
+ },
+ "spaces.status.deleting": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Deleting…"
+ }
+ }
+ }
+ },
+ "spaces.status.stopped": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Stopped"
+ }
+ }
+ }
+ },
+ "spaces.status.stopped_reason": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Stopped: {reason}"
+ }
+ }
+ }
+ },
+ "spaces.status.suspending": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Suspending…"
+ }
+ }
+ }
+ },
+ "spaces.status.resuming": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Resuming…"
+ }
+ }
+ }
+ },
+ "spaces.status.turning_off": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Turning off…"
+ }
+ }
+ }
+ },
+ "spaces.status.turning_on": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Turning on…"
+ }
+ }
+ }
+ },
+ "spaces.power.suspend": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Suspend"
+ }
+ }
+ }
+ },
+ "spaces.power.resume": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Resume"
+ }
+ }
+ }
+ },
+ "spaces.power.turn_off": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Turn off"
+ }
+ }
+ }
+ },
+ "spaces.power.turn_on": {
+ "extractionState": "manual",
+ "localizations": {
+ "en": {
+ "stringUnit": {
+ "state": "translated",
+ "value": "Turn on"
+ }
+ }
+ }
}
},
"version": "1.0"
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CommandPaletteView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CommandPaletteView.swift
index c11872f2e4..226736c3f7 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CommandPaletteView.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CommandPaletteView.swift
@@ -237,7 +237,7 @@ struct CommandPaletteView: View {
let rows = appSidebar(spaces: model.spaces, query: "", selectedId: "").sections.flatMap(\.rows)
for space in model.realSpaces {
let row = rows.first { $0.id == space.id }
- let hint = row?.statusText
+ let hint = row.map { CoreMessages.text($0.statusText) }
let keywords = "\(row?.osIcon ?? "") \(hint ?? "")"
out.append(Command(id: "space:open:\(space.id)", entry: entry("Spaces", "Open \(space.name)", hint: hint, keywords: keywords),
osIcon: row?.osIcon) { model.selection = .space(space.id) })
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/MainWindow.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/MainWindow.swift
index b6d495df7b..3dc7badfc6 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/MainWindow.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/MainWindow.swift
@@ -168,15 +168,15 @@ struct Sidebar: View {
if let row = sidebar.thisMachine {
spaceRow(row)
}
- ForEach(sidebar.sections, id: \.title) { section in
- Section(section.title) {
+ ForEach(sidebar.sections, id: \.title.code) { section in
+ Section(CoreMessages.text(section.title)) {
ForEach(section.rows, id: \.id) { row in
spaceRow(row)
}
}
}
if let empty = sidebar.emptyText, sidebar.thisMachine == nil, model.rosterError == nil {
- Text(empty).foregroundStyle(.secondary)
+ Text(CoreMessages.text(empty)).foregroundStyle(.secondary)
}
Section {
ForEach(kv.sidebar.categories, id: \.category) { row in
@@ -298,7 +298,7 @@ struct SpaceRowView: View {
.font(.callout.monospacedDigit())
.foregroundStyle(.secondary)
ProgressRing(permille: progress)
- .accessibilityLabel(row.statusText)
+ .accessibilityLabel(CoreMessages.text(row.statusText))
} else {
if let trailing = row.trailing {
// The create or the power action failed: why, inline.
@@ -319,7 +319,7 @@ struct SpaceRowView: View {
Circle()
.fill(color)
.frame(width: 7, height: 7)
- .accessibilityLabel(row.statusText)
+ .accessibilityLabel(CoreMessages.text(row.statusText))
}
}
// A Space one of your machines provides sits under that machine.
@@ -383,8 +383,8 @@ struct PowerButton: View {
}
.buttonStyle(.borderless)
.disabled(!button.enabled)
- .help(button.help)
- .accessibilityLabel(button.help)
+ .help(CoreMessages.text(button.help))
+ .accessibilityLabel(CoreMessages.text(button.help))
.accessibilityIdentifier("space-power")
}
}
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift
index 71a77afd08..b333acd3ff 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift
@@ -469,7 +469,12 @@ final class WebUIBridge: NSObject, WKScriptMessageHandlerWithReply {
func machines() -> [String: Any] {
let sidebar = model.sidebar
return [
- "thisMachine": BridgeValue.encode(sidebar.thisMachine),
+ // The web page reads the status as text.
+ "thisMachine": sidebar.thisMachine.map { row -> Any in
+ var out = BridgeValue.encode(row) as? [String: Any] ?? [:]
+ out["statusText"] = CoreMessages.text(row.statusText)
+ return out
+ } ?? NSNull(),
"sections": BridgeValue.encode(sidebar.sections),
"devices": model.devices.snapshot == nil ? NSNull() : BridgeValue.encode(model.devices.view),
"accessNotice": BridgeValue.encode(model.devices.accessNotice),
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/MachineAccessTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/MachineAccessTests.swift
index d39c5fc0d5..fe1c0686de 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/MachineAccessTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/MachineAccessTests.swift
@@ -157,7 +157,7 @@ struct MachineAccessTests {
let notice = try #require(m.devices.accessNotice)
#expect(notice.kind == kind)
// Every machine is still listed under My machines.
- let mine = try #require(m.sidebar.sections.first { $0.title == "My computers" })
+ let mine = try #require(m.sidebar.sections.first { $0.title.code == "spaces.sidebar.section.my_computers" })
#expect(mine.rows.map(\.id).contains("relay:m-studio"))
#expect(mine.rows.map(\.id).contains("relay:m-mini"))
let d = m.detail(try space(m, "relay:m-studio"))
@@ -222,7 +222,7 @@ struct MachineAccessTests {
let m = await MachinesFixture.model(rows: MachinesFixture.rows(includeSelf: true), enrollment: .enrolled,
hostSetUp: true)
#expect(m.sidebar.thisMachine != nil)
- let mine = try #require(m.sidebar.sections.first { $0.title == "My computers" })
+ let mine = try #require(m.sidebar.sections.first { $0.title.code == "spaces.sidebar.section.my_computers" })
let ids = mine.rows.map(\.id)
#expect(!ids.contains("relay:\(MachinesFixture.thisMacId)"))
#expect(ids.contains("relay:m-dana-2"))
@@ -259,7 +259,7 @@ struct MachineAccessTests {
let m = await MachinesFixture.model(rows: [FixtureSpacesBackend.sample[0], mac, me],
enrollment: .enrolled, hostSetUp: true, hostStatus: status)
#expect(m.sidebar.thisMachine != nil)
- let mine = try #require(m.sidebar.sections.first { $0.title == "My computers" },
+ let mine = try #require(m.sidebar.sections.first { $0.title.code == "spaces.sidebar.section.my_computers" },
"no My computers for \(features) \(String(describing: error))")
#expect(mine.rows.map(\.id) == [other])
}
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift
index aae946a42f..d27acb8dfc 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift
@@ -241,11 +241,11 @@ struct ParityTests {
[
"thisMachine": opt(v.thisMachine?.name),
"sections": v.sections.map { sec in
- "\(sec.title): " + sec.rows.map { "\($0.name)\($0.dim ? " (dim)" : "")\($0.selected ? " (selected)" : "")" }
+ "\(sec.title.code): " + sec.rows.map { "\($0.name)\($0.dim ? " (dim)" : "")\($0.selected ? " (selected)" : "")" }
.joined(separator: ", ")
},
"selectedId": opt(v.selectedId),
- "emptyText": opt(v.emptyText),
+ "emptyText": opt(v.emptyText?.code),
]
}
@@ -359,7 +359,7 @@ struct ParityTests {
let spaces = roster.spaces
let sb = appSidebar(spaces: spaces, query: "", selectedId: roster.selectedId)
let rows = sb.sections.flatMap(\.rows).map { r in
- "\(r.osIcon) \(r.name) [\(r.statusText)] \(r.progress.map(String.init) ?? "-") \(r.trailing ?? "-")\(powerText(r.power))"
+ "\(r.osIcon) \(r.name) [\(r.statusText.code)] \(r.progress.map(String.init) ?? "-") \(r.trailing ?? "-")\(powerText(r.power))"
}
let closed = appNotchView(state: appNotchInitial(), spaces: spaces)
// The open panel's tiles (the Rust flow reads `notch.tiles`: the same list).
@@ -444,7 +444,7 @@ struct ParityTests {
/// A row's power button: ` <power Suspend>`, ` <power Resuming… on busy>`.
func powerText(_ b: AppPowerButton?) -> String {
guard let b else { return "" }
- return " <\(b.symbol) \(b.help)\(b.turnOn ? " on" : "")\(b.busy ? " busy" : "")>"
+ return " <\(b.symbol) \(b.help.code)\(b.turnOn ? " on" : "")\(b.busy ? " busy" : "")>"
}
// MARK: - space-power
@@ -1065,15 +1065,15 @@ struct ParityTests {
func dash(_ s: String?) -> String { s ?? "-" }
func sidebarRowLine(_ r: AppSidebarRow) -> String {
- "<\(r.osIcon)> \(r.name)\(r.place.map { " @ \($0)" } ?? "") | \(r.statusText) | \(r.detail)\(r.dim ? " (dim)" : "")\(r.selected ? " (selected)" : "")"
+ "<\(r.osIcon)> \(r.name)\(r.place.map { " @ \($0)" } ?? "") | \(r.statusText.code) | \(r.detail)\(r.dim ? " (dim)" : "")\(r.selected ? " (selected)" : "")"
}
func windowSidebar(_ v: AppSidebarView) -> [String: Any] {
[
"thisMachine": v.thisMachine.map(sidebarRowLine) as Any? ?? NSNull(),
- "sections": v.sections.flatMap { ["# \($0.title)"] + $0.rows.map(sidebarRowLine) },
+ "sections": v.sections.flatMap { ["# \($0.title.code)"] + $0.rows.map(sidebarRowLine) },
"selectedId": opt(v.selectedId),
- "emptyText": opt(v.emptyText),
+ "emptyText": opt(v.emptyText?.code),
]
}
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift
index be01a1fea4..ee74f1c0dd 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift
@@ -575,8 +575,8 @@ struct ViewModelTests {
@Test func refreshBuildsTheSidebarFromTheCore() async {
let model = makeModel()
await model.refresh()
- let titles = model.sidebar.sections.map(\.title)
- #expect(titles == ["Cua Cloud", "This Mac", "Connected"])
+ let titles = model.sidebar.sections.map(\.title.code)
+ #expect(titles == ["spaces.sidebar.section.cloud", "spaces.sidebar.section.this_mac", "spaces.sidebar.section.connected"])
// The container hostname defers to the name in the id.
#expect(model.spaces.contains { $0.name == "aurora" })
// An unreachable Space is dimmed and cannot stream.
@@ -591,7 +591,7 @@ struct ViewModelTests {
model.query = "auro"
#expect(model.sidebar.sections.flatMap(\.rows).map(\.name) == ["aurora"])
model.query = "zzz"
- #expect(model.sidebar.emptyText == "No matches")
+ #expect(model.sidebar.emptyText?.code == "spaces.sidebar.no_matches")
}
@Test func wizardWalksToALocalPlanAndCreates() async {
@@ -836,7 +836,7 @@ struct ViewModelTests {
}
let failed = try #require(row)
#expect(failed.trailing == "no local runtime found" && failed.progress == nil)
- #expect(failed.statusText == "Failed" && failed.dim)
+ #expect(failed.statusText.code == "spaces.status.failed" && failed.dim)
#expect(model.banner == nil, "the error is on the row, not a banner")
let space = try #require(model.spaces.first { $0.id == failed.id })
let detail = model.detail(space)
@@ -925,7 +925,7 @@ struct ViewModelTests {
try await Task.sleep(for: .milliseconds(10))
}
#expect(!model.spaces.contains { $0.id == id })
- #expect(!model.sidebar.sections.flatMap(\.rows).contains { $0.statusText == "Failed" })
+ #expect(!model.sidebar.sections.flatMap(\.rows).contains { $0.statusText.code == "spaces.status.failed" })
#expect(backend.cancelRequests.isEmpty)
}
@@ -989,7 +989,7 @@ struct ViewModelTests {
model.delete(space)
// Synchronously, before the SDK has done anything.
let row = try #require(model.sidebar.sections.flatMap(\.rows).first { $0.id == space.id })
- #expect(row.status == .deleting && row.statusText == "Deleting\u{2026}" && row.dim)
+ #expect(row.status == .deleting && row.statusText.code == "spaces.status.deleting" && row.dim)
#expect(model.notch.view.activity?.kind == .deleting)
let deleting = try #require(model.spaces.first { $0.id == space.id })
let detail = model.detail(deleting)
@@ -1076,7 +1076,7 @@ struct ViewModelTests {
let row = { (id: String) in model.sidebar.sections.flatMap(\.rows).first { $0.id == id } }
#expect(row("cloud:builder")?.power == nil, "a cloud Space cannot be turned off")
let aurora = try #require(model.spaces.first { $0.id == "local:aurora" })
- #expect(row(aurora.id)?.power?.help == "Suspend")
+ #expect(row(aurora.id)?.power?.help.code == "spaces.power.suspend")
// Share before power (Sharing is on by default); none with Sharing turned off.
#expect(model.detail(aurora).actions.map(\.id) == [.teleport, .pip, .share, .power, .delete, .open])
model.chooseExperiment(row: "experiment:sharing", option: "off")
@@ -1086,27 +1086,27 @@ struct ViewModelTests {
model.setPower(aurora, on: false)
// Synchronously, before the SDK has done anything.
let busy = try #require(row(aurora.id)?.power)
- #expect(busy.busy && !busy.enabled && busy.help == "Suspending\u{2026}")
- #expect(row(aurora.id)?.statusText == "Suspending\u{2026}")
+ #expect(busy.busy && !busy.enabled && busy.help.code == "spaces.status.suspending")
+ #expect(row(aurora.id)?.statusText.code == "spaces.status.suspending")
let auroraNow = try #require(model.spaces.first { $0.id == aurora.id })
let action = try #require(model.detail(auroraNow).actions.first { $0.id == .power })
#expect(action.busy && !action.enabled)
model.setPower(aurora, on: false)
backend.releasePower()
- for _ in 0..<200 where row(aurora.id)?.power?.help != "Resume" {
+ for _ in 0..<200 where row(aurora.id)?.power?.help.code != "spaces.power.resume" {
try await Task.sleep(for: .milliseconds(10))
}
#expect(backend.powerRequests.map(\.id) == [aurora.id], "one press")
- #expect(row(aurora.id)?.statusText == "Stopped")
+ #expect(row(aurora.id)?.statusText.code == "spaces.status.stopped")
#expect(model.creates.powering.isEmpty, "settled once the registry showed it off")
let off = try #require(model.spaces.first { $0.id == aurora.id })
model.setPower(off, on: true)
- for _ in 0..<200 where row(aurora.id)?.power?.help != "Suspend" {
+ for _ in 0..<200 where row(aurora.id)?.power?.help.code != "spaces.power.suspend" {
try await Task.sleep(for: .milliseconds(10))
}
#expect(backend.powerRequests.map(\.on) == [false, true])
- #expect(row(aurora.id)?.statusText == "Running")
+ #expect(row(aurora.id)?.statusText.code == "spaces.status.running")
}
/// A failed power action shows why on the row and the detail, and the
diff --git a/apps/cua-spaces-web/src/lib/messages.ts b/apps/cua-spaces-web/src/lib/messages.ts
index 7acb09de46..b2c62b2082 100644
--- a/apps/cua-spaces-web/src/lib/messages.ts
+++ b/apps/cua-spaces-web/src/lib/messages.ts
@@ -16,6 +16,25 @@ export const MESSAGES: Record<string, string> = {
"teleport.sensitive.history.label": "Browsing history",
"teleport.sensitive.history.detail":
"Sends the history of pages visited, and the bookmarks where the browser keeps them together.",
+ "spaces.power.suspend": "Suspend",
+ "spaces.power.resume": "Resume",
+ "spaces.power.turn_off": "Turn off",
+ "spaces.power.turn_on": "Turn on",
+ "spaces.status.failed": "Failed",
+ "spaces.status.cancelling": "Cancelling…",
+ "spaces.status.this_mac": "This Mac",
+ "spaces.status.running": "Running",
+ "spaces.status.local": "Local",
+ "spaces.status.approval": "Needs approval",
+ "spaces.status.suspended": "Suspended",
+ "spaces.status.starting": "Starting",
+ "spaces.status.deleting": "Deleting…",
+ "spaces.status.stopped": "Stopped",
+ "spaces.status.stopped_reason": "Stopped: {reason}",
+ "spaces.status.suspending": "Suspending…",
+ "spaces.status.resuming": "Resuming…",
+ "spaces.status.turning_off": "Turning off…",
+ "spaces.status.turning_on": "Turning on…",
};
/** A core message as text: its English with the variables filled in. */
diff --git a/apps/cua-spaces-web/src/lib/spaces.test.ts b/apps/cua-spaces-web/src/lib/spaces.test.ts
index b46ff68ada..ce396932ee 100644
--- a/apps/cua-spaces-web/src/lib/spaces.test.ts
+++ b/apps/cua-spaces-web/src/lib/spaces.test.ts
@@ -146,7 +146,7 @@ describe("powerButton", () => {
const on = space("p", "running", 1, { power: { control: "suspend", off: false } });
it("follows the core when it answers", () => {
- const core = { tryCall: <T,>() => ({ symbol: "power", help: "Suspend", turnOn: false, enabled: true, busy: false }) as T };
+ const core = { tryCall: <T,>() => ({ symbol: "power", help: { code: "spaces.power.suspend", vars: {} }, turnOn: false, enabled: true, busy: false }) as T };
expect(powerButton(core, on)).toEqual({ help: "Suspend", turnOn: false, busy: false });
expect(powerButton({ tryCall: <T,>() => null as T }, on)).toBeNull();
});
diff --git a/apps/cua-spaces-web/src/lib/spaces.ts b/apps/cua-spaces-web/src/lib/spaces.ts
index 4da10cc752..a2e6dd8c87 100644
--- a/apps/cua-spaces-web/src/lib/spaces.ts
+++ b/apps/cua-spaces-web/src/lib/spaces.ts
@@ -4,6 +4,8 @@
import type { CoreClient, Machine, Space } from "@/bridge";
import { OS_NAME } from "@/components/os-icon";
import { thisComputerLabel } from "@/lib/host-labels";
+import { messageText } from "@/lib/messages";
+import type { Msg } from "../bridge/contracts/teleport";
/** The states the Spaces screens draw. The bridge's `SpaceStatus` maps onto these. */
export type SpaceState = "running" | "stopped" | "creating" | "deleting" | "failed";
@@ -153,8 +155,8 @@ export function canPower(space: Pick<Space, "status" | "power">): boolean {
* where the Space suspends. Without the core, the same words.
*/
export function powerLabel(core: { tryCall<T>(op: string, args?: Record<string, unknown>): T | undefined }, space: Space, on: boolean): string {
- const button = core.tryCall<{ help: string; turnOn: boolean; busy: boolean }>("sidebar.powerButton", { space });
- if (button && !button.busy && button.turnOn === on) return button.help;
+ const button = core.tryCall<{ help: Msg; turnOn: boolean; busy: boolean }>("sidebar.powerButton", { space });
+ if (button && !button.busy && button.turnOn === on) return messageText(button.help);
const suspends = space.power?.control === "suspend";
return on ? (suspends ? "Resume" : "Turn on") : suspends ? "Suspend" : "Turn off";
}
@@ -182,8 +184,8 @@ export interface PowerButton {
* core, the same rule and words.
*/
export function powerButton(core: { tryCall<T>(op: string, args?: Record<string, unknown>): T | undefined }, space: Space): PowerButton | null {
- const fromCore = core.tryCall<PowerButton | null>("sidebar.powerButton", { space });
- if (fromCore !== undefined) return fromCore ? { help: fromCore.help, turnOn: fromCore.turnOn, busy: fromCore.busy } : null;
+ const fromCore = core.tryCall<(Omit<PowerButton, "help"> & { help: Msg }) | null>("sidebar.powerButton", { space });
+ if (fromCore !== undefined) return fromCore ? { help: messageText(fromCore.help), turnOn: fromCore.turnOn, busy: fromCore.busy } : null;
const power = space.power;
if (!power || space.id === "this-mac" || space.progress || space.status === "deleting") return null;
const busy = power.turningOn !== undefined && power.turningOn !== null;
diff --git a/apps/cua-spaces/src/components/SpaceTile.tsx b/apps/cua-spaces/src/components/SpaceTile.tsx
index 049b3ea325..190cb3ac13 100644
--- a/apps/cua-spaces/src/components/SpaceTile.tsx
+++ b/apps/cua-spaces/src/components/SpaceTile.tsx
@@ -13,7 +13,7 @@ import { OsIcon } from "./OsIcon";
import { SfIcon } from "./SfIcon";
import { STATUS_LABEL, StatusDot } from "./StatusDot";
import { Thumbnail } from "./Thumbnail";
-import { useT } from "../i18n";
+import { tMsg, useT } from "../i18n";
interface SpaceTileProps {
space: Space;
@@ -212,8 +212,8 @@ export function SpaceTile({ space, focused, onFocus, onSelect, onPin, onShareApp
data-owns-enter
data-busy={power.busy ? "true" : undefined}
tabIndex={-1}
- aria-label={t("spaces.tile.power_label", { action: power.help, name: space.name })}
- title={power.help}
+ aria-label={t("spaces.tile.power_label", { action: tMsg(power.help), name: space.name })}
+ title={tMsg(power.help)}
disabled={!power.enabled}
onClick={(event) => {
event.stopPropagation();
diff --git a/apps/cua-spaces/src/components/desktop/MainWindow.tsx b/apps/cua-spaces/src/components/desktop/MainWindow.tsx
index 3b84f9e5fb..3aa1ffa5b7 100644
--- a/apps/cua-spaces/src/components/desktop/MainWindow.tsx
+++ b/apps/cua-spaces/src/components/desktop/MainWindow.tsx
@@ -77,7 +77,7 @@ import { useExperiments } from '../../state/experiments';
import { createLoginItemBridge, type LoginItemBridge } from '../../native/loginItem';
import { launchPlan, readLaunchChoice, writeLaunchChoice } from '../../model/loginItem';
import { Sym } from './Sym';
-import { useT } from "../../i18n";
+import { tMsg, useT } from "../../i18n";
export interface MainWindowProps {
fleet?: FleetBridge;
@@ -621,9 +621,9 @@ export function MainWindow({
</ul>
)}
{sidebar.sections.map((section) => (
- <div key={section.title}>
- <div className="dw-nav-section">{section.title}</div>
- <ul className="dw-nav-list" role="listbox" aria-label={section.title}>
+ <div key={section.title.code}>
+ <div className="dw-nav-section">{tMsg(section.title)}</div>
+ <ul className="dw-nav-list" role="listbox" aria-label={tMsg(section.title)}>
{section.rows.map((row) => (
<SpaceRowItem
key={row.id}
@@ -637,7 +637,7 @@ export function MainWindow({
</div>
))}
{sidebar.emptyText && !sidebar.thisMachine && !sync.rosterError && (
- <p className="dw-hint dw-nav-section">{sidebar.emptyText}</p>
+ <p className="dw-hint dw-nav-section">{tMsg(sidebar.emptyText)}</p>
)}
<ul className="dw-nav-list" aria-label={t("spaces.main.agents_label")}>
{(
@@ -1058,8 +1058,8 @@ function PowerRowButton({ button, onPress }: { button: PowerButton; onPress: ()
<button
type="button"
className="dw-icon-btn dw-row-power"
- aria-label={button.help}
- title={button.help}
+ aria-label={tMsg(button.help)}
+ title={tMsg(button.help)}
disabled={!button.enabled}
data-busy={button.busy ? 'true' : undefined}
onClick={onPress}
@@ -1102,7 +1102,7 @@ function SpaceRowItem({
// Being created: the percentage and a ring, no dot.
<>
<span className="dw-row-trailing">{row.trailing}</span>
- <span role="img" aria-label={row.statusText}>
+ <span role="img" aria-label={tMsg(row.statusText)}>
<RadialProgress className="dw-row-ring" fraction={row.progress / 1000} />
</span>
</>
@@ -1114,7 +1114,7 @@ function SpaceRowItem({
{row.trailing}
</span>
)}
- <span className="dw-dot" data-status={row.status} aria-label={row.statusText} />
+ <span className="dw-dot" data-status={row.status} aria-label={tMsg(row.statusText)} />
</>
)}
</button>
diff --git a/apps/cua-spaces/src/i18n/i18n.lock.json b/apps/cua-spaces/src/i18n/i18n.lock.json
index 01e01e46d0..df095aefa0 100644
--- a/apps/cua-spaces/src/i18n/i18n.lock.json
+++ b/apps/cua-spaces/src/i18n/i18n.lock.json
@@ -58,6 +58,31 @@
"spaces.main.search_label": "283586dda9d5",
"spaces.main.settings_hint": "0841818d307c",
"spaces.main.sidebar_label": "077a293d1263",
+ "spaces.power.resume": "d640c7421da0",
+ "spaces.power.suspend": "4948e134182f",
+ "spaces.power.turn_off": "06f0e210b27d",
+ "spaces.power.turn_on": "5a1f096a0d8d",
+ "spaces.sidebar.empty": "3cb8c0f1b397",
+ "spaces.sidebar.no_matches": "2df01a03ff43",
+ "spaces.sidebar.section.cloud": "248b5c8fbc7f",
+ "spaces.sidebar.section.connected": "22965568d22a",
+ "spaces.sidebar.section.my_computers": "90fd7e891731",
+ "spaces.sidebar.section.this_mac": "79a4aefc396f",
+ "spaces.status.approval": "db0e960b68b5",
+ "spaces.status.cancelling": "91b104db05da",
+ "spaces.status.deleting": "43b5894c3e4e",
+ "spaces.status.failed": "031a8f0f659d",
+ "spaces.status.local": "8c31e6e72230",
+ "spaces.status.resuming": "c494e3ca3e3b",
+ "spaces.status.running": "f4ccae29e1bb",
+ "spaces.status.starting": "aeed4d26bb5f",
+ "spaces.status.stopped": "1a4f630ac1b6",
+ "spaces.status.stopped_reason": "0fa3dcda5e9b",
+ "spaces.status.suspended": "e392a3891c07",
+ "spaces.status.suspending": "1e42d9086a60",
+ "spaces.status.this_mac": "79a4aefc396f",
+ "spaces.status.turning_off": "c62412a208e1",
+ "spaces.status.turning_on": "63fd4df43f4f",
"spaces.switcher.create_new": "62457776f8b3",
"spaces.switcher.drop_hint": "d76e677e7c3c",
"spaces.switcher.drop_hint_app": "a264d83d8e1e",
@@ -138,10 +163,19 @@
"teleport.app_picker.starting": "bbe5fc3b9ef3",
"teleport.app_picker.what_moves_label": "2f00672ec761",
"teleport.drop_zone.label": "4535b8935db0",
+ "teleport.move.app_only": "a0d40ed38edc",
+ "teleport.move.app_with_files": "6d9b2cd8d2e7",
+ "teleport.move.app_with_state": "0b6c6bdf9935",
"teleport.picker.open_failed": "e19338bb069a",
"teleport.picker.preparing": "5d1fa38bcf0d",
"teleport.picker.search": "49c266baaaa7",
"teleport.picker.tabs_label": "e68b3b94586d",
+ "teleport.sensitive.history.detail": "d9ae16787df8",
+ "teleport.sensitive.history.label": "ad438ef1a767",
+ "teleport.sensitive.passwords.detail": "d1e36efb14dc",
+ "teleport.sensitive.passwords.label": "987b18261435",
+ "teleport.sensitive.sign_ins.detail": "6647bd9b45c5",
+ "teleport.sensitive.sign_ins.label": "db3407e99939",
"teleport.sheet.label": "17f4ac2d00ec"
},
"ja": {
@@ -203,6 +237,31 @@
"spaces.main.search_label": "283586dda9d5",
"spaces.main.settings_hint": "0841818d307c",
"spaces.main.sidebar_label": "077a293d1263",
+ "spaces.power.resume": "d640c7421da0",
+ "spaces.power.suspend": "4948e134182f",
+ "spaces.power.turn_off": "06f0e210b27d",
+ "spaces.power.turn_on": "5a1f096a0d8d",
+ "spaces.sidebar.empty": "3cb8c0f1b397",
+ "spaces.sidebar.no_matches": "2df01a03ff43",
+ "spaces.sidebar.section.cloud": "248b5c8fbc7f",
+ "spaces.sidebar.section.connected": "22965568d22a",
+ "spaces.sidebar.section.my_computers": "90fd7e891731",
+ "spaces.sidebar.section.this_mac": "79a4aefc396f",
+ "spaces.status.approval": "db0e960b68b5",
+ "spaces.status.cancelling": "91b104db05da",
+ "spaces.status.deleting": "43b5894c3e4e",
+ "spaces.status.failed": "031a8f0f659d",
+ "spaces.status.local": "8c31e6e72230",
+ "spaces.status.resuming": "c494e3ca3e3b",
+ "spaces.status.running": "f4ccae29e1bb",
+ "spaces.status.starting": "aeed4d26bb5f",
+ "spaces.status.stopped": "1a4f630ac1b6",
+ "spaces.status.stopped_reason": "0fa3dcda5e9b",
+ "spaces.status.suspended": "e392a3891c07",
+ "spaces.status.suspending": "1e42d9086a60",
+ "spaces.status.this_mac": "79a4aefc396f",
+ "spaces.status.turning_off": "c62412a208e1",
+ "spaces.status.turning_on": "63fd4df43f4f",
"spaces.switcher.create_new": "62457776f8b3",
"spaces.switcher.drop_hint": "d76e677e7c3c",
"spaces.switcher.drop_hint_app": "a264d83d8e1e",
@@ -283,10 +342,19 @@
"teleport.app_picker.starting": "bbe5fc3b9ef3",
"teleport.app_picker.what_moves_label": "2f00672ec761",
"teleport.drop_zone.label": "4535b8935db0",
+ "teleport.move.app_only": "a0d40ed38edc",
+ "teleport.move.app_with_files": "6d9b2cd8d2e7",
+ "teleport.move.app_with_state": "0b6c6bdf9935",
"teleport.picker.open_failed": "e19338bb069a",
"teleport.picker.preparing": "5d1fa38bcf0d",
"teleport.picker.search": "49c266baaaa7",
"teleport.picker.tabs_label": "e68b3b94586d",
+ "teleport.sensitive.history.detail": "d9ae16787df8",
+ "teleport.sensitive.history.label": "ad438ef1a767",
+ "teleport.sensitive.passwords.detail": "d1e36efb14dc",
+ "teleport.sensitive.passwords.label": "987b18261435",
+ "teleport.sensitive.sign_ins.detail": "6647bd9b45c5",
+ "teleport.sensitive.sign_ins.label": "db3407e99939",
"teleport.sheet.label": "17f4ac2d00ec"
},
"ko": {
@@ -348,6 +416,31 @@
"spaces.main.search_label": "283586dda9d5",
"spaces.main.settings_hint": "0841818d307c",
"spaces.main.sidebar_label": "077a293d1263",
+ "spaces.power.resume": "d640c7421da0",
+ "spaces.power.suspend": "4948e134182f",
+ "spaces.power.turn_off": "06f0e210b27d",
+ "spaces.power.turn_on": "5a1f096a0d8d",
+ "spaces.sidebar.empty": "3cb8c0f1b397",
+ "spaces.sidebar.no_matches": "2df01a03ff43",
+ "spaces.sidebar.section.cloud": "248b5c8fbc7f",
+ "spaces.sidebar.section.connected": "22965568d22a",
+ "spaces.sidebar.section.my_computers": "90fd7e891731",
+ "spaces.sidebar.section.this_mac": "79a4aefc396f",
+ "spaces.status.approval": "db0e960b68b5",
+ "spaces.status.cancelling": "91b104db05da",
+ "spaces.status.deleting": "43b5894c3e4e",
+ "spaces.status.failed": "031a8f0f659d",
+ "spaces.status.local": "8c31e6e72230",
+ "spaces.status.resuming": "c494e3ca3e3b",
+ "spaces.status.running": "f4ccae29e1bb",
+ "spaces.status.starting": "aeed4d26bb5f",
+ "spaces.status.stopped": "1a4f630ac1b6",
+ "spaces.status.stopped_reason": "0fa3dcda5e9b",
+ "spaces.status.suspended": "e392a3891c07",
+ "spaces.status.suspending": "1e42d9086a60",
+ "spaces.status.this_mac": "79a4aefc396f",
+ "spaces.status.turning_off": "c62412a208e1",
+ "spaces.status.turning_on": "63fd4df43f4f",
"spaces.switcher.create_new": "62457776f8b3",
"spaces.switcher.drop_hint": "d76e677e7c3c",
"spaces.switcher.drop_hint_app": "a264d83d8e1e",
@@ -428,10 +521,19 @@
"teleport.app_picker.starting": "bbe5fc3b9ef3",
"teleport.app_picker.what_moves_label": "2f00672ec761",
"teleport.drop_zone.label": "4535b8935db0",
+ "teleport.move.app_only": "a0d40ed38edc",
+ "teleport.move.app_with_files": "6d9b2cd8d2e7",
+ "teleport.move.app_with_state": "0b6c6bdf9935",
"teleport.picker.open_failed": "e19338bb069a",
"teleport.picker.preparing": "5d1fa38bcf0d",
"teleport.picker.search": "49c266baaaa7",
"teleport.picker.tabs_label": "e68b3b94586d",
+ "teleport.sensitive.history.detail": "d9ae16787df8",
+ "teleport.sensitive.history.label": "ad438ef1a767",
+ "teleport.sensitive.passwords.detail": "d1e36efb14dc",
+ "teleport.sensitive.passwords.label": "987b18261435",
+ "teleport.sensitive.sign_ins.detail": "6647bd9b45c5",
+ "teleport.sensitive.sign_ins.label": "db3407e99939",
"teleport.sheet.label": "17f4ac2d00ec"
},
"pt-BR": {
@@ -493,6 +595,31 @@
"spaces.main.search_label": "283586dda9d5",
"spaces.main.settings_hint": "0841818d307c",
"spaces.main.sidebar_label": "077a293d1263",
+ "spaces.power.resume": "d640c7421da0",
+ "spaces.power.suspend": "4948e134182f",
+ "spaces.power.turn_off": "06f0e210b27d",
+ "spaces.power.turn_on": "5a1f096a0d8d",
+ "spaces.sidebar.empty": "3cb8c0f1b397",
+ "spaces.sidebar.no_matches": "2df01a03ff43",
+ "spaces.sidebar.section.cloud": "248b5c8fbc7f",
+ "spaces.sidebar.section.connected": "22965568d22a",
+ "spaces.sidebar.section.my_computers": "90fd7e891731",
+ "spaces.sidebar.section.this_mac": "79a4aefc396f",
+ "spaces.status.approval": "db0e960b68b5",
+ "spaces.status.cancelling": "91b104db05da",
+ "spaces.status.deleting": "43b5894c3e4e",
+ "spaces.status.failed": "031a8f0f659d",
+ "spaces.status.local": "8c31e6e72230",
+ "spaces.status.resuming": "c494e3ca3e3b",
+ "spaces.status.running": "f4ccae29e1bb",
+ "spaces.status.starting": "aeed4d26bb5f",
+ "spaces.status.stopped": "1a4f630ac1b6",
+ "spaces.status.stopped_reason": "0fa3dcda5e9b",
+ "spaces.status.suspended": "e392a3891c07",
+ "spaces.status.suspending": "1e42d9086a60",
+ "spaces.status.this_mac": "79a4aefc396f",
+ "spaces.status.turning_off": "c62412a208e1",
+ "spaces.status.turning_on": "63fd4df43f4f",
"spaces.switcher.create_new": "62457776f8b3",
"spaces.switcher.drop_hint": "d76e677e7c3c",
"spaces.switcher.drop_hint_app": "a264d83d8e1e",
@@ -573,10 +700,19 @@
"teleport.app_picker.starting": "bbe5fc3b9ef3",
"teleport.app_picker.what_moves_label": "2f00672ec761",
"teleport.drop_zone.label": "4535b8935db0",
+ "teleport.move.app_only": "a0d40ed38edc",
+ "teleport.move.app_with_files": "6d9b2cd8d2e7",
+ "teleport.move.app_with_state": "0b6c6bdf9935",
"teleport.picker.open_failed": "e19338bb069a",
"teleport.picker.preparing": "5d1fa38bcf0d",
"teleport.picker.search": "49c266baaaa7",
"teleport.picker.tabs_label": "e68b3b94586d",
+ "teleport.sensitive.history.detail": "d9ae16787df8",
+ "teleport.sensitive.history.label": "ad438ef1a767",
+ "teleport.sensitive.passwords.detail": "d1e36efb14dc",
+ "teleport.sensitive.passwords.label": "987b18261435",
+ "teleport.sensitive.sign_ins.detail": "6647bd9b45c5",
+ "teleport.sensitive.sign_ins.label": "db3407e99939",
"teleport.sheet.label": "17f4ac2d00ec"
},
"zh-Hans": {
@@ -638,6 +774,31 @@
"spaces.main.search_label": "283586dda9d5",
"spaces.main.settings_hint": "0841818d307c",
"spaces.main.sidebar_label": "077a293d1263",
+ "spaces.power.resume": "d640c7421da0",
+ "spaces.power.suspend": "4948e134182f",
+ "spaces.power.turn_off": "06f0e210b27d",
+ "spaces.power.turn_on": "5a1f096a0d8d",
+ "spaces.sidebar.empty": "3cb8c0f1b397",
+ "spaces.sidebar.no_matches": "2df01a03ff43",
+ "spaces.sidebar.section.cloud": "248b5c8fbc7f",
+ "spaces.sidebar.section.connected": "22965568d22a",
+ "spaces.sidebar.section.my_computers": "90fd7e891731",
+ "spaces.sidebar.section.this_mac": "79a4aefc396f",
+ "spaces.status.approval": "db0e960b68b5",
+ "spaces.status.cancelling": "91b104db05da",
+ "spaces.status.deleting": "43b5894c3e4e",
+ "spaces.status.failed": "031a8f0f659d",
+ "spaces.status.local": "8c31e6e72230",
+ "spaces.status.resuming": "c494e3ca3e3b",
+ "spaces.status.running": "f4ccae29e1bb",
+ "spaces.status.starting": "aeed4d26bb5f",
+ "spaces.status.stopped": "1a4f630ac1b6",
+ "spaces.status.stopped_reason": "0fa3dcda5e9b",
+ "spaces.status.suspended": "e392a3891c07",
+ "spaces.status.suspending": "1e42d9086a60",
+ "spaces.status.this_mac": "79a4aefc396f",
+ "spaces.status.turning_off": "c62412a208e1",
+ "spaces.status.turning_on": "63fd4df43f4f",
"spaces.switcher.create_new": "62457776f8b3",
"spaces.switcher.drop_hint": "d76e677e7c3c",
"spaces.switcher.drop_hint_app": "a264d83d8e1e",
@@ -718,10 +879,19 @@
"teleport.app_picker.starting": "bbe5fc3b9ef3",
"teleport.app_picker.what_moves_label": "2f00672ec761",
"teleport.drop_zone.label": "4535b8935db0",
+ "teleport.move.app_only": "a0d40ed38edc",
+ "teleport.move.app_with_files": "6d9b2cd8d2e7",
+ "teleport.move.app_with_state": "0b6c6bdf9935",
"teleport.picker.open_failed": "e19338bb069a",
"teleport.picker.preparing": "5d1fa38bcf0d",
"teleport.picker.search": "49c266baaaa7",
"teleport.picker.tabs_label": "e68b3b94586d",
+ "teleport.sensitive.history.detail": "d9ae16787df8",
+ "teleport.sensitive.history.label": "ad438ef1a767",
+ "teleport.sensitive.passwords.detail": "d1e36efb14dc",
+ "teleport.sensitive.passwords.label": "987b18261435",
+ "teleport.sensitive.sign_ins.detail": "6647bd9b45c5",
+ "teleport.sensitive.sign_ins.label": "db3407e99939",
"teleport.sheet.label": "17f4ac2d00ec"
}
}
diff --git a/apps/cua-spaces/src/i18n/index.ts b/apps/cua-spaces/src/i18n/index.ts
index 74253e026f..2907f154a7 100644
--- a/apps/cua-spaces/src/i18n/index.ts
+++ b/apps/cua-spaces/src/i18n/index.ts
@@ -127,7 +127,10 @@ export interface Msg {
/** Translate a core message by looking its code up like any other key. */
export function tMsg(msg: Msg): string {
- return t(msg.code, msg.vars);
+ // The code's first word is its namespace (`spaces.status.running` is in
+ // `spaces.json`), and `t` alone only looks in `common`.
+ const ns = msg.code.split(".")[0] as Namespace;
+ return t(msg.code, { ...msg.vars, ns: (NAMESPACES as readonly string[]).includes(ns) ? ns : undefined });
}
/** React hook: `const t = useT("sharing")`. Re-renders on locale change. */
diff --git a/apps/cua-spaces/src/i18n/locales/en/spaces.json b/apps/cua-spaces/src/i18n/locales/en/spaces.json
index 2e65450ce4..e887993bcc 100644
--- a/apps/cua-spaces/src/i18n/locales/en/spaces.json
+++ b/apps/cua-spaces/src/i18n/locales/en/spaces.json
@@ -60,5 +60,30 @@
"spaces.window_stream.waiting_for": "Waiting for {name}…",
"spaces.window_stream.no_windows": "No open windows in {name} yet.",
"spaces.window_stream.close_window": "Close window",
- "spaces.create.creating": "Creating a Space…"
+ "spaces.create.creating": "Creating a Space…",
+ "spaces.sidebar.section.cloud": "Cua Cloud",
+ "spaces.sidebar.section.this_mac": "This Mac",
+ "spaces.sidebar.section.connected": "Connected",
+ "spaces.sidebar.section.my_computers": "My computers",
+ "spaces.sidebar.empty": "No Spaces yet",
+ "spaces.sidebar.no_matches": "No matches",
+ "spaces.status.failed": "Failed",
+ "spaces.status.cancelling": "Cancelling…",
+ "spaces.status.this_mac": "This Mac",
+ "spaces.status.running": "Running",
+ "spaces.status.local": "Local",
+ "spaces.status.approval": "Needs approval",
+ "spaces.status.suspended": "Suspended",
+ "spaces.status.starting": "Starting",
+ "spaces.status.deleting": "Deleting…",
+ "spaces.status.stopped": "Stopped",
+ "spaces.status.stopped_reason": "Stopped: {reason}",
+ "spaces.status.suspending": "Suspending…",
+ "spaces.status.resuming": "Resuming…",
+ "spaces.status.turning_off": "Turning off…",
+ "spaces.status.turning_on": "Turning on…",
+ "spaces.power.suspend": "Suspend",
+ "spaces.power.resume": "Resume",
+ "spaces.power.turn_off": "Turn off",
+ "spaces.power.turn_on": "Turn on"
}
diff --git a/apps/cua-spaces/src/i18n/locales/es/spaces.json b/apps/cua-spaces/src/i18n/locales/es/spaces.json
index c129357381..036b1f0d88 100644
--- a/apps/cua-spaces/src/i18n/locales/es/spaces.json
+++ b/apps/cua-spaces/src/i18n/locales/es/spaces.json
@@ -60,5 +60,30 @@
"spaces.window_stream.waiting_for": "Esperando a {name}…",
"spaces.window_stream.no_windows": "Aún no hay ventanas abiertas en {name}.",
"spaces.window_stream.close_window": "Cerrar ventana",
- "spaces.create.creating": "Creando un Space…"
+ "spaces.create.creating": "Creando un Space…",
+ "spaces.sidebar.section.cloud": "Cua Cloud",
+ "spaces.sidebar.section.this_mac": "Este Mac",
+ "spaces.sidebar.section.connected": "Conectados",
+ "spaces.sidebar.section.my_computers": "Mis computadoras",
+ "spaces.sidebar.empty": "Aún no hay Spaces",
+ "spaces.sidebar.no_matches": "Sin resultados",
+ "spaces.status.failed": "Error",
+ "spaces.status.cancelling": "Cancelando…",
+ "spaces.status.this_mac": "Este Mac",
+ "spaces.status.running": "En ejecución",
+ "spaces.status.local": "Local",
+ "spaces.status.approval": "Requiere aprobación",
+ "spaces.status.suspended": "Suspendido",
+ "spaces.status.starting": "Iniciando",
+ "spaces.status.deleting": "Eliminando…",
+ "spaces.status.stopped": "Detenido",
+ "spaces.status.stopped_reason": "Detenido: {reason}",
+ "spaces.status.suspending": "Suspendiendo…",
+ "spaces.status.resuming": "Reanudando…",
+ "spaces.status.turning_off": "Apagando…",
+ "spaces.status.turning_on": "Encendiendo…",
+ "spaces.power.suspend": "Suspender",
+ "spaces.power.resume": "Reanudar",
+ "spaces.power.turn_off": "Apagar",
+ "spaces.power.turn_on": "Encender"
}
diff --git a/apps/cua-spaces/src/i18n/locales/es/teleport.json b/apps/cua-spaces/src/i18n/locales/es/teleport.json
index cdc28391d1..facb04dc4d 100644
--- a/apps/cua-spaces/src/i18n/locales/es/teleport.json
+++ b/apps/cua-spaces/src/i18n/locales/es/teleport.json
@@ -34,5 +34,14 @@
"teleport.picker.preparing": "Preparando…",
"teleport.picker.tabs_label": "Teletransportar",
"teleport.picker.search": "Buscar",
- "teleport.drop_zone.label": "Teletransportar a {name}"
+ "teleport.drop_zone.label": "Teletransportar a {name}",
+ "teleport.move.app_only": "Solo la app",
+ "teleport.move.app_with_files": "La app con archivos o carpetas",
+ "teleport.move.app_with_state": "La app con su sesión iniciada",
+ "teleport.sensitive.sign_ins.label": "Mantener mi sesión iniciada",
+ "teleport.sensitive.sign_ins.detail": "Envía las cookies de sesión.",
+ "teleport.sensitive.passwords.label": "Contraseñas guardadas",
+ "teleport.sensitive.passwords.detail": "Envía las contraseñas guardadas en la app.",
+ "teleport.sensitive.history.label": "Historial de navegación",
+ "teleport.sensitive.history.detail": "Envía el historial de páginas visitadas y los marcadores donde el navegador los guarda juntos."
}
diff --git a/apps/cua-spaces/src/i18n/locales/ja/spaces.json b/apps/cua-spaces/src/i18n/locales/ja/spaces.json
index e196ab52f8..582fb7da81 100644
--- a/apps/cua-spaces/src/i18n/locales/ja/spaces.json
+++ b/apps/cua-spaces/src/i18n/locales/ja/spaces.json
@@ -60,5 +60,30 @@
"spaces.window_stream.waiting_for": "{name}を待っています…",
"spaces.window_stream.no_windows": "{name}にはまだ開いているウィンドウがありません。",
"spaces.window_stream.close_window": "ウィンドウを閉じる",
- "spaces.create.creating": "Space を作成中…"
+ "spaces.create.creating": "Space を作成中…",
+ "spaces.sidebar.section.cloud": "Cua Cloud",
+ "spaces.sidebar.section.this_mac": "この Mac",
+ "spaces.sidebar.section.connected": "接続済み",
+ "spaces.sidebar.section.my_computers": "自分のコンピュータ",
+ "spaces.sidebar.empty": "まだ Spaces がありません",
+ "spaces.sidebar.no_matches": "一致する項目はありません",
+ "spaces.status.failed": "失敗",
+ "spaces.status.cancelling": "キャンセル中…",
+ "spaces.status.this_mac": "この Mac",
+ "spaces.status.running": "実行中",
+ "spaces.status.local": "ローカル",
+ "spaces.status.approval": "承認が必要",
+ "spaces.status.suspended": "一時停止中",
+ "spaces.status.starting": "起動中",
+ "spaces.status.deleting": "削除中…",
+ "spaces.status.stopped": "停止",
+ "spaces.status.stopped_reason": "停止: {reason}",
+ "spaces.status.suspending": "一時停止しています…",
+ "spaces.status.resuming": "再開しています…",
+ "spaces.status.turning_off": "オフにしています…",
+ "spaces.status.turning_on": "オンにしています…",
+ "spaces.power.suspend": "一時停止",
+ "spaces.power.resume": "再開",
+ "spaces.power.turn_off": "オフにする",
+ "spaces.power.turn_on": "オンにする"
}
diff --git a/apps/cua-spaces/src/i18n/locales/ja/teleport.json b/apps/cua-spaces/src/i18n/locales/ja/teleport.json
index 19b74b2207..0374f2126a 100644
--- a/apps/cua-spaces/src/i18n/locales/ja/teleport.json
+++ b/apps/cua-spaces/src/i18n/locales/ja/teleport.json
@@ -34,5 +34,14 @@
"teleport.picker.preparing": "準備しています…",
"teleport.picker.tabs_label": "テレポート",
"teleport.picker.search": "検索",
- "teleport.drop_zone.label": "{name}にテレポート"
+ "teleport.drop_zone.label": "{name}にテレポート",
+ "teleport.move.app_only": "アプリのみ",
+ "teleport.move.app_with_files": "アプリとファイルまたはフォルダ",
+ "teleport.move.app_with_state": "アプリとサインイン状態",
+ "teleport.sensitive.sign_ins.label": "サインインしたままにする",
+ "teleport.sensitive.sign_ins.detail": "セッションの Cookie を送信します。",
+ "teleport.sensitive.passwords.label": "保存済みのパスワード",
+ "teleport.sensitive.passwords.detail": "アプリに保存されているパスワードを送信します。",
+ "teleport.sensitive.history.label": "閲覧履歴",
+ "teleport.sensitive.history.detail": "訪問したページの履歴と、ブラウザがまとめて保持している場合はブックマークを送信します。"
}
diff --git a/apps/cua-spaces/src/i18n/locales/ko/spaces.json b/apps/cua-spaces/src/i18n/locales/ko/spaces.json
index dbf06b79ce..0c49588832 100644
--- a/apps/cua-spaces/src/i18n/locales/ko/spaces.json
+++ b/apps/cua-spaces/src/i18n/locales/ko/spaces.json
@@ -60,5 +60,30 @@
"spaces.window_stream.waiting_for": "{name}을(를) 기다리는 중…",
"spaces.window_stream.no_windows": "{name}에 열린 창이 아직 없어요.",
"spaces.window_stream.close_window": "창 닫기",
- "spaces.create.creating": "Space 만드는 중…"
+ "spaces.create.creating": "Space 만드는 중…",
+ "spaces.sidebar.section.cloud": "Cua Cloud",
+ "spaces.sidebar.section.this_mac": "이 Mac",
+ "spaces.sidebar.section.connected": "연결됨",
+ "spaces.sidebar.section.my_computers": "내 컴퓨터",
+ "spaces.sidebar.empty": "아직 Spaces가 없어요",
+ "spaces.sidebar.no_matches": "일치하는 항목이 없어요",
+ "spaces.status.failed": "실패",
+ "spaces.status.cancelling": "취소하는 중…",
+ "spaces.status.this_mac": "이 Mac",
+ "spaces.status.running": "실행 중",
+ "spaces.status.local": "로컬",
+ "spaces.status.approval": "승인 필요",
+ "spaces.status.suspended": "일시 중지됨",
+ "spaces.status.starting": "시작하는 중",
+ "spaces.status.deleting": "삭제하는 중…",
+ "spaces.status.stopped": "중지됨",
+ "spaces.status.stopped_reason": "중지됨: {reason}",
+ "spaces.status.suspending": "일시 중지하는 중…",
+ "spaces.status.resuming": "다시 시작하는 중…",
+ "spaces.status.turning_off": "끄는 중…",
+ "spaces.status.turning_on": "켜는 중…",
+ "spaces.power.suspend": "일시 중지",
+ "spaces.power.resume": "다시 시작",
+ "spaces.power.turn_off": "끄기",
+ "spaces.power.turn_on": "켜기"
}
diff --git a/apps/cua-spaces/src/i18n/locales/ko/teleport.json b/apps/cua-spaces/src/i18n/locales/ko/teleport.json
index 6cb7d195fc..11a6047ee7 100644
--- a/apps/cua-spaces/src/i18n/locales/ko/teleport.json
+++ b/apps/cua-spaces/src/i18n/locales/ko/teleport.json
@@ -34,5 +34,14 @@
"teleport.picker.preparing": "준비하는 중…",
"teleport.picker.tabs_label": "텔레포트",
"teleport.picker.search": "검색",
- "teleport.drop_zone.label": "{name}(으)로 텔레포트"
+ "teleport.drop_zone.label": "{name}(으)로 텔레포트",
+ "teleport.move.app_only": "앱만",
+ "teleport.move.app_with_files": "파일이나 폴더와 함께 앱",
+ "teleport.move.app_with_state": "로그인 상태와 함께 앱",
+ "teleport.sensitive.sign_ins.label": "로그인 유지",
+ "teleport.sensitive.sign_ins.detail": "세션 쿠키를 보내요.",
+ "teleport.sensitive.passwords.label": "저장된 비밀번호",
+ "teleport.sensitive.passwords.detail": "앱에 저장된 비밀번호를 보내요.",
+ "teleport.sensitive.history.label": "방문 기록",
+ "teleport.sensitive.history.detail": "방문한 페이지 기록과, 브라우저가 함께 보관하는 경우 북마크를 보내요."
}
diff --git a/apps/cua-spaces/src/i18n/locales/pt-BR/spaces.json b/apps/cua-spaces/src/i18n/locales/pt-BR/spaces.json
index 344a88b569..4fb21e4334 100644
--- a/apps/cua-spaces/src/i18n/locales/pt-BR/spaces.json
+++ b/apps/cua-spaces/src/i18n/locales/pt-BR/spaces.json
@@ -60,5 +60,30 @@
"spaces.window_stream.waiting_for": "Aguardando {name}…",
"spaces.window_stream.no_windows": "Ainda não há janelas abertas em {name}.",
"spaces.window_stream.close_window": "Fechar janela",
- "spaces.create.creating": "Criando um Space…"
+ "spaces.create.creating": "Criando um Space…",
+ "spaces.sidebar.section.cloud": "Cua Cloud",
+ "spaces.sidebar.section.this_mac": "Este Mac",
+ "spaces.sidebar.section.connected": "Conectados",
+ "spaces.sidebar.section.my_computers": "Meus computadores",
+ "spaces.sidebar.empty": "Ainda não há Spaces",
+ "spaces.sidebar.no_matches": "Nenhum resultado",
+ "spaces.status.failed": "Falhou",
+ "spaces.status.cancelling": "Cancelando…",
+ "spaces.status.this_mac": "Este Mac",
+ "spaces.status.running": "Em execução",
+ "spaces.status.local": "Local",
+ "spaces.status.approval": "Precisa de aprovação",
+ "spaces.status.suspended": "Suspenso",
+ "spaces.status.starting": "Iniciando",
+ "spaces.status.deleting": "Excluindo…",
+ "spaces.status.stopped": "Parado",
+ "spaces.status.stopped_reason": "Parado: {reason}",
+ "spaces.status.suspending": "Suspendendo…",
+ "spaces.status.resuming": "Retomando…",
+ "spaces.status.turning_off": "Desligando…",
+ "spaces.status.turning_on": "Ligando…",
+ "spaces.power.suspend": "Suspender",
+ "spaces.power.resume": "Retomar",
+ "spaces.power.turn_off": "Desligar",
+ "spaces.power.turn_on": "Ligar"
}
diff --git a/apps/cua-spaces/src/i18n/locales/pt-BR/teleport.json b/apps/cua-spaces/src/i18n/locales/pt-BR/teleport.json
index c5cb94b8ba..4c0304f589 100644
--- a/apps/cua-spaces/src/i18n/locales/pt-BR/teleport.json
+++ b/apps/cua-spaces/src/i18n/locales/pt-BR/teleport.json
@@ -34,5 +34,14 @@
"teleport.picker.preparing": "Preparando…",
"teleport.picker.tabs_label": "Teleportar",
"teleport.picker.search": "Pesquisar",
- "teleport.drop_zone.label": "Teleportar para {name}"
+ "teleport.drop_zone.label": "Teleportar para {name}",
+ "teleport.move.app_only": "Só o app",
+ "teleport.move.app_with_files": "O app com arquivos ou pastas",
+ "teleport.move.app_with_state": "O app com o estado de login",
+ "teleport.sensitive.sign_ins.label": "Manter minha sessão iniciada",
+ "teleport.sensitive.sign_ins.detail": "Envia os cookies da sessão.",
+ "teleport.sensitive.passwords.label": "Senhas salvas",
+ "teleport.sensitive.passwords.detail": "Envia as senhas salvas no app.",
+ "teleport.sensitive.history.label": "Histórico de navegação",
+ "teleport.sensitive.history.detail": "Envia o histórico de páginas visitadas e os favoritos, quando o navegador os guarda juntos."
}
diff --git a/apps/cua-spaces/src/i18n/locales/zh-Hans/spaces.json b/apps/cua-spaces/src/i18n/locales/zh-Hans/spaces.json
index b15757bf7d..49f86adf95 100644
--- a/apps/cua-spaces/src/i18n/locales/zh-Hans/spaces.json
+++ b/apps/cua-spaces/src/i18n/locales/zh-Hans/spaces.json
@@ -60,5 +60,30 @@
"spaces.window_stream.waiting_for": "正在等待 {name}…",
"spaces.window_stream.no_windows": "{name} 中还没有打开的窗口。",
"spaces.window_stream.close_window": "关闭窗口",
- "spaces.create.creating": "正在创建 Space…"
+ "spaces.create.creating": "正在创建 Space…",
+ "spaces.sidebar.section.cloud": "Cua Cloud",
+ "spaces.sidebar.section.this_mac": "这台 Mac",
+ "spaces.sidebar.section.connected": "已连接",
+ "spaces.sidebar.section.my_computers": "我的电脑",
+ "spaces.sidebar.empty": "还没有任何 Spaces",
+ "spaces.sidebar.no_matches": "没有匹配项",
+ "spaces.status.failed": "失败",
+ "spaces.status.cancelling": "正在取消…",
+ "spaces.status.this_mac": "这台 Mac",
+ "spaces.status.running": "运行中",
+ "spaces.status.local": "本地",
+ "spaces.status.approval": "需要批准",
+ "spaces.status.suspended": "已挂起",
+ "spaces.status.starting": "正在启动",
+ "spaces.status.deleting": "正在删除…",
+ "spaces.status.stopped": "已停止",
+ "spaces.status.stopped_reason": "已停止:{reason}",
+ "spaces.status.suspending": "正在挂起…",
+ "spaces.status.resuming": "正在恢复…",
+ "spaces.status.turning_off": "正在关闭…",
+ "spaces.status.turning_on": "正在开启…",
+ "spaces.power.suspend": "挂起",
+ "spaces.power.resume": "恢复",
+ "spaces.power.turn_off": "关闭",
+ "spaces.power.turn_on": "开启"
}
diff --git a/apps/cua-spaces/src/i18n/locales/zh-Hans/teleport.json b/apps/cua-spaces/src/i18n/locales/zh-Hans/teleport.json
index 85fc4972b2..04c43e9ee7 100644
--- a/apps/cua-spaces/src/i18n/locales/zh-Hans/teleport.json
+++ b/apps/cua-spaces/src/i18n/locales/zh-Hans/teleport.json
@@ -34,5 +34,14 @@
"teleport.picker.preparing": "正在准备…",
"teleport.picker.tabs_label": "传送",
"teleport.picker.search": "搜索",
- "teleport.drop_zone.label": "传送到 {name}"
+ "teleport.drop_zone.label": "传送到 {name}",
+ "teleport.move.app_only": "仅应用",
+ "teleport.move.app_with_files": "应用及文件或文件夹",
+ "teleport.move.app_with_state": "应用及其登录状态",
+ "teleport.sensitive.sign_ins.label": "保持我的登录状态",
+ "teleport.sensitive.sign_ins.detail": "会发送会话 Cookie。",
+ "teleport.sensitive.passwords.label": "已保存的密码",
+ "teleport.sensitive.passwords.detail": "会发送应用中已保存的密码。",
+ "teleport.sensitive.history.label": "浏览记录",
+ "teleport.sensitive.history.detail": "会发送访问过的页面记录,以及浏览器中一并保存的书签。"
}
diff --git a/apps/cua-spaces/src/model/window.ts b/apps/cua-spaces/src/model/window.ts
index 9c3b2f1ec4..93110b7198 100644
--- a/apps/cua-spaces/src/model/window.ts
+++ b/apps/cua-spaces/src/model/window.ts
@@ -8,6 +8,7 @@
* app renders the same views.
*/
import { core } from "../core";
+import type { Msg } from "../i18n";
import type { DriveSyncInput } from "./persistent";
import type { RemoteWindow } from "./teleport";
import type { Location, Space, SpaceOs, SpaceStatus } from "./types";
@@ -18,7 +19,7 @@ export interface SidebarRow {
/** The Space's OS icon id (the notch tiles' mark), before the name. */
osIcon: string;
status: SpaceStatus;
- statusText: string;
+ statusText: Msg;
detail: string;
dim: boolean;
selected: boolean;
@@ -40,7 +41,7 @@ export interface PowerButton {
symbol: string;
/** Tooltip and label: "Suspend", "Resume", "Turn off", "Turn on" (while
* it runs, "Suspending…" and the like). */
- help: string;
+ help: Msg;
/** A press turns it on (else off). */
turnOn: boolean;
enabled: boolean;
@@ -50,9 +51,9 @@ export interface PowerButton {
export interface SidebarView {
thisMachine: SidebarRow | null;
- sections: { title: string; rows: SidebarRow[] }[];
+ sections: { title: Msg; rows: SidebarRow[] }[];
selectedId: string | null;
- emptyText: string | null;
+ emptyText: Msg | null;
}
export function sidebar(spaces: Space[], query: string, selectedId: string | null): SidebarView {
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-cancel.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-cancel.json
index 3f165c77a3..cc8e0da79d 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-cancel.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-cancel.json
@@ -51,7 +51,7 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Starting] 10 1%"
+ "os-macos Mac [spaces.status.starting] 10 1%"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Starting 10 Starting…"
@@ -93,7 +93,7 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Starting] 160 16%"
+ "os-macos Mac [spaces.status.starting] 160 16%"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Starting 160 Downloading macOS (first time only)…"
@@ -135,7 +135,7 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Starting] 187 18%"
+ "os-macos Mac [spaces.status.starting] 187 18%"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Starting 187 Downloading macOS (first time only)…"
@@ -177,7 +177,7 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Cancelling…] 187 18%"
+ "os-macos Mac [spaces.status.cancelling] 187 18%"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Cancelling… 187 Cancelling…"
@@ -219,7 +219,7 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Cancelling…] 187 18%"
+ "os-macos Mac [spaces.status.cancelling] 187 18%"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Cancelling… 187 Cancelling…"
@@ -261,7 +261,7 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Cancelling…] 187 18%"
+ "os-macos Mac [spaces.status.cancelling] 187 18%"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Cancelling… 187 Cancelling…"
@@ -317,7 +317,7 @@
],
"pending": true,
"rows": [
- "os-linux Box [Starting] 10 1%"
+ "os-linux Box [spaces.status.starting] 10 1%"
],
"tiles": [
"os-linux Box, Linux, This Mac, Starting 10 Starting…"
@@ -358,7 +358,7 @@
],
"pending": true,
"rows": [
- "os-linux Box [Starting] 425 42%"
+ "os-linux Box [spaces.status.starting] 425 42%"
],
"tiles": [
"os-linux Box, Linux, This Mac, Starting 425 Downloading image…"
@@ -399,7 +399,7 @@
],
"pending": true,
"rows": [
- "os-linux Box [Cancelling…] 425 42%"
+ "os-linux Box [spaces.status.cancelling] 425 42%"
],
"tiles": [
"os-linux Box, Linux, This Mac, Cancelling… 425 Cancelling…"
@@ -440,7 +440,7 @@
],
"pending": true,
"rows": [
- "os-linux Box [Failed] - timed out: the cua daemon did not answer"
+ "os-linux Box [spaces.status.failed] - timed out: the cua daemon did not answer"
],
"tiles": [
"os-linux Box, Linux, This Mac, Failed - Failed"
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-gpu.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-gpu.json
index 7202783368..d8aa9c2ac7 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-gpu.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-gpu.json
@@ -474,7 +474,7 @@
},
{
"frame": {
- "emptyText": "No Spaces yet",
+ "emptyText": "spaces.sidebar.empty",
"sections": [],
"selectedId": null,
"thisMachine": null
@@ -483,7 +483,7 @@
},
{
"frame": {
- "emptyText": "No Spaces yet",
+ "emptyText": "spaces.sidebar.empty",
"sections": [],
"selectedId": null,
"thisMachine": null
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-progress.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-progress.json
index fad41d529a..b8a37fe3a2 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-progress.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-progress.json
@@ -53,7 +53,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 10 1%"
+ "os-omarchy New Space [spaces.status.starting] 10 1%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 10 Starting…"
@@ -97,7 +97,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 11 1%"
+ "os-omarchy New Space [spaces.status.starting] 11 1%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 11 Starting…"
@@ -141,7 +141,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 11 1%"
+ "os-omarchy New Space [spaces.status.starting] 11 1%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 11 Starting…"
@@ -185,7 +185,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 15 1%"
+ "os-omarchy New Space [spaces.status.starting] 15 1%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 15 Starting…"
@@ -229,7 +229,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 18 1%"
+ "os-omarchy New Space [spaces.status.starting] 18 1%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 18 Downloading image…"
@@ -273,7 +273,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 104 10%"
+ "os-omarchy New Space [spaces.status.starting] 104 10%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 104 Downloading image…"
@@ -317,7 +317,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 360 36%"
+ "os-omarchy New Space [spaces.status.starting] 360 36%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 360 Downloading image…"
@@ -361,7 +361,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 360 36%"
+ "os-omarchy New Space [spaces.status.starting] 360 36%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 360 Booting Linux…"
@@ -405,7 +405,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 361 36%"
+ "os-omarchy New Space [spaces.status.starting] 361 36%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 361 Booting Linux…"
@@ -449,7 +449,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 362 36%"
+ "os-omarchy New Space [spaces.status.starting] 362 36%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 362 Starting Cua inside the Space…"
@@ -493,7 +493,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 525 52%"
+ "os-omarchy New Space [spaces.status.starting] 525 52%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 525 Starting Cua inside the Space…"
@@ -537,7 +537,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 851 85%"
+ "os-omarchy New Space [spaces.status.starting] 851 85%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 851 Starting Cua inside the Space…"
@@ -581,7 +581,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 963 96%"
+ "os-omarchy New Space [spaces.status.starting] 963 96%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 963 Starting Cua inside the Space…"
@@ -625,7 +625,7 @@
],
"pending": true,
"rows": [
- "os-omarchy New Space [Starting] 968 96%"
+ "os-omarchy New Space [spaces.status.starting] 968 96%"
],
"tiles": [
"os-omarchy New Space, Linux, This Mac, Starting 968 Starting Cua inside the Space…"
@@ -692,8 +692,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 10 1%",
- "os-omarchy New Space [Starting] 968 96%"
+ "os-ubuntu New Space [spaces.status.starting] 10 1%",
+ "os-omarchy New Space [spaces.status.starting] 968 96%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 10 Starting…",
@@ -761,8 +761,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 59 5%",
- "os-omarchy New Space [Starting] 968 96%"
+ "os-ubuntu New Space [spaces.status.starting] 59 5%",
+ "os-omarchy New Space [spaces.status.starting] 968 96%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 59 Creating the container…",
@@ -830,8 +830,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 124 12%",
- "os-omarchy New Space [Starting] 968 96%"
+ "os-ubuntu New Space [spaces.status.starting] 124 12%",
+ "os-omarchy New Space [spaces.status.starting] 968 96%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 124 Creating the container…",
@@ -899,8 +899,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 124 12%",
- "os-omarchy New Space [Starting] 987 98%"
+ "os-ubuntu New Space [spaces.status.starting] 124 12%",
+ "os-omarchy New Space [spaces.status.starting] 987 98%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 124 Creating the container…",
@@ -968,8 +968,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 172 17%",
- "os-omarchy New Space [Starting] 987 98%"
+ "os-ubuntu New Space [spaces.status.starting] 172 17%",
+ "os-omarchy New Space [spaces.status.starting] 987 98%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 172 Starting Cua inside the Space…",
@@ -1037,8 +1037,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 831 83%",
- "os-omarchy New Space [Starting] 989 98%"
+ "os-ubuntu New Space [spaces.status.starting] 831 83%",
+ "os-omarchy New Space [spaces.status.starting] 989 98%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 831 Starting Cua inside the Space…",
@@ -1106,8 +1106,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 831 83%",
- "os-omarchy New Space [Starting] 989 98%"
+ "os-ubuntu New Space [spaces.status.starting] 831 83%",
+ "os-omarchy New Space [spaces.status.starting] 989 98%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 831 Starting Cua inside the Space…",
@@ -1175,8 +1175,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 831 83%",
- "os-omarchy New Space [Starting] 1000 100%"
+ "os-ubuntu New Space [spaces.status.starting] 831 83%",
+ "os-omarchy New Space [spaces.status.starting] 1000 100%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 831 Starting Cua inside the Space…",
@@ -1244,8 +1244,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 900 90%",
- "os-omarchy New Space [Starting] 1000 100%"
+ "os-ubuntu New Space [spaces.status.starting] 900 90%",
+ "os-omarchy New Space [spaces.status.starting] 1000 100%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 900 Starting Cua inside the Space…",
@@ -1314,8 +1314,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 900 90%",
- "os-omarchy omarchy [Running] - -"
+ "os-ubuntu New Space [spaces.status.starting] 900 90%",
+ "os-omarchy omarchy [spaces.status.running] - -"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 900 Starting Cua inside the Space…",
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.json
index c72b4d4dbb..b27aac6dd3 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.json
@@ -2541,7 +2541,7 @@
},
{
"frame": {
- "emptyText": "No Spaces yet",
+ "emptyText": "spaces.sidebar.empty",
"sections": [],
"selectedId": null,
"thisMachine": null
@@ -2550,7 +2550,7 @@
},
{
"frame": {
- "emptyText": "No Spaces yet",
+ "emptyText": "spaces.sidebar.empty",
"sections": [],
"selectedId": null,
"thisMachine": null
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-space.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-space.json
index 45d4407efa..5d3bbfd271 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-space.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-space.json
@@ -2271,8 +2271,8 @@
"frame": {
"emptyText": null,
"sections": [
- "This Mac: demo (selected)",
- "Connected: 10.0.0.5:3211 (dim)"
+ "spaces.sidebar.section.this_mac: demo (selected)",
+ "spaces.sidebar.section.connected: 10.0.0.5:3211 (dim)"
],
"selectedId": "local:demo",
"thisMachine": null
@@ -2283,7 +2283,7 @@
"frame": {
"emptyText": null,
"sections": [
- "This Mac: demo (selected)"
+ "spaces.sidebar.section.this_mac: demo (selected)"
],
"selectedId": "local:demo",
"thisMachine": null
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-stages.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-stages.json
index d3d9275fe7..19f4ed1cd6 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-stages.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-stages.json
@@ -52,7 +52,7 @@
],
"pending": true,
"rows": [
- "os-macos macOS Space [Starting] 10 1%"
+ "os-macos macOS Space [spaces.status.starting] 10 1%"
],
"tiles": [
"os-macos macOS Space, macOS, Mac mini, Starting 10 Starting…"
@@ -95,7 +95,7 @@
],
"pending": true,
"rows": [
- "os-macos macOS Space [Starting] 10 1%"
+ "os-macos macOS Space [spaces.status.starting] 10 1%"
],
"tiles": [
"os-macos macOS Space, macOS, Mac mini, Starting 10 Starting…"
@@ -138,7 +138,7 @@
],
"pending": true,
"rows": [
- "os-macos macOS Space [Starting] 13 1%"
+ "os-macos macOS Space [spaces.status.starting] 13 1%"
],
"tiles": [
"os-macos macOS Space, macOS, Mac mini, Starting 13 Downloading macOS (first time only)…"
@@ -181,7 +181,7 @@
],
"pending": true,
"rows": [
- "os-macos macOS Space [Starting] 358 35%"
+ "os-macos macOS Space [spaces.status.starting] 358 35%"
],
"tiles": [
"os-macos macOS Space, macOS, Mac mini, Starting 358 Downloading macOS (first time only)…"
@@ -224,7 +224,7 @@
],
"pending": true,
"rows": [
- "os-macos macOS Space [Starting] 358 35%"
+ "os-macos macOS Space [spaces.status.starting] 358 35%"
],
"tiles": [
"os-macos macOS Space, macOS, Mac mini, Starting 358 Downloading macOS (first time only)…"
@@ -267,7 +267,7 @@
],
"pending": true,
"rows": [
- "os-macos macOS Space [Starting] 847 84%"
+ "os-macos macOS Space [spaces.status.starting] 847 84%"
],
"tiles": [
"os-macos macOS Space, macOS, Mac mini, Starting 847 Downloading macOS (first time only)…"
@@ -310,7 +310,7 @@
],
"pending": true,
"rows": [
- "os-macos macOS Space [Starting] 847 84%"
+ "os-macos macOS Space [spaces.status.starting] 847 84%"
],
"tiles": [
"os-macos macOS Space, macOS, Mac mini, Starting 847 Preparing the disk…"
@@ -353,7 +353,7 @@
],
"pending": true,
"rows": [
- "os-macos macOS Space [Starting] 861 86%"
+ "os-macos macOS Space [spaces.status.starting] 861 86%"
],
"tiles": [
"os-macos macOS Space, macOS, Mac mini, Starting 861 Booting macOS…"
@@ -396,7 +396,7 @@
],
"pending": true,
"rows": [
- "os-macos macOS Space [Starting] 881 88%"
+ "os-macos macOS Space [spaces.status.starting] 881 88%"
],
"tiles": [
"os-macos macOS Space, macOS, Mac mini, Starting 881 Booting macOS…"
@@ -439,7 +439,7 @@
],
"pending": true,
"rows": [
- "os-macos macOS Space [Starting] 902 90%"
+ "os-macos macOS Space [spaces.status.starting] 902 90%"
],
"tiles": [
"os-macos macOS Space, macOS, Mac mini, Starting 902 Starting Cua inside the Space…"
@@ -482,7 +482,7 @@
],
"pending": true,
"rows": [
- "os-macos macOS Space [Starting] 986 98%"
+ "os-macos macOS Space [spaces.status.starting] 986 98%"
],
"tiles": [
"os-macos macOS Space, macOS, Mac mini, Starting 986 Connecting…"
@@ -548,8 +548,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 10 1%",
- "os-macos macOS Space [Starting] 986 98%"
+ "os-ubuntu New Space [spaces.status.starting] 10 1%",
+ "os-macos macOS Space [spaces.status.starting] 986 98%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 10 Starting…",
@@ -616,8 +616,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 291 29%",
- "os-macos macOS Space [Starting] 986 98%"
+ "os-ubuntu New Space [spaces.status.starting] 291 29%",
+ "os-macos macOS Space [spaces.status.starting] 986 98%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 291 Downloading image…",
@@ -684,8 +684,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 538 53%",
- "os-macos macOS Space [Starting] 986 98%"
+ "os-ubuntu New Space [spaces.status.starting] 538 53%",
+ "os-macos macOS Space [spaces.status.starting] 986 98%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 538 Preparing the disk…",
@@ -752,8 +752,8 @@
],
"pending": true,
"rows": [
- "os-ubuntu New Space [Starting] 538 53%",
- "os-macos macOS Space [Starting] 986 98%"
+ "os-ubuntu New Space [spaces.status.starting] 538 53%",
+ "os-macos macOS Space [spaces.status.starting] 986 98%"
],
"tiles": [
"os-ubuntu New Space, Linux, This Mac, Starting 538 Booting Linux…",
@@ -843,9 +843,9 @@
],
"pending": true,
"rows": [
- "os-ubuntu box [Starting] 10 1%",
- "os-ubuntu New Space [Starting] 538 53%",
- "os-macos macOS Space [Starting] 986 98%"
+ "os-ubuntu box [spaces.status.starting] 10 1%",
+ "os-ubuntu New Space [spaces.status.starting] 538 53%",
+ "os-macos macOS Space [spaces.status.starting] 986 98%"
],
"tiles": [
"os-ubuntu box, Linux, This Mac, Starting 10 Starting…",
@@ -936,9 +936,9 @@
],
"pending": true,
"rows": [
- "os-ubuntu box [Starting] 59 5%",
- "os-ubuntu New Space [Starting] 538 53%",
- "os-macos macOS Space [Starting] 986 98%"
+ "os-ubuntu box [spaces.status.starting] 59 5%",
+ "os-ubuntu New Space [spaces.status.starting] 538 53%",
+ "os-macos macOS Space [spaces.status.starting] 986 98%"
],
"tiles": [
"os-ubuntu box, Linux, This Mac, Starting 59 Creating the container…",
@@ -1029,9 +1029,9 @@
],
"pending": true,
"rows": [
- "os-ubuntu box [Starting] 127 12%",
- "os-ubuntu New Space [Starting] 538 53%",
- "os-macos macOS Space [Starting] 986 98%"
+ "os-ubuntu box [spaces.status.starting] 127 12%",
+ "os-ubuntu New Space [spaces.status.starting] 538 53%",
+ "os-macos macOS Space [spaces.status.starting] 986 98%"
],
"tiles": [
"os-ubuntu box, Linux, This Mac, Starting 127 Starting the container…",
@@ -1122,9 +1122,9 @@
],
"pending": true,
"rows": [
- "os-ubuntu box [Starting] 172 17%",
- "os-ubuntu New Space [Starting] 538 53%",
- "os-macos macOS Space [Starting] 986 98%"
+ "os-ubuntu box [spaces.status.starting] 172 17%",
+ "os-ubuntu New Space [spaces.status.starting] 538 53%",
+ "os-macos macOS Space [spaces.status.starting] 986 98%"
],
"tiles": [
"os-ubuntu box, Linux, This Mac, Starting 172 Starting Cua inside the Space…",
@@ -1215,9 +1215,9 @@
],
"pending": true,
"rows": [
- "os-ubuntu box [Starting] 172 17%",
- "os-ubuntu New Space [Starting] 538 53%",
- "os-macos macOS Space [Starting] 986 98%"
+ "os-ubuntu box [spaces.status.starting] 172 17%",
+ "os-ubuntu New Space [spaces.status.starting] 538 53%",
+ "os-macos macOS Space [spaces.status.starting] 986 98%"
],
"tiles": [
"os-ubuntu box, Linux, This Mac, Starting 172 Starting Cua inside the Space…",
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/delete-space.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/delete-space.json
index 3accbc720b..27e8ea6eff 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/delete-space.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/delete-space.json
@@ -60,8 +60,8 @@
],
"pending": true,
"rows": [
- "os-linux demo [Deleting…] - -",
- "os-linux keep [Running] - -"
+ "os-linux demo [spaces.status.deleting] - -",
+ "os-linux keep [spaces.status.running] - -"
],
"tiles": [
"os-linux demo, Linux, This Mac, Deleting… - Deleting…",
@@ -130,8 +130,8 @@
],
"pending": true,
"rows": [
- "os-linux demo [Deleting…] - -",
- "os-linux keep [Running] - -"
+ "os-linux demo [spaces.status.deleting] - -",
+ "os-linux keep [spaces.status.running] - -"
],
"tiles": [
"os-linux demo, Linux, This Mac, Deleting… - Deleting…",
@@ -200,8 +200,8 @@
],
"pending": true,
"rows": [
- "os-linux demo [Deleting…] - -",
- "os-linux keep [Running] - -"
+ "os-linux demo [spaces.status.deleting] - -",
+ "os-linux keep [spaces.status.running] - -"
],
"tiles": [
"os-linux demo, Linux, This Mac, Deleting… - Deleting…",
@@ -270,8 +270,8 @@
],
"pending": true,
"rows": [
- "os-linux demo [Deleting…] - -",
- "os-linux keep [Running] - -"
+ "os-linux demo [spaces.status.deleting] - -",
+ "os-linux keep [spaces.status.running] - -"
],
"tiles": [
"os-linux demo, Linux, This Mac, Deleting… - Deleting…",
@@ -319,7 +319,7 @@
],
"pending": true,
"rows": [
- "os-linux keep [Running] - -"
+ "os-linux keep [spaces.status.running] - -"
],
"tiles": [
"os-linux keep, Linux, This Mac, Running - -"
@@ -366,7 +366,7 @@
],
"pending": true,
"rows": [
- "os-linux keep [Running] - -"
+ "os-linux keep [spaces.status.running] - -"
],
"tiles": [
"os-linux keep, Linux, This Mac, Running - -"
@@ -411,7 +411,7 @@
],
"pending": true,
"rows": [
- "os-linux keep [Running] - -"
+ "os-linux keep [spaces.status.running] - -"
],
"tiles": [
"os-linux keep, Linux, This Mac, Running - -"
@@ -458,7 +458,7 @@
],
"pending": true,
"rows": [
- "os-linux keep [Deleting…] - -"
+ "os-linux keep [spaces.status.deleting] - -"
],
"tiles": [
"os-linux keep, Linux, This Mac, Deleting… - Deleting…"
@@ -503,7 +503,7 @@
],
"pending": true,
"rows": [
- "os-linux keep [Running] - -"
+ "os-linux keep [spaces.status.running] - -"
],
"tiles": [
"os-linux keep, Linux, This Mac, Running - -"
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/main-window.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/main-window.json
index fa43869f14..35820e6325 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/main-window.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/main-window.json
@@ -16,18 +16,18 @@
"sidebar": {
"emptyText": null,
"sections": [
- "# Cua Cloud",
- "<os-linux> builder | Suspended | Unreachable · timed out (dim)",
- "# This Mac",
- "<os-linux> aurora | Running | This Mac",
- "# Connected",
- "<os-windows> 10.0.0.5:3211 | Running | 10.0.0.5:3211 (selected)",
- "# My computers",
- "<os-linux> research-box @ AWS · us-west-2 | Running | AWS · us-west-2",
- "<os-linux> their-box @ Google Cloud · us-central1 | Suspended | Unreachable · offline (dim)"
+ "# spaces.sidebar.section.cloud",
+ "<os-linux> builder | spaces.status.suspended | Unreachable · timed out (dim)",
+ "# spaces.sidebar.section.this_mac",
+ "<os-linux> aurora | spaces.status.running | This Mac",
+ "# spaces.sidebar.section.connected",
+ "<os-windows> 10.0.0.5:3211 | spaces.status.running | 10.0.0.5:3211 (selected)",
+ "# spaces.sidebar.section.my_computers",
+ "<os-linux> research-box @ AWS · us-west-2 | spaces.status.running | AWS · us-west-2",
+ "<os-linux> their-box @ Google Cloud · us-central1 | spaces.status.suspended | Unreachable · offline (dim)"
],
"selectedId": "direct:10.0.0.5:3211",
- "thisMachine": "<os-macos> This computer | This Mac | Set up for access"
+ "thisMachine": "<os-macos> This computer | spaces.status.this_mac | Set up for access"
}
},
{
@@ -47,18 +47,18 @@
"sidebar": {
"emptyText": null,
"sections": [
- "# Cua Cloud",
- "<os-linux> builder | Suspended | Unreachable · timed out (dim)",
- "# This Mac",
- "<os-linux> aurora | Running | This Mac",
- "# Connected",
- "<os-windows> 10.0.0.5:3211 | Running | 10.0.0.5:3211 (selected)",
- "# My computers",
- "<os-linux> research-box @ AWS · us-west-2 | Running | AWS · us-west-2",
- "<os-linux> their-box @ Google Cloud · us-central1 | Suspended | Unreachable · offline (dim)"
+ "# spaces.sidebar.section.cloud",
+ "<os-linux> builder | spaces.status.suspended | Unreachable · timed out (dim)",
+ "# spaces.sidebar.section.this_mac",
+ "<os-linux> aurora | spaces.status.running | This Mac",
+ "# spaces.sidebar.section.connected",
+ "<os-windows> 10.0.0.5:3211 | spaces.status.running | 10.0.0.5:3211 (selected)",
+ "# spaces.sidebar.section.my_computers",
+ "<os-linux> research-box @ AWS · us-west-2 | spaces.status.running | AWS · us-west-2",
+ "<os-linux> their-box @ Google Cloud · us-central1 | spaces.status.suspended | Unreachable · offline (dim)"
],
"selectedId": "direct:10.0.0.5:3211",
- "thisMachine": "<os-macos> This computer | This Mac | Set up for access"
+ "thisMachine": "<os-macos> This computer | spaces.status.this_mac | Set up for access"
}
},
{
@@ -86,18 +86,18 @@
"sidebar": {
"emptyText": null,
"sections": [
- "# Cua Cloud",
- "<os-linux> builder | Suspended | Unreachable · timed out (dim)",
- "# This Mac",
- "<os-linux> aurora | Running | This Mac",
- "# Connected",
- "<os-windows> 10.0.0.5:3211 | Running | 10.0.0.5:3211 (selected)",
- "# My computers",
- "<os-linux> research-box @ AWS · us-west-2 | Running | AWS · us-west-2",
- "<os-linux> their-box @ Google Cloud · us-central1 | Suspended | Unreachable · offline (dim)"
+ "# spaces.sidebar.section.cloud",
+ "<os-linux> builder | spaces.status.suspended | Unreachable · timed out (dim)",
+ "# spaces.sidebar.section.this_mac",
+ "<os-linux> aurora | spaces.status.running | This Mac",
+ "# spaces.sidebar.section.connected",
+ "<os-windows> 10.0.0.5:3211 | spaces.status.running | 10.0.0.5:3211 (selected)",
+ "# spaces.sidebar.section.my_computers",
+ "<os-linux> research-box @ AWS · us-west-2 | spaces.status.running | AWS · us-west-2",
+ "<os-linux> their-box @ Google Cloud · us-central1 | spaces.status.suspended | Unreachable · offline (dim)"
],
"selectedId": "direct:10.0.0.5:3211",
- "thisMachine": "<os-macos> This computer | This Mac | Sharing · 2 connected"
+ "thisMachine": "<os-macos> This computer | spaces.status.this_mac | Sharing · 2 connected"
}
},
{
@@ -122,18 +122,18 @@
"sidebar": {
"emptyText": null,
"sections": [
- "# Cua Cloud",
- "<os-linux> builder | Suspended | Unreachable · timed out (dim)",
- "# This Mac",
- "<os-linux> aurora | Running | This Mac",
- "# Connected",
- "<os-windows> 10.0.0.5:3211 | Running | 10.0.0.5:3211 (selected)",
- "# My computers",
- "<os-linux> research-box @ AWS · us-west-2 | Running | AWS · us-west-2",
- "<os-linux> their-box @ Google Cloud · us-central1 | Suspended | Unreachable · offline (dim)"
+ "# spaces.sidebar.section.cloud",
+ "<os-linux> builder | spaces.status.suspended | Unreachable · timed out (dim)",
+ "# spaces.sidebar.section.this_mac",
+ "<os-linux> aurora | spaces.status.running | This Mac",
+ "# spaces.sidebar.section.connected",
+ "<os-windows> 10.0.0.5:3211 | spaces.status.running | 10.0.0.5:3211 (selected)",
+ "# spaces.sidebar.section.my_computers",
+ "<os-linux> research-box @ AWS · us-west-2 | spaces.status.running | AWS · us-west-2",
+ "<os-linux> their-box @ Google Cloud · us-central1 | spaces.status.suspended | Unreachable · offline (dim)"
],
"selectedId": "direct:10.0.0.5:3211",
- "thisMachine": "<os-macos> This computer | This Mac | Host service stopped"
+ "thisMachine": "<os-macos> This computer | spaces.status.this_mac | Host service stopped"
}
},
{
@@ -141,8 +141,8 @@
"sidebar": {
"emptyText": null,
"sections": [
- "# This Mac",
- "<os-linux> aurora | Running | This Mac"
+ "# spaces.sidebar.section.this_mac",
+ "<os-linux> aurora | spaces.status.running | This Mac"
],
"selectedId": "this-mac",
"thisMachine": null
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/provisioning.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/provisioning.json
index 02c792e623..2134cc4bc1 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/provisioning.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/provisioning.json
@@ -36,7 +36,7 @@
],
"pending": true,
"rows": [
- "os-linux demo [Running] - -"
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux demo, Linux, This Mac, Running - -"
@@ -98,8 +98,8 @@
],
"pending": true,
"rows": [
- "os-linux New Space [Starting] 10 1%",
- "os-linux demo [Running] - -"
+ "os-linux New Space [spaces.status.starting] 10 1%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux New Space, Linux, This Mac, Starting 10 Starting…",
@@ -162,8 +162,8 @@
],
"pending": true,
"rows": [
- "os-linux New Space [Starting] 10 1%",
- "os-linux demo [Running] - -"
+ "os-linux New Space [spaces.status.starting] 10 1%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux New Space, Linux, This Mac, Starting 10 Starting…",
@@ -226,8 +226,8 @@
],
"pending": true,
"rows": [
- "os-linux New Space [Starting] 425 42%",
- "os-linux demo [Running] - -"
+ "os-linux New Space [spaces.status.starting] 425 42%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux New Space, Linux, This Mac, Starting 425 Downloading image…",
@@ -311,9 +311,9 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Starting] 10 1%",
- "os-linux New Space [Starting] 425 42%",
- "os-linux demo [Running] - -"
+ "os-macos Mac [spaces.status.starting] 10 1%",
+ "os-linux New Space [spaces.status.starting] 425 42%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Starting 10 Starting…",
@@ -398,9 +398,9 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Starting] 13 1%",
- "os-linux New Space [Starting] 425 42%",
- "os-linux demo [Running] - -"
+ "os-macos Mac [spaces.status.starting] 13 1%",
+ "os-linux New Space [spaces.status.starting] 425 42%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Starting 13 Preparing the disk…",
@@ -485,9 +485,9 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Starting] 13 1%",
- "os-linux New Space [Starting] 805 80%",
- "os-linux demo [Running] - -"
+ "os-macos Mac [spaces.status.starting] 13 1%",
+ "os-linux New Space [spaces.status.starting] 805 80%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Starting 13 Preparing the disk…",
@@ -572,9 +572,9 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Failed] - no macOS image is configured",
- "os-linux New Space [Starting] 805 80%",
- "os-linux demo [Running] - -"
+ "os-macos Mac [spaces.status.failed] - no macOS image is configured",
+ "os-linux New Space [spaces.status.starting] 805 80%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Failed - Failed",
@@ -659,9 +659,9 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Failed] - no macOS image is configured",
- "os-linux New Space [Starting] 985 98%",
- "os-linux demo [Running] - -"
+ "os-macos Mac [spaces.status.failed] - no macOS image is configured",
+ "os-linux New Space [spaces.status.starting] 985 98%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Failed - Failed",
@@ -746,9 +746,9 @@
],
"pending": true,
"rows": [
- "os-macos Mac [Failed] - no macOS image is configured",
- "os-linux New Space [Starting] 1000 100%",
- "os-linux demo [Running] - -"
+ "os-macos Mac [spaces.status.failed] - no macOS image is configured",
+ "os-linux New Space [spaces.status.starting] 1000 100%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-macos Mac, macOS, This Mac, Failed - Failed",
@@ -812,8 +812,8 @@
],
"pending": true,
"rows": [
- "os-linux New Space [Starting] 1000 100%",
- "os-linux demo [Running] - -"
+ "os-linux New Space [spaces.status.starting] 1000 100%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux New Space, Linux, This Mac, Starting 1000 Ready",
@@ -896,9 +896,9 @@
],
"pending": true,
"rows": [
- "os-linux Omarchy [Starting] 10 1%",
- "os-linux New Space [Starting] 1000 100%",
- "os-linux demo [Running] - -"
+ "os-linux Omarchy [spaces.status.starting] 10 1%",
+ "os-linux New Space [spaces.status.starting] 1000 100%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux Omarchy, Linux, Cua Cloud, Starting 10 Starting…",
@@ -982,9 +982,9 @@
],
"pending": true,
"rows": [
- "os-linux Omarchy [Failed] - The Cua daemon isn't running. Start Cua, or run `cua daemon start`.",
- "os-linux New Space [Starting] 1000 100%",
- "os-linux demo [Running] - -"
+ "os-linux Omarchy [spaces.status.failed] - The Cua daemon isn't running. Start Cua, or run `cua daemon start`.",
+ "os-linux New Space [spaces.status.starting] 1000 100%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux Omarchy, Linux, Cua Cloud, Failed - Failed",
@@ -1048,8 +1048,8 @@
],
"pending": true,
"rows": [
- "os-linux New Space [Starting] 1000 100%",
- "os-linux demo [Running] - -"
+ "os-linux New Space [spaces.status.starting] 1000 100%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux New Space, Linux, This Mac, Starting 1000 Ready",
@@ -1132,9 +1132,9 @@
],
"pending": true,
"rows": [
- "os-linux Cloud [Starting] 10 1%",
- "os-linux New Space [Starting] 1000 100%",
- "os-linux demo [Running] - -"
+ "os-linux Cloud [spaces.status.starting] 10 1%",
+ "os-linux New Space [spaces.status.starting] 1000 100%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux Cloud, Linux, Cua Cloud, Starting 10 Starting…",
@@ -1218,9 +1218,9 @@
],
"pending": true,
"rows": [
- "os-linux Cloud [Failed] - You're out of Cua Cloud credit.",
- "os-linux New Space [Starting] 1000 100%",
- "os-linux demo [Running] - -"
+ "os-linux Cloud [spaces.status.failed] - You're out of Cua Cloud credit.",
+ "os-linux New Space [spaces.status.starting] 1000 100%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux Cloud, Linux, Cua Cloud, Failed - Failed",
@@ -1284,8 +1284,8 @@
],
"pending": true,
"rows": [
- "os-linux New Space [Starting] 1000 100%",
- "os-linux demo [Running] - -"
+ "os-linux New Space [spaces.status.starting] 1000 100%",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux New Space, Linux, This Mac, Starting 1000 Ready",
@@ -1349,8 +1349,8 @@
],
"pending": true,
"rows": [
- "os-linux fresh [Running] - -",
- "os-linux demo [Running] - -"
+ "os-linux fresh [spaces.status.running] - -",
+ "os-linux demo [spaces.status.running] - -"
],
"tiles": [
"os-linux fresh, Linux, This Mac, Running - -",
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/space-power.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/space-power.json
index aaff4a1ed6..986826c326 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/space-power.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/space-power.json
@@ -103,10 +103,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Running] - - <power Suspend>",
- "os-macos mac [Running] - - <power Turn off>",
- "os-linux studio [Running] - - <power Turn off>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.running] - - <power spaces.power.suspend>",
+ "os-macos mac [spaces.status.running] - - <power spaces.power.turn_off>",
+ "os-linux studio [spaces.status.running] - - <power spaces.power.turn_off>"
],
"tiles": [
"os-linux box, Linux, This Mac, Running - -",
@@ -220,10 +220,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Suspending…] - - <power Suspending… busy>",
- "os-macos mac [Running] - - <power Turn off>",
- "os-linux studio [Running] - - <power Turn off>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.suspending] - - <power spaces.status.suspending busy>",
+ "os-macos mac [spaces.status.running] - - <power spaces.power.turn_off>",
+ "os-linux studio [spaces.status.running] - - <power spaces.power.turn_off>"
],
"tiles": [
"os-linux box, Linux, This Mac, Suspending… - -",
@@ -339,10 +339,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Suspending…] - - <power Suspending… busy>",
- "os-macos mac [Running] - - <power Turn off>",
- "os-linux studio [Running] - - <power Turn off>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.suspending] - - <power spaces.status.suspending busy>",
+ "os-macos mac [spaces.status.running] - - <power spaces.power.turn_off>",
+ "os-linux studio [spaces.status.running] - - <power spaces.power.turn_off>"
],
"tiles": [
"os-linux box, Linux, This Mac, Suspending… - -",
@@ -458,10 +458,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Suspending…] - - <power Suspending… busy>",
- "os-macos mac [Running] - - <power Turn off>",
- "os-linux studio [Running] - - <power Turn off>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.suspending] - - <power spaces.status.suspending busy>",
+ "os-macos mac [spaces.status.running] - - <power spaces.power.turn_off>",
+ "os-linux studio [spaces.status.running] - - <power spaces.power.turn_off>"
],
"tiles": [
"os-linux box, Linux, This Mac, Suspending… - -",
@@ -577,10 +577,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Suspending…] - - <power Suspending… busy>",
- "os-macos mac [Running] - - <power Turn off>",
- "os-linux studio [Running] - - <power Turn off>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.suspending] - - <power spaces.status.suspending busy>",
+ "os-macos mac [spaces.status.running] - - <power spaces.power.turn_off>",
+ "os-linux studio [spaces.status.running] - - <power spaces.power.turn_off>"
],
"tiles": [
"os-linux box, Linux, This Mac, Suspending… - -",
@@ -696,10 +696,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Stopped] - - <power Resume on>",
- "os-macos mac [Running] - - <power Turn off>",
- "os-linux studio [Running] - - <power Turn off>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.stopped] - - <power spaces.power.resume on>",
+ "os-macos mac [spaces.status.running] - - <power spaces.power.turn_off>",
+ "os-linux studio [spaces.status.running] - - <power spaces.power.turn_off>"
],
"tiles": [
"os-linux box, Linux, This Mac, Stopped - -",
@@ -813,10 +813,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Resuming…] - - <power Resuming… on busy>",
- "os-macos mac [Running] - - <power Turn off>",
- "os-linux studio [Running] - - <power Turn off>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.resuming] - - <power spaces.status.resuming on busy>",
+ "os-macos mac [spaces.status.running] - - <power spaces.power.turn_off>",
+ "os-linux studio [spaces.status.running] - - <power spaces.power.turn_off>"
],
"tiles": [
"os-linux box, Linux, This Mac, Resuming… - -",
@@ -933,10 +933,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Stopped] - Could not turn it on: Docker is not running <power Resume on>",
- "os-macos mac [Running] - - <power Turn off>",
- "os-linux studio [Running] - - <power Turn off>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.stopped] - Could not turn it on: Docker is not running <power spaces.power.resume on>",
+ "os-macos mac [spaces.status.running] - - <power spaces.power.turn_off>",
+ "os-linux studio [spaces.status.running] - - <power spaces.power.turn_off>"
],
"tiles": [
"os-linux box, Linux, This Mac, Stopped - -",
@@ -1053,10 +1053,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Stopped] - Could not turn it on: Docker is not running <power Resume on>",
- "os-macos mac [Turning off…] - - <power Turning off… busy>",
- "os-linux studio [Running] - - <power Turn off>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.stopped] - Could not turn it on: Docker is not running <power spaces.power.resume on>",
+ "os-macos mac [spaces.status.turning_off] - - <power spaces.status.turning_off busy>",
+ "os-linux studio [spaces.status.running] - - <power spaces.power.turn_off>"
],
"tiles": [
"os-linux box, Linux, This Mac, Stopped - -",
@@ -1174,10 +1174,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Stopped] - Could not turn it on: Docker is not running <power Resume on>",
- "os-macos mac [Turning off…] - - <power Turning off… busy>",
- "os-linux studio [Running] - - <power Turn off>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.stopped] - Could not turn it on: Docker is not running <power spaces.power.resume on>",
+ "os-macos mac [spaces.status.turning_off] - - <power spaces.status.turning_off busy>",
+ "os-linux studio [spaces.status.running] - - <power spaces.power.turn_off>"
],
"tiles": [
"os-linux box, Linux, This Mac, Stopped - -",
@@ -1295,10 +1295,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Stopped] - Could not turn it on: Docker is not running <power Resume on>",
- "os-macos mac [Stopped] - - <power Turn on on>",
- "os-linux studio [Running] - - <power Turn off>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.stopped] - Could not turn it on: Docker is not running <power spaces.power.resume on>",
+ "os-macos mac [spaces.status.stopped] - - <power spaces.power.turn_on on>",
+ "os-linux studio [spaces.status.running] - - <power spaces.power.turn_off>"
],
"tiles": [
"os-linux box, Linux, This Mac, Stopped - -",
@@ -1415,10 +1415,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Stopped] - Could not turn it on: Docker is not running <power Resume on>",
- "os-macos mac [Stopped] - - <power Turn on on>",
- "os-linux studio [Turning off…] - - <power Turning off… busy>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.stopped] - Could not turn it on: Docker is not running <power spaces.power.resume on>",
+ "os-macos mac [spaces.status.stopped] - - <power spaces.power.turn_on on>",
+ "os-linux studio [spaces.status.turning_off] - - <power spaces.status.turning_off busy>"
],
"tiles": [
"os-linux box, Linux, This Mac, Stopped - -",
@@ -1536,10 +1536,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Stopped] - Could not turn it on: Docker is not running <power Resume on>",
- "os-macos mac [Stopped] - - <power Turn on on>",
- "os-linux studio [Turning off…] - - <power Turning off… busy>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.stopped] - Could not turn it on: Docker is not running <power spaces.power.resume on>",
+ "os-macos mac [spaces.status.stopped] - - <power spaces.power.turn_on on>",
+ "os-linux studio [spaces.status.turning_off] - - <power spaces.status.turning_off busy>"
],
"tiles": [
"os-linux box, Linux, This Mac, Stopped - -",
@@ -1657,10 +1657,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Stopped] - Could not turn it on: Docker is not running <power Resume on>",
- "os-macos mac [Stopped] - - <power Turn on on>",
- "os-linux studio [Stopped] - - <power Turn on on>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.stopped] - Could not turn it on: Docker is not running <power spaces.power.resume on>",
+ "os-macos mac [spaces.status.stopped] - - <power spaces.power.turn_on on>",
+ "os-linux studio [spaces.status.stopped] - - <power spaces.power.turn_on on>"
],
"tiles": [
"os-linux box, Linux, This Mac, Stopped - -",
@@ -1777,10 +1777,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Stopped] - Could not turn it on: Docker is not running <power Resume on>",
- "os-macos mac [Turning on…] - - <power Turning on… on busy>",
- "os-linux studio [Stopped] - - <power Turn on on>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.stopped] - Could not turn it on: Docker is not running <power spaces.power.resume on>",
+ "os-macos mac [spaces.status.turning_on] - - <power spaces.status.turning_on on busy>",
+ "os-linux studio [spaces.status.stopped] - - <power spaces.power.turn_on on>"
],
"tiles": [
"os-linux box, Linux, This Mac, Stopped - -",
@@ -1897,10 +1897,10 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Stopped] - Could not turn it on: Docker is not running <power Resume on>",
- "os-macos mac [Deleting…] - -",
- "os-linux studio [Stopped] - - <power Turn on on>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.stopped] - Could not turn it on: Docker is not running <power spaces.power.resume on>",
+ "os-macos mac [spaces.status.deleting] - -",
+ "os-linux studio [spaces.status.stopped] - - <power spaces.power.turn_on on>"
],
"tiles": [
"os-linux box, Linux, This Mac, Stopped - -",
@@ -1995,9 +1995,9 @@
],
"pending": true,
"rows": [
- "os-linux pool-c [Running] - -",
- "os-linux box [Stopped] - Could not turn it on: Docker is not running <power Resume on>",
- "os-linux studio [Stopped] - - <power Turn on on>"
+ "os-linux pool-c [spaces.status.running] - -",
+ "os-linux box [spaces.status.stopped] - Could not turn it on: Docker is not running <power spaces.power.resume on>",
+ "os-linux studio [spaces.status.stopped] - - <power spaces.power.turn_on on>"
],
"tiles": [
"os-linux box, Linux, This Mac, Stopped - -",
diff --git a/libs/cua/crates/cua-spaces-app-core/src/parity.rs b/libs/cua/crates/cua-spaces-app-core/src/parity.rs
index 460763de40..0b5f0c9b74 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/parity.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/parity.rs
@@ -449,14 +449,14 @@ pub mod frame {
json!({
"thisMachine": v["thisMachine"]["name"],
"sections": v["sections"].as_array().map(|a| a.iter().map(|sec| {
- Value::String(format!("{}: {}", sec["title"].as_str().unwrap_or(""),
+ Value::String(format!("{}: {}", sec["title"]["code"].as_str().unwrap_or(""),
sec["rows"].as_array().map(|r| r.iter().map(|row| format!("{}{}{}",
row["name"].as_str().unwrap_or(""),
if row["dim"] == true { " (dim)" } else { "" },
if row["selected"] == true { " (selected)" } else { "" })).collect::<Vec<_>>().join(", ")).unwrap_or_default()))
}).collect::<Vec<_>>()).unwrap_or_default(),
"selectedId": v["selectedId"],
- "emptyText": v["emptyText"],
+ "emptyText": v["emptyText"]["code"],
})
}
@@ -485,7 +485,7 @@ pub mod frame {
format!(
" <{} {}{}{}>",
str_of(&b["symbol"]),
- str_of(&b["help"]),
+ str_of(&b["help"]["code"]),
if b["turnOn"] == true { " on" } else { "" },
if b["busy"] == true { " busy" } else { "" },
)
@@ -512,7 +512,7 @@ pub mod frame {
.as_str()
.map(|p| format!(" @ {p}"))
.unwrap_or_default(),
- str_of(&r["statusText"]),
+ str_of(&r["statusText"]["code"]),
str_of(&r["detail"]),
if r["dim"] == true { " (dim)" } else { "" },
if r["selected"] == true {
@@ -528,13 +528,13 @@ pub mod frame {
json!({
"thisMachine": if v["thisMachine"].is_null() { Value::Null } else { Value::String(sidebar_row(&v["thisMachine"])) },
"sections": v["sections"].as_array().map(|a| a.iter().flat_map(|sec| {
- let title = str_of(&sec["title"]).to_string();
+ let title = str_of(&sec["title"]["code"]).to_string();
std::iter::once(Value::String(format!("# {title}"))).chain(
sec["rows"].as_array().cloned().unwrap_or_default().into_iter()
.map(|r| Value::String(sidebar_row(&r))))
}).collect::<Vec<_>>()).unwrap_or_default(),
"selectedId": v["selectedId"],
- "emptyText": v["emptyText"],
+ "emptyText": v["emptyText"]["code"],
})
}
@@ -2212,7 +2212,7 @@ fn provisioning_frame(
"{} {} [{}] {} {}{}",
r["osIcon"].as_str().unwrap_or(""),
r["name"].as_str().unwrap_or(""),
- r["statusText"].as_str().unwrap_or(""),
+ r["statusText"]["code"].as_str().unwrap_or(""),
r["progress"]
.as_u64()
.map(|p| p.to_string())
diff --git a/libs/cua/crates/cua-spaces-app-core/src/spaces/mod.rs b/libs/cua/crates/cua-spaces-app-core/src/spaces/mod.rs
index 2e039ff014..3c3317e294 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/spaces/mod.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/spaces/mod.rs
@@ -311,6 +311,20 @@ pub fn off_text(power: &SpacePower) -> String {
}
}
+/// [`off_text`] as a message: `spaces.status.stopped`, or
+/// `spaces.status.stopped_reason` with the `reason`.
+pub fn off_msg(power: &SpacePower) -> crate::message::Msg {
+ use crate::message::Msg;
+ match power
+ .stop_reason
+ .as_deref()
+ .filter(|r| !r.trim().is_empty())
+ {
+ Some(why) => Msg::new("spaces.status.stopped_reason").with("reason", why),
+ None => Msg::new("spaces.status.stopped"),
+ }
+}
+
/// How a stopped Space is off, for the Status fact's tooltip.
pub fn off_hint(control: PowerControl) -> &'static str {
match control {
diff --git a/libs/cua/crates/cua-spaces-app-core/src/spaces/sidebar.rs b/libs/cua/crates/cua-spaces-app-core/src/spaces/sidebar.rs
index 2472133cc2..416f7c263c 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/spaces/sidebar.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/spaces/sidebar.rs
@@ -6,69 +6,118 @@
//! detail (facts, whether it streams, what Delete means).
use crate::host::THIS_MACHINE_ID;
+use crate::message::Msg;
use crate::model::{
PowerControl, Space, SpaceProvider, SpaceStatus, arch_label, emulation_warning, normalize_arch,
};
use serde::{Deserialize, Serialize};
-/// Section titles, in order.
-pub const SECTION_ORDER: [&str; 4] = ["Cua Cloud", "This Mac", "Connected", "My computers"];
+/// Section title codes, in order: "Cua Cloud", "This Mac", "Connected",
+/// "My computers".
+pub const SECTION_ORDER: [&str; 4] = [
+ "spaces.sidebar.section.cloud",
+ "spaces.sidebar.section.this_mac",
+ "spaces.sidebar.section.connected",
+ "spaces.sidebar.section.my_computers",
+];
fn section_of(p: Option<SpaceProvider>) -> &'static str {
match p.unwrap_or(SpaceProvider::Cloud) {
- SpaceProvider::Cloud => "Cua Cloud",
- SpaceProvider::Local => "This Mac",
- SpaceProvider::Direct => "Connected",
- SpaceProvider::Relay => "My computers",
+ SpaceProvider::Cloud => SECTION_ORDER[0],
+ SpaceProvider::Local => SECTION_ORDER[1],
+ SpaceProvider::Direct => SECTION_ORDER[2],
+ SpaceProvider::Relay => SECTION_ORDER[3],
}
}
-/// The status word for a Space row and its detail.
-pub fn status_text(space: &Space) -> String {
+/// The English of the status and power codes below, for the notch labels
+/// and the detail's facts and toolbar, which still carry text (they move to
+/// codes with their own surfaces). The shells' catalogs hold the same text
+/// under the same keys.
+fn english(m: &Msg) -> String {
+ let text = match m.code.as_str() {
+ "spaces.status.failed" => "Failed",
+ "spaces.status.cancelling" => "Cancelling\u{2026}",
+ "spaces.status.this_mac" => "This Mac",
+ "spaces.status.running" => "Running",
+ "spaces.status.local" => "Local",
+ "spaces.status.approval" => "Needs approval",
+ "spaces.status.suspended" => "Suspended",
+ "spaces.status.starting" => "Starting",
+ "spaces.status.deleting" => "Deleting\u{2026}",
+ "spaces.status.stopped" => "Stopped",
+ "spaces.status.stopped_reason" => {
+ return format!(
+ "Stopped: {}",
+ m.vars.get("reason").map_or("", String::as_str)
+ );
+ }
+ "spaces.status.suspending" => "Suspending\u{2026}",
+ "spaces.status.resuming" => "Resuming\u{2026}",
+ "spaces.status.turning_off" => "Turning off\u{2026}",
+ "spaces.status.turning_on" => "Turning on\u{2026}",
+ "spaces.power.suspend" => "Suspend",
+ "spaces.power.resume" => "Resume",
+ "spaces.power.turn_off" => "Turn off",
+ "spaces.power.turn_on" => "Turn on",
+ other => other,
+ };
+ text.into()
+}
+
+fn status_code(status: SpaceStatus) -> &'static str {
+ match status {
+ SpaceStatus::Local => "spaces.status.local",
+ SpaceStatus::Running => "spaces.status.running",
+ SpaceStatus::Approval => "spaces.status.approval",
+ SpaceStatus::Suspended => "spaces.status.suspended",
+ SpaceStatus::Provisioning => "spaces.status.starting",
+ SpaceStatus::Deleting => "spaces.status.deleting",
+ }
+}
+
+/// The status word for a Space row (`spaces.status.*`).
+pub fn status_msg(space: &Space) -> Msg {
if space.progress.as_ref().is_some_and(|p| p.error.is_some()) {
- return "Failed".into();
+ return Msg::new("spaces.status.failed");
}
if space.progress.as_ref().is_some_and(|p| p.cancelling) {
- return "Cancelling\u{2026}".into();
+ return Msg::new("spaces.status.cancelling");
}
// This machine is always usable here; its dot says whether it is
// shared for access, its detail line says how.
if space.id == THIS_MACHINE_ID {
- return "This Mac".into();
+ return Msg::new("spaces.status.this_mac");
}
if space.status != SpaceStatus::Deleting
&& let Some(power) = &space.power
{
if let Some(on) = power.turning_on {
- return power_verb(power.control, on).into();
+ return power_verb(power.control, on);
}
if power.off && space.status == SpaceStatus::Suspended {
- return super::off_text(power);
+ return super::off_msg(power);
}
}
- match space.status {
- SpaceStatus::Running | SpaceStatus::Local => {
- if space.id == THIS_MACHINE_ID {
- "This Mac".into()
- } else {
- "Running".into()
- }
- }
- s => s.label().into(),
- }
+ Msg::new(status_code(space.status))
+}
+
+/// [`status_msg`] as English, for the surfaces that still carry text.
+pub fn status_text(space: &Space) -> String {
+ english(&status_msg(space))
}
/// The power button's SF Symbol.
pub const POWER_SYMBOL: &str = "power";
/// "Suspending…", "Resuming…", "Turning off…", "Turning on…".
-pub fn power_verb(control: PowerControl, on: bool) -> &'static str {
- match (control, on) {
- (PowerControl::Suspend, false) => "Suspending\u{2026}",
- (PowerControl::Suspend, true) => "Resuming\u{2026}",
- (PowerControl::Stop, false) => "Turning off\u{2026}",
- (PowerControl::Stop, true) => "Turning on\u{2026}",
- }
+pub fn power_verb(control: PowerControl, on: bool) -> Msg {
+ Msg::new(match (control, on) {
+ (PowerControl::Suspend, false) => "spaces.status.suspending",
+ (PowerControl::Suspend, true) => "spaces.status.resuming",
+ (PowerControl::Stop, false) => "spaces.status.turning_off",
+ (PowerControl::Stop, true) => "spaces.status.turning_on",
+ })
}
/// The power button next to Delete, on every Space row and in the Space's
@@ -79,8 +128,9 @@ pub struct PowerButton {
/// SF Symbol ([`POWER_SYMBOL`]).
pub symbol: String,
/// Tooltip and accessibility label: "Suspend", "Resume", "Turn off" or
- /// "Turn on"; while it runs, "Suspending…" and the like.
- pub help: String,
+ /// "Turn on" (`spaces.power.*`); while it runs, "Suspending…" and the
+ /// like (`spaces.status.*`).
+ pub help: Msg,
/// A press turns it on (else off): the shell's SDK call.
pub turn_on: bool,
/// It can be pressed (not while an action runs).
@@ -104,16 +154,16 @@ pub fn power_button(space: &Space) -> Option<PowerButton> {
let help = if busy {
power_verb(power.control, turn_on)
} else {
- match (power.control, turn_on) {
- (PowerControl::Suspend, false) => "Suspend",
- (PowerControl::Suspend, true) => "Resume",
- (PowerControl::Stop, false) => "Turn off",
- (PowerControl::Stop, true) => "Turn on",
- }
+ Msg::new(match (power.control, turn_on) {
+ (PowerControl::Suspend, false) => "spaces.power.suspend",
+ (PowerControl::Suspend, true) => "spaces.power.resume",
+ (PowerControl::Stop, false) => "spaces.power.turn_off",
+ (PowerControl::Stop, true) => "spaces.power.turn_on",
+ })
};
Some(PowerButton {
symbol: POWER_SYMBOL.into(),
- help: help.into(),
+ help,
turn_on,
enabled: !busy,
busy,
@@ -174,7 +224,7 @@ pub struct SidebarRow {
/// Status (the dot).
pub status: SpaceStatus,
/// Status word (the dot's accessibility label).
- pub status_text: String,
+ pub status_text: Msg,
/// Tooltip.
pub detail: String,
/// Drawn at reduced opacity.
@@ -203,8 +253,9 @@ pub struct SidebarRow {
/// A titled group of rows.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SidebarSection {
- /// "Cua Cloud", "This Mac", "Connected", "My machines".
- pub title: String,
+ /// "Cua Cloud", "This Mac", "Connected", "My computers"
+ /// (`spaces.sidebar.section.*`).
+ pub title: Msg,
/// Rows.
pub rows: Vec<SidebarRow>,
}
@@ -219,8 +270,9 @@ pub struct SidebarView {
pub sections: Vec<SidebarSection>,
/// The effective selection (falls back to the first Space).
pub selected_id: Option<String>,
- /// "No matches" / "No Spaces yet" when nothing is listed.
- pub empty_text: Option<String>,
+ /// "No matches" / "No Spaces yet" when nothing is listed
+ /// (`spaces.sidebar.*`).
+ pub empty_text: Option<Msg>,
}
fn row(space: &Space, selected: Option<&str>) -> SidebarRow {
@@ -229,7 +281,7 @@ fn row(space: &Space, selected: Option<&str>) -> SidebarRow {
name: space.name.clone(),
os_icon: crate::notch::os_icon(space.os, space.os_name.as_deref()).into(),
status: space.status,
- status_text: status_text(space),
+ status_text: status_msg(space),
detail: space.detail.clone(),
dim: space.id != THIS_MACHINE_ID && !space.status.is_live(),
selected: selected == Some(space.id.as_str()),
@@ -333,17 +385,17 @@ pub fn sidebar(spaces: &[Space], query: &str, selected_id: &str) -> SidebarView
sel,
);
(!rows.is_empty()).then(|| SidebarSection {
- title: (*title).to_string(),
+ title: Msg::new(title),
rows,
})
})
.collect();
let empty_text = sections.is_empty().then(|| {
- if query.trim().is_empty() {
- "No Spaces yet".to_string()
+ Msg::new(if query.trim().is_empty() {
+ "spaces.sidebar.empty"
} else {
- "No matches".to_string()
- }
+ "spaces.sidebar.no_matches"
+ })
});
SidebarView {
this_machine,
@@ -1018,9 +1070,9 @@ pub fn detail_live(
if let Some(b) = power_button(space) {
actions.push(DetailAction {
id: DetailActionId::Power,
- label: b.help.clone(),
+ label: english(&b.help),
symbol: Some(b.symbol),
- help: b.help,
+ help: english(&b.help),
enabled: b.enabled,
destructive: false,
primary: false,
@@ -1494,15 +1546,19 @@ mod tests {
let mine = view
.sections
.iter()
- .find(|s| s.title == "My computers")
+ .find(|s| s.title.code == "spaces.sidebar.section.my_computers")
.unwrap_or_else(|| panic!("no My computers for {features:?} {error:?}: {view:?}"));
assert_eq!(
mine.rows.iter().map(|r| r.id.as_str()).collect::<Vec<_>>(),
[other.as_str()],
"{features:?} {error:?}"
);
- assert!(view.sections.iter().any(|s| s.title == "This Mac"
- && s.rows.iter().any(|r| r.id == "local:space-753034eaaf")));
+ assert!(
+ view.sections
+ .iter()
+ .any(|s| s.title.code == "spaces.sidebar.section.this_mac"
+ && s.rows.iter().any(|r| r.id == "local:space-753034eaaf"))
+ );
}
// Desktop not shared but providing Spaces: its detail says so, with
// Spaces still offered (not hidden as "shares nothing").
@@ -1754,7 +1810,10 @@ mod tests {
assert!(d.actions.iter().all(|a| !a.enabled));
let sb = sidebar(std::slice::from_ref(&space), "", "");
let r = &sb.sections[0].rows[0];
- assert_eq!((r.status_text.as_str(), r.dim), ("Deleting\u{2026}", true));
+ assert_eq!(
+ (r.status_text.code.as_str(), r.dim),
+ ("spaces.status.deleting", true)
+ );
assert_eq!((r.progress, r.trailing.as_deref()), (None, None));
}
@@ -1785,7 +1844,7 @@ mod tests {
let mine = v
.sections
.iter()
- .find(|s| s.title == "My computers")
+ .find(|s| s.title.code == "spaces.sidebar.section.my_computers")
.unwrap();
let rows: Vec<(&str, bool)> = mine
.rows
@@ -1844,7 +1903,7 @@ mod tests {
}
fn help(s: &Space) -> Option<(String, bool, bool)> {
- power_button(s).map(|b| (b.help, b.turn_on, b.enabled))
+ power_button(s).map(|b| (english(&b.help), b.turn_on, b.enabled))
}
#[test]
@@ -1990,10 +2049,10 @@ mod tests {
};
let b = row(&st).power.unwrap();
assert_eq!(
- (b.help.as_str(), b.busy, b.enabled),
+ (english(&b.help).as_str(), b.busy, b.enabled),
("Suspending\u{2026}", true, false)
);
- assert_eq!(row(&st).status_text, "Suspending\u{2026}");
+ assert_eq!(row(&st).status_text.code, "spaces.status.suspending");
// A second press, or one on a Space being deleted, does nothing.
assert_eq!(reduce(&st, &start(true)), st);
let deleting = reduce(
diff --git a/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs b/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
index 8f40b74af9..a83d9c6bb2 100644
--- a/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
+++ b/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
@@ -678,8 +678,9 @@ pub struct AppPowerButton {
/// SF Symbol ([`POWER_SYMBOL`]).
pub symbol: String,
/// Tooltip and accessibility label: "Suspend", "Resume", "Turn off" or
- /// "Turn on"; while it runs, "Suspending…" and the like.
- pub help: String,
+ /// "Turn on" (`spaces.power.*`); while it runs, "Suspending…" and the
+ /// like (`spaces.status.*`).
+ pub help: AppMsg,
/// A press turns it on (else off): the shell's SDK call.
pub turn_on: bool,
/// It can be pressed (not while an action runs).
@@ -702,7 +703,7 @@ pub struct AppSidebarRow {
/// Status (the dot).
pub status: AppSpaceStatus,
/// Status word (the dot's accessibility label).
- pub status_text: String,
+ pub status_text: AppMsg,
/// Tooltip.
pub detail: String,
/// Drawn at reduced opacity.
@@ -729,8 +730,9 @@ pub struct AppSidebarRow {
pub type AppSidebarSection = core::spaces::sidebar::SidebarSection;
#[uniffi::remote(Record)]
pub struct AppSidebarSection {
- /// "Cua Cloud", "This Mac", "Connected", "My machines".
- pub title: String,
+ /// "Cua Cloud", "This Mac", "Connected", "My computers"
+ /// (`spaces.sidebar.section.*`).
+ pub title: AppMsg,
/// Rows.
pub rows: Vec<AppSidebarRow>,
}
@@ -745,8 +747,9 @@ pub struct AppSidebarView {
pub sections: Vec<AppSidebarSection>,
/// The effective selection (falls back to the first Space).
pub selected_id: Option<String>,
- /// "No matches" / "No Spaces yet" when nothing is listed.
- pub empty_text: Option<String>,
+ /// "No matches" / "No Spaces yet" when nothing is listed
+ /// (`spaces.sidebar.*`).
+ pub empty_text: Option<AppMsg>,
}
/// A fact's copy button: an icon button that puts `text` on the pasteboard,
diff --git a/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift b/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
index e86665c269..56cb3c43cd 100644
--- a/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
+++ b/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
@@ -27607,9 +27607,10 @@ public struct AppPowerButton: Equatable, Hashable {
public var symbol: String
/**
* Tooltip and accessibility label: "Suspend", "Resume", "Turn off" or
- * "Turn on"; while it runs, "Suspending…" and the like.
+ * "Turn on" (`spaces.power.*`); while it runs, "Suspending…" and the
+ * like (`spaces.status.*`).
*/
- public var help: String
+ public var help: AppMsg
/**
* A press turns it on (else off): the shell's SDK call.
*/
@@ -27631,8 +27632,9 @@ public struct AppPowerButton: Equatable, Hashable {
*/symbol: String,
/**
* Tooltip and accessibility label: "Suspend", "Resume", "Turn off" or
- * "Turn on"; while it runs, "Suspending…" and the like.
- */help: String,
+ * "Turn on" (`spaces.power.*`); while it runs, "Suspending…" and the
+ * like (`spaces.status.*`).
+ */help: AppMsg,
/**
* A press turns it on (else off): the shell's SDK call.
*/turnOn: Bool,
@@ -27666,7 +27668,7 @@ public struct FfiConverterTypeAppPowerButton: FfiConverterRustBuffer {
return
try AppPowerButton(
symbol: FfiConverterString.read(from: &buf),
- help: FfiConverterString.read(from: &buf),
+ help: FfiConverterTypeAppMsg.read(from: &buf),
turnOn: FfiConverterBool.read(from: &buf),
enabled: FfiConverterBool.read(from: &buf),
busy: FfiConverterBool.read(from: &buf)
@@ -27675,7 +27677,7 @@ public struct FfiConverterTypeAppPowerButton: FfiConverterRustBuffer {
public static func write(_ value: AppPowerButton, into buf: inout [UInt8]) {
FfiConverterString.write(value.symbol, into: &buf)
- FfiConverterString.write(value.help, into: &buf)
+ FfiConverterTypeAppMsg.write(value.help, into: &buf)
FfiConverterBool.write(value.turnOn, into: &buf)
FfiConverterBool.write(value.enabled, into: &buf)
FfiConverterBool.write(value.busy, into: &buf)
@@ -33015,7 +33017,7 @@ public struct AppSidebarRow: Equatable, Hashable {
/**
* Status word (the dot's accessibility label).
*/
- public var statusText: String
+ public var statusText: AppMsg
/**
* Tooltip.
*/
@@ -33071,7 +33073,7 @@ public struct AppSidebarRow: Equatable, Hashable {
*/status: AppSpaceStatus,
/**
* Status word (the dot's accessibility label).
- */statusText: String,
+ */statusText: AppMsg,
/**
* Tooltip.
*/detail: String,
@@ -33135,7 +33137,7 @@ public struct FfiConverterTypeAppSidebarRow: FfiConverterRustBuffer {
name: FfiConverterString.read(from: &buf),
osIcon: FfiConverterString.read(from: &buf),
status: FfiConverterTypeAppSpaceStatus.read(from: &buf),
- statusText: FfiConverterString.read(from: &buf),
+ statusText: FfiConverterTypeAppMsg.read(from: &buf),
detail: FfiConverterString.read(from: &buf),
dim: FfiConverterBool.read(from: &buf),
selected: FfiConverterBool.read(from: &buf),
@@ -33152,7 +33154,7 @@ public struct FfiConverterTypeAppSidebarRow: FfiConverterRustBuffer {
FfiConverterString.write(value.name, into: &buf)
FfiConverterString.write(value.osIcon, into: &buf)
FfiConverterTypeAppSpaceStatus.write(value.status, into: &buf)
- FfiConverterString.write(value.statusText, into: &buf)
+ FfiConverterTypeAppMsg.write(value.statusText, into: &buf)
FfiConverterString.write(value.detail, into: &buf)
FfiConverterBool.write(value.dim, into: &buf)
FfiConverterBool.write(value.selected, into: &buf)
@@ -33182,9 +33184,10 @@ public func FfiConverterTypeAppSidebarRow_lower(_ value: AppSidebarRow) -> RustB
public struct AppSidebarSection: Equatable, Hashable {
/**
- * "Cua Cloud", "This Mac", "Connected", "My machines".
+ * "Cua Cloud", "This Mac", "Connected", "My computers"
+ * (`spaces.sidebar.section.*`).
*/
- public var title: String
+ public var title: AppMsg
/**
* Rows.
*/
@@ -33194,8 +33197,9 @@ public struct AppSidebarSection: Equatable, Hashable {
// declare one manually.
public init(
/**
- * "Cua Cloud", "This Mac", "Connected", "My machines".
- */title: String,
+ * "Cua Cloud", "This Mac", "Connected", "My computers"
+ * (`spaces.sidebar.section.*`).
+ */title: AppMsg,
/**
* Rows.
*/rows: [AppSidebarRow]) {
@@ -33219,13 +33223,13 @@ public struct FfiConverterTypeAppSidebarSection: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppSidebarSection {
return
try AppSidebarSection(
- title: FfiConverterString.read(from: &buf),
+ title: FfiConverterTypeAppMsg.read(from: &buf),
rows: FfiConverterSequenceTypeAppSidebarRow.read(from: &buf)
)
}
public static func write(_ value: AppSidebarSection, into buf: inout [UInt8]) {
- FfiConverterString.write(value.title, into: &buf)
+ FfiConverterTypeAppMsg.write(value.title, into: &buf)
FfiConverterSequenceTypeAppSidebarRow.write(value.rows, into: &buf)
}
}
@@ -33260,9 +33264,10 @@ public struct AppSidebarView: Equatable, Hashable {
*/
public var selectedId: String?
/**
- * "No matches" / "No Spaces yet" when nothing is listed.
+ * "No matches" / "No Spaces yet" when nothing is listed
+ * (`spaces.sidebar.*`).
*/
- public var emptyText: String?
+ public var emptyText: AppMsg?
// Default memberwise initializers are never public by default, so we
// declare one manually.
@@ -33277,8 +33282,9 @@ public struct AppSidebarView: Equatable, Hashable {
* The effective selection (falls back to the first Space).
*/selectedId: String?,
/**
- * "No matches" / "No Spaces yet" when nothing is listed.
- */emptyText: String?) {
+ * "No matches" / "No Spaces yet" when nothing is listed
+ * (`spaces.sidebar.*`).
+ */emptyText: AppMsg?) {
self.thisMachine = thisMachine
self.sections = sections
self.selectedId = selectedId
@@ -33304,7 +33310,7 @@ public struct FfiConverterTypeAppSidebarView: FfiConverterRustBuffer {
thisMachine: FfiConverterOptionTypeAppSidebarRow.read(from: &buf),
sections: FfiConverterSequenceTypeAppSidebarSection.read(from: &buf),
selectedId: FfiConverterOptionString.read(from: &buf),
- emptyText: FfiConverterOptionString.read(from: &buf)
+ emptyText: FfiConverterOptionTypeAppMsg.read(from: &buf)
)
}
@@ -33312,7 +33318,7 @@ public struct FfiConverterTypeAppSidebarView: FfiConverterRustBuffer {
FfiConverterOptionTypeAppSidebarRow.write(value.thisMachine, into: &buf)
FfiConverterSequenceTypeAppSidebarSection.write(value.sections, into: &buf)
FfiConverterOptionString.write(value.selectedId, into: &buf)
- FfiConverterOptionString.write(value.emptyText, into: &buf)
+ FfiConverterOptionTypeAppMsg.write(value.emptyText, into: &buf)
}
}
@@ -62818,6 +62824,30 @@ fileprivate struct FfiConverterOptionTypeAppMenuPreview: FfiConverterRustBuffer
}
}
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+fileprivate struct FfiConverterOptionTypeAppMsg: FfiConverterRustBuffer {
+ typealias SwiftType = AppMsg?
+
+ public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
+ guard let value = value else {
+ writeInt(&buf, Int8(0))
+ return
+ }
+ writeInt(&buf, Int8(1))
+ FfiConverterTypeAppMsg.write(value, into: &buf)
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
+ switch try readInt(&buf) as Int8 {
+ case 0: return nil
+ case 1: return try FfiConverterTypeAppMsg.read(from: &buf)
+ default: throw UniffiInternalError.unexpectedOptionalTag
+ }
+ }
+}
+
#if swift(>=5.8)
@_documentation(visibility: private)
#endif