Skip to content

Commit 6f448f0

Browse files
committed
extract texts
1 parent 184d32d commit 6f448f0

File tree

3 files changed

+51
-22
lines changed

3 files changed

+51
-22
lines changed

Bitkit/Resources/Localization/en.lproj/Localizable.strings

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,25 @@
740740
"settings__adv__monitored_address_types" = "Monitored Address Types";
741741
"settings__adv__monitored_address_types_update_title" = "Monitored Address Types Updated";
742742
"settings__adv__monitored_address_types_update_description" = "Changes will take full effect after app restarts.";
743+
"settings__adv__addr_type_timeout_title" = "Timeout";
744+
"settings__adv__addr_type_timeout_desc" = "The operation took too long. Please try again.";
745+
"settings__adv__addr_type_failed_title" = "Failed";
746+
"settings__adv__addr_type_change_failed_desc" = "Could not change address type. Please try again.";
747+
"settings__adv__addr_type_changed_title" = "Address Type Changed";
748+
"settings__adv__addr_type_changed_desc" = "Now using {type} addresses.";
749+
"settings__adv__addr_type_monitored_updated_title" = "Settings Updated";
750+
"settings__adv__addr_type_monitored_updated_desc" = "Address monitoring settings applied.";
751+
"settings__adv__addr_type_cannot_disable_title" = "Cannot Disable";
752+
"settings__adv__addr_type_cannot_disable_native_desc" = "At least one Native SegWit or Taproot wallet is required for Lightning channels.";
753+
"settings__adv__addr_type_cannot_disable_balance_desc" = "{type} addresses have balance.";
754+
"settings__adv__addr_type_monitored_failed_desc" = "Could not update monitoring settings. Please try again.";
755+
"settings__adv__addr_type_currently_selected" = "Currently selected";
756+
"settings__adv__addr_type_monitored_note" = "Enable monitoring to track funds received at different address types. The app will watch these addresses for incoming transactions. Disabling monitoring for a type with balance may hide your funds.";
757+
"settings__adv__addr_type_loading_nav_address" = "Address Type";
758+
"settings__adv__addr_type_loading_nav_monitoring" = "Address Monitoring";
759+
"settings__adv__addr_type_loading_headline" = "Switching to <accent>{type}</accent>";
760+
"settings__adv__addr_type_loading_updating" = "Updating Wallet";
761+
"settings__adv__addr_type_loading_desc" = "Please wait while the wallet restarts...";
743762
"settings__adv__gap_limit" = "Address Gap Limit";
744763
"settings__adv__coin_selection" = "Coin Selection";
745764
"settings__adv__cs_method" = "Coin Selection Method";

Bitkit/Views/Settings/Advanced/AddressTypeLoadingView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ struct AddressTypeLoadingView: View {
55
let isMonitoringChange: Bool
66

77
private var navTitle: String {
8-
isMonitoringChange ? "Address Monitoring" : "Address Type"
8+
isMonitoringChange ? t("settings__adv__addr_type_loading_nav_monitoring") : t("settings__adv__addr_type_loading_nav_address")
99
}
1010

1111
private var headline: String {
1212
if let addressType = targetAddressType, !isMonitoringChange {
13-
return "Switching to <accent>\(addressType.localizedTitle)</accent>"
13+
return t("settings__adv__addr_type_loading_headline", variables: ["type": addressType.localizedTitle])
1414
}
15-
return "Updating Wallet"
15+
return t("settings__adv__addr_type_loading_updating")
1616
}
1717

1818
private var description: String {
19-
"Please wait while the wallet restarts..."
19+
t("settings__adv__addr_type_loading_desc")
2020
}
2121

2222
var body: some View {

Bitkit/Views/Settings/Advanced/AddressTypePreferenceView.swift

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct MonitoredAddressTypeToggle: View {
125125
VStack(alignment: .leading, spacing: 4) {
126126
BodyMText("\(addressType.localizedTitle) \(addressType.shortExample)", textColor: .textPrimary)
127127
if isSelectedType {
128-
BodySText("Currently selected", textColor: .textSecondary)
128+
BodySText(t("settings__adv__addr_type_currently_selected"), textColor: .textSecondary)
129129
}
130130
}
131131
Spacer()
@@ -196,20 +196,27 @@ struct AddressTypePreferenceView: View {
196196
showLoadingView = false
197197

198198
if didTimeout {
199-
app.toast(type: .error, title: "Timeout", description: "The operation took too long. Please try again.")
199+
app.toast(
200+
type: .error,
201+
title: t("settings__adv__addr_type_timeout_title"),
202+
description: t("settings__adv__addr_type_timeout_desc")
203+
)
200204
} else if success {
201205
Haptics.notify(.success)
202206
navigation.reset()
203207
app.toast(
204208
type: .success,
205-
title: "Address Type Changed",
206-
description: "Now using \(addressType.localizedTitle) addresses."
209+
title: t("settings__adv__addr_type_changed_title"),
210+
description: t(
211+
"settings__adv__addr_type_changed_desc",
212+
variables: ["type": addressType.localizedTitle]
213+
)
207214
)
208215
} else {
209216
app.toast(
210217
type: .error,
211-
title: "Failed",
212-
description: "Could not change address type. Please try again."
218+
title: t("settings__adv__addr_type_failed_title"),
219+
description: t("settings__adv__addr_type_change_failed_desc")
213220
)
214221
}
215222
}
@@ -221,7 +228,7 @@ struct AddressTypePreferenceView: View {
221228
if showDevSettings {
222229
VStack(alignment: .leading, spacing: 0) {
223230
HStack {
224-
CaptionMText("Monitored Address Types")
231+
CaptionMText(t("settings__adv__monitored_address_types"))
225232
Spacer()
226233
Button(action: { showMonitoredTypesNote.toggle() }) {
227234
Image(systemName: "info.circle")
@@ -233,7 +240,7 @@ struct AddressTypePreferenceView: View {
233240

234241
if showMonitoredTypesNote {
235242
BodySText(
236-
"Enable monitoring to track funds received at different address types. The app will watch these addresses for incoming transactions. Disabling monitoring for a type with balance may hide your funds.",
243+
t("settings__adv__addr_type_monitored_note"),
237244
textColor: .textSecondary
238245
)
239246
.padding(.bottom, 12)
@@ -261,35 +268,38 @@ struct AddressTypePreferenceView: View {
261268
if didTimeout {
262269
app.toast(
263270
type: .error,
264-
title: "Timeout",
265-
description: "The operation took too long. Please try again."
271+
title: t("settings__adv__addr_type_timeout_title"),
272+
description: t("settings__adv__addr_type_timeout_desc")
266273
)
267274
} else if success {
268275
Haptics.notify(.success)
269276
app.toast(
270277
type: .success,
271-
title: "Settings Updated",
272-
description: "Address monitoring settings applied."
278+
title: t("settings__adv__addr_type_monitored_updated_title"),
279+
description: t("settings__adv__addr_type_monitored_updated_desc")
273280
)
274281
} else if !enabled {
275282
if settingsViewModel.isLastRequiredNativeWitnessWallet(addressType) {
276283
app.toast(
277284
type: .error,
278-
title: "Cannot Disable",
279-
description: "At least one Native SegWit or Taproot wallet is required for Lightning channels."
285+
title: t("settings__adv__addr_type_cannot_disable_title"),
286+
description: t("settings__adv__addr_type_cannot_disable_native_desc")
280287
)
281288
} else {
282289
app.toast(
283290
type: .error,
284-
title: "Cannot Disable",
285-
description: "\(addressType.localizedTitle) addresses have balance."
291+
title: t("settings__adv__addr_type_cannot_disable_title"),
292+
description: t(
293+
"settings__adv__addr_type_cannot_disable_balance_desc",
294+
variables: ["type": addressType.localizedTitle]
295+
)
286296
)
287297
}
288298
} else {
289299
app.toast(
290300
type: .error,
291-
title: "Failed",
292-
description: "Could not update monitoring settings. Please try again."
301+
title: t("settings__adv__addr_type_failed_title"),
302+
description: t("settings__adv__addr_type_monitored_failed_desc")
293303
)
294304
}
295305
}

0 commit comments

Comments
 (0)