Refine UI copywriting

This commit is contained in:
Kaede Akino committed 2026-09-23 19:15:15 +08:00
1 parent c1239e9106
commit b77d07e067
10 files changed
+72 -38

No files matched your search

+41 -25
View File
@@ -2892,18 +2892,18 @@
}
}
},
"Add Host Key" : {
"Add Known Host" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "添加主机密钥"
"value" : "添加已知主机"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "新增主機金鑰"
"value" : "新增已知主機"
}
}
}
@@ -8322,6 +8322,22 @@
}
}
},
"Delete %lld Known Hosts?" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "删除%lld个已知主机?"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "刪除%lld個已知主機?"
}
}
}
},
"Delete %lld Snippets" : {
"extractionState" : "stale",
"localizations" : {
@@ -8506,22 +8522,6 @@
}
}
},
"Delete Host Keys?" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "删除主机密钥?"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "刪除主機金鑰?"
}
}
}
},
"Delete Host?" : {
"extractionState" : "manual",
"localizations" : {
@@ -10237,18 +10237,18 @@
}
}
},
"Edit Host Key" : {
"Edit Known Host" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "编辑主机密钥"
"value" : "编辑已知主机"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "編輯主機金鑰"
"value" : "編輯已知主機"
}
}
}
@@ -29027,18 +29027,34 @@
}
}
},
"This permanently removes all connection history without deleting any Hosts." : {
"This action cannot be undone." : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "这将永久清除所有连接历史,但不会删除任何主机。"
"value" : "此操作无法撤销。"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "這將永久清除所有連線歷史,但不會刪除任何主機。"
"value" : "此操作無法復原。"
}
}
}
},
"This permanently removes all connection history." : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "这将永久清除所有连接历史。"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "這將永久清除所有連線歷史。"
}
}
}
@@ -40,9 +40,15 @@ struct MobileHostEditor: View {
_selectedProtocol = State(initialValue: host.sshEnabled ? .ssh : .telnet)
}
var editorTitle: String {
app.library.host(original.id) == nil
? String(localized: "Add Host")
: String(localized: "Edit Host")
}
var body: some View {
MobileEditorSheet(
title: String(localized: "Host"),
title: editorTitle,
isDirty: draft != original || !customIdentity.sshUsername.isEmpty
|| !customIdentity.sshPassword.isEmpty || customIdentity.sshKeyID != nil
|| !customIdentity.telnetUsername.isEmpty || !customIdentity.telnetPassword.isEmpty
@@ -66,7 +66,7 @@ struct MobileKnownHostsView: View {
.navigationTitle("Known Hosts")
.toolbar {
ToolbarItem(placement: .primaryAction) {
Button("Add Host Key", systemImage: "plus") {
Button("Add Known Host", systemImage: "plus") {
editing = KnownHostEntry(hostname: "")
}
}
@@ -100,7 +100,7 @@ struct MobileKnownHostEditor: View {
}
var editorTitle: String {
isNew ? String(localized: "Add Host Key") : String(localized: "Edit Host Key")
isNew ? String(localized: "Add Known Host") : String(localized: "Edit Known Host")
}
var body: some View {
@@ -135,6 +135,8 @@ struct MobileSnippetsView: View {
) {
Button("Delete Snippet", role: .destructive, action: deleteSnippet)
Button("Cancel", role: .cancel) { deletingSnippetID = nil }
} message: {
Text("This action cannot be undone.")
}
.confirmationDialog(
packageDeletionTitle,
+1 -1
View File
@@ -122,7 +122,7 @@ struct MobileConnectionHistoryView: View {
}
Button("Cancel", role: .cancel) {}
} message: {
Text("This permanently removes all connection history without deleting any Hosts.")
Text("This permanently removes all connection history.")
}
}
+2 -2
View File
@@ -105,9 +105,9 @@ struct MobileCardTests {
let edit = MobileKnownHostEditor(app: app, entry: saved)
#expect(add.isNew)
#expect(add.editorTitle == String(localized: "Add Host Key"))
#expect(add.editorTitle == String(localized: "Add Known Host"))
#expect(!edit.isNew)
#expect(edit.editorTitle == String(localized: "Edit Host Key"))
#expect(edit.editorTitle == String(localized: "Edit Known Host"))
}
@Test func hostSectionsFoldNestedGroupsKeepEmptyGroupsAndLeaveSearchAvailable() throws {
@@ -76,14 +76,14 @@ struct KnownHostsPageView: ManagedCardPage {
Text("Import trusted server keys or add a fingerprint manually.")
} actions: {
Button("Import Known Hosts") { window.openVaultWork(.sshImport(knownHostsOnly: true), on: .knownHosts) }
Button("Add Host Key") { window.openVaultWork(.knownHostEditor(nil), on: .knownHosts) }
Button("Add Known Host") { window.openVaultWork(.knownHostEditor(nil), on: .knownHosts) }
}
}
func managedNoResultsState() -> some View { ContentUnavailableView.search(text: state.query) }
var managedPresentation: ManagedCardDeletionPresentation<UUID> {
ManagedCardDeletionPresentation(
deleting: $state.deleting, error: $state.error, ids: app.knownHosts.entries.map(\.id),
confirmationTitle: "Delete Host Keys?", errorTitle: "Known Hosts Operation Failed",
confirmationTitle: deletionTitle, errorTitle: "Known Hosts Operation Failed",
explanation: Text("The next connection will ask you to verify the server key again."),
prune: { window.pruneVaultSelections(in: app.hostLibrary) },
delete: {
@@ -93,6 +93,12 @@ struct KnownHostsPageView: ManagedCardPage {
})
}
private var deletionTitle: LocalizedStringKey {
state.deleting.count == 1
? "Delete Known Host?"
: "Delete \(state.deleting.count) Known Hosts?"
}
private func select(_ entry: KnownHostEntry, action: @escaping () -> Void) {
guard let route = window.vaultWorkRoute, case .knownHostEditor(let editingID) = route else {
action()
@@ -182,7 +188,7 @@ struct KnownHostEditorView: View {
var body: some View {
VaultDetailScaffold(
title: entryID == nil ? "Add Host Key" : "Edit Host Key", symbol: "touchid",
title: entryID == nil ? "Add Known Host" : "Edit Known Host", symbol: "touchid",
close: cancelEditing, closeLabel: "Cancel"
) {
Form {
@@ -234,7 +240,7 @@ struct KnownHostEditorView: View {
guard let editingToken else { return }
editingSession.unregister(editingToken)
}
.confirmationDialog("Delete Host Keys?", isPresented: $confirmsDeletion, titleVisibility: .visible) {
.confirmationDialog("Delete Known Host?", isPresented: $confirmsDeletion, titleVisibility: .visible) {
Button("Delete", role: .destructive, action: delete)
Button("Cancel", role: .cancel) {}
} message: {
+1 -1
View File
@@ -1261,7 +1261,7 @@ private struct ConnectionHistorySidebar: View {
}
Button("Cancel", role: .cancel) {}
} message: {
Text("This permanently removes all connection history without deleting any Hosts.")
Text("This permanently removes all connection history.")
}
}
+5 -1
View File
@@ -428,7 +428,9 @@ struct SnippetsPagePresentation: ManagedCardPresentationModifier {
: Text("This package tree contains \(count) snippets.")
case .executeDestructive(let batch):
return Text(actions.executionMessage(batch.snippets))
case .deleteSnippets, nil:
case .deleteSnippets:
return Text("This action cannot be undone.")
case nil:
return Text("")
}
}
@@ -605,6 +607,8 @@ struct SnippetEditorSheet: View {
.confirmationDialog("Delete Snippet?", isPresented: $confirmsDeletion, titleVisibility: .visible) {
Button("Delete Snippet", role: .destructive, action: delete)
Button("Cancel", role: .cancel) {}
} message: {
Text("This action cannot be undone.")
}
}
+1 -1
View File
@@ -781,7 +781,7 @@ extension WindowModel {
]
case .knownHosts:
return [
WindowToolbarCreationAction(id: "known-host", title: "Add Host Key", symbol: "plus") {
WindowToolbarCreationAction(id: "known-host", title: "Add Known Host", symbol: "plus") {
self.openVaultWork(.knownHostEditor(nil), on: .knownHosts)
},
WindowToolbarCreationAction(