Skip to content

Commit 255d9ac

Browse files
committed
Update toolbar button placement and strings.
1 parent 3bec72e commit 255d9ac

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

WooCommerce/Classes/ViewRelated/Custom Fields/CustomFieldEditorView.swift

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ struct CustomFieldEditorView: View {
9999
}
100100
.background(Color(.listBackground))
101101
.toolbar {
102-
ToolbarItem(placement: .topBarLeading) {
102+
ToolbarItem(placement: .cancellationAction) {
103103
Button {
104104
dismiss()
105105
} label: {
106-
Text("Cancel") // todo-13493: set String to be translatable
106+
Text(Localization.cancelButton)
107107
}
108108
}
109109
ToolbarItem(placement: .navigationBarTrailing) {
@@ -112,7 +112,7 @@ struct CustomFieldEditorView: View {
112112
saveChanges()
113113
dismiss()
114114
} label: {
115-
Text("Save") // todo-13493: set String to be translatable
115+
Text(Localization.saveButton)
116116
}
117117
.disabled(!hasUnsavedChanges)
118118

@@ -163,6 +163,18 @@ private extension CustomFieldEditorView {
163163
}
164164

165165
enum Localization {
166+
static let cancelButton = NSLocalizedString(
167+
"customFieldEditorView.cancel",
168+
value: "Cancel",
169+
comment: "Label for the Cancel button to close the editor"
170+
)
171+
172+
static let saveButton = NSLocalizedString(
173+
"customFieldEditorView.save",
174+
value: "Save",
175+
comment: "Label for the Save button to save changes"
176+
)
177+
166178
static let keyLabel = NSLocalizedString(
167179
"customFieldEditorView.keyLabel",
168180
value: "Key",

0 commit comments

Comments
 (0)