Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Bitkit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
Constants/Env.swift,
Extensions/HexBytes.swift,
"Extensions/LDKNode+AddressType.swift",
"Extensions/PaymentFailureReason+UserMessage.swift",
Extensions/PaymentDetails.swift,
Models/BlocksWidgetOptions.swift,
Models/BlocktankNotificationType.swift,
Expand Down Expand Up @@ -195,6 +196,7 @@
Constants/Env.swift,
Extensions/HexBytes.swift,
"Extensions/LDKNode+AddressType.swift",
"Extensions/PaymentFailureReason+UserMessage.swift",
Extensions/PaymentDetails.swift,
Models/BlocktankNotificationType.swift,
Models/LnPeer.swift,
Expand Down
44 changes: 37 additions & 7 deletions Bitkit/Extensions/PaymentFailureReason+UserMessage.swift
Original file line number Diff line number Diff line change
@@ -1,21 +1,51 @@
import LDKNode

extension PaymentFailureReason {
enum UserMessageContext {
case generic
case send
}

/// User-facing message for a failed payment, mirroring Android's
/// `PaymentFailureReason.toUserMessage`; reasons without a dedicated string fall back to
/// the generic payment-failed description.
static func userMessage(for reason: PaymentFailureReason?) -> String {
static func userMessage(for reason: PaymentFailureReason?, context: UserMessageContext = .generic) -> String {
t(userMessageKey(for: reason, context: context))
}

static func userMessageKey(for reason: PaymentFailureReason?, context: UserMessageContext = .generic) -> String {
switch reason {
case .recipientRejected:
return t("wallet__toast_payment_failed_recipient_rejected")
return "wallet__payment_recipient_rejected"
case .userAbandoned:
return "wallet__payment_abandoned"
case .retriesExhausted:
return t("wallet__toast_payment_failed_retries_exhausted")
case .routeNotFound:
return t("wallet__toast_payment_failed_route_not_found")
switch context {
case .generic:
return "wallet__payment_retries_exhausted"
case .send:
return "wallet__send_payment_retries_exhausted"
}
case .paymentExpired:
return t("wallet__toast_payment_failed_timeout")
return "wallet__payment_expired"
case .routeNotFound:
switch context {
case .generic:
return "wallet__payment_route_not_found"
case .send:
return "wallet__send_payment_route_not_found"
}
case .unknownRequiredFeatures:
return "wallet__payment_unknown_required_features"
case .invoiceRequestExpired:
return "wallet__payment_invoice_request_expired"
case .invoiceRequestRejected:
return "wallet__payment_invoice_request_rejected"
default:
return t("wallet__toast_payment_failed_description")
switch context {
case .generic, .send:
return "wallet__payment_failed_description"
}
}
}
}
11 changes: 11 additions & 0 deletions Bitkit/Resources/Localization/ar.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
"common__delete_yes" = "نعم، احذف";
"wallet__payment_recipient_rejected" = "رفض المستلم دفعة Lightning هذه. تحقق من الفاتورة وحاول مرة أخرى.";
"wallet__payment_abandoned" = "تم إيقاف دفعة Lightning قبل اكتمالها.";
"wallet__payment_expired" = "انتهت صلاحية دفعة Lightning هذه. اطلب فاتورة جديدة.";
"wallet__payment_timeout" = "انتهت مهلة الدفع. حاول مرة أخرى.";
"wallet__send_payment_route_not_found" = "لم يتمكن Bitkit من العثور على مسار Lightning لهذه الدفعة. اضغط على إعادة المحاولة لتحديث توجيه المدفوعات والبحث عن مسار جديد.";
"wallet__send_payment_retries_exhausted" = "جرّب Bitkit عدة مسارات Lightning، لكن تعذر إكمال الدفعة. اضغط على إعادة المحاولة لتحديث توجيه المدفوعات وتجربة مسار جديد.";
"wallet__payment_route_not_found" = "لم يتمكن Bitkit من العثور على مسار Lightning لهذه الدفعة.";
"wallet__payment_retries_exhausted" = "جرّب Bitkit عدة مسارات Lightning، لكن تعذر إكمال الدفعة.";
"wallet__payment_unknown_required_features" = "تستخدم فاتورة Lightning هذه ميزات لا يدعمها Bitkit بعد.";
"wallet__payment_invoice_request_expired" = "انتهت صلاحية طلب فاتورة Lightning هذا. اطلب فاتورة جديدة.";
"wallet__payment_invoice_request_rejected" = "رفض المستلم طلب فاتورة Lightning هذا.";
"settings__backup__category_contacts" = "جهات الاتصال";
"slashtags__your_name" = "اسمك";
"slashtags__your_name_capital" = "اسمك";
Expand Down
13 changes: 12 additions & 1 deletion Bitkit/Resources/Localization/ca.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,18 @@
"wallet__tags_no" = "Cap etiqueta disponible encara";
"wallet__toast_payment_success_title" = "Pagament enviat";
"wallet__toast_payment_failed_title" = "Pagament fallit";
"wallet__toast_payment_failed_description" = "El teu pagament instantani ha fallat. Si us plau, torna-ho a provar.";
"wallet__payment_failed_description" = "El teu pagament instantani ha fallat. Si us plau, torna-ho a provar.";
"wallet__payment_recipient_rejected" = "El destinatari ha rebutjat aquest pagament Lightning. Comprova la factura i torna-ho a provar.";
"wallet__payment_abandoned" = "El pagament Lightning s'ha aturat abans de completar-se.";
"wallet__payment_expired" = "Aquest pagament Lightning ha caducat. Demana una factura nova.";
"wallet__payment_timeout" = "El pagament ha esgotat el temps d'espera. Torna-ho a provar.";
"wallet__send_payment_route_not_found" = "Bitkit no ha pogut trobar cap ruta Lightning per a aquest pagament. Toca Torna-ho a provar per actualitzar l'encaminament de pagaments i buscar una ruta nova.";
"wallet__send_payment_retries_exhausted" = "Bitkit ha provat diverses rutes Lightning, però el pagament no s'ha pogut completar. Toca Torna-ho a provar per actualitzar l'encaminament de pagaments i provar una ruta nova.";
"wallet__payment_route_not_found" = "Bitkit no ha pogut trobar cap ruta Lightning per a aquest pagament.";
"wallet__payment_retries_exhausted" = "Bitkit ha provat diverses rutes Lightning, però el pagament no s'ha pogut completar.";
"wallet__payment_unknown_required_features" = "Aquesta factura Lightning utilitza funcions que Bitkit encara no admet.";
"wallet__payment_invoice_request_expired" = "Aquesta sol·licitud de factura Lightning ha caducat. Demana una factura nova.";
"wallet__payment_invoice_request_rejected" = "El destinatari ha rebutjat aquesta sol·licitud de factura Lightning.";
"wallet__toast_received_transaction_replaced_title" = "Transacció rebuda substituïda";
"wallet__toast_received_transaction_replaced_description" = "La teva transacció rebuda s\'ha substituït per un augment de comissió";
"wallet__toast_transaction_replaced_title" = "Transacció substituïda";
Expand Down
13 changes: 12 additions & 1 deletion Bitkit/Resources/Localization/cs.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,18 @@
"wallet__toast_payment_success_title" = "Platba odeslána";
"wallet__toast_payment_success_description" = "Vaše okamžitá platba byla úspěšně odeslána.";
"wallet__toast_payment_failed_title" = "Platba se nezdařila";
"wallet__toast_payment_failed_description" = "Vaše okamžitá platba se nezdařila. Zkuste to prosím znovu.";
"wallet__payment_failed_description" = "Vaše okamžitá platba se nezdařila. Zkuste to prosím znovu.";
"wallet__payment_recipient_rejected" = "Příjemce tuto Lightning platbu odmítl. Zkontrolujte fakturu a zkuste to znovu.";
"wallet__payment_abandoned" = "Lightning platba byla zastavena před dokončením.";
"wallet__payment_expired" = "Platnost této Lightning platby vypršela. Vyžádejte si novou fakturu.";
"wallet__payment_timeout" = "Časový limit platby vypršel. Zkuste to znovu.";
"wallet__send_payment_route_not_found" = "Bitkit nenašel pro tuto platbu žádnou Lightning trasu. Klepněte na Opakovat, aby se aktualizovalo směrování plateb a zkusila se najít nová trasa.";
"wallet__send_payment_retries_exhausted" = "Bitkit vyzkoušel několik Lightning tras, ale platbu se nepodařilo dokončit. Klepněte na Opakovat, aby se aktualizovalo směrování plateb a zkusila se nová trasa.";
"wallet__payment_route_not_found" = "Bitkit nenašel pro tuto platbu žádnou Lightning trasu.";
"wallet__payment_retries_exhausted" = "Bitkit vyzkoušel několik Lightning tras, ale platbu se nepodařilo dokončit.";
"wallet__payment_unknown_required_features" = "Tato Lightning faktura používá funkce, které Bitkit zatím nepodporuje.";
"wallet__payment_invoice_request_expired" = "Platnost této žádosti o Lightning fakturu vypršela. Vyžádejte si novou fakturu.";
"wallet__payment_invoice_request_rejected" = "Příjemce tuto žádost o Lightning fakturu odmítl.";
"wallet__toast_received_transaction_replaced_title" = "Přijatá transakce nahrazena";
"wallet__toast_received_transaction_replaced_description" = "Vaše přijatá transakce byla nahrazena navýšením poplatku";
"wallet__toast_transaction_replaced_title" = "Transakce nahrazena";
Expand Down
13 changes: 12 additions & 1 deletion Bitkit/Resources/Localization/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,18 @@
"wallet__toast_payment_success_title" = "Zahlung gesendet";
"wallet__toast_payment_success_description" = "Deine sofortige Zahlung wurde erfolgreich gesendet.";
"wallet__toast_payment_failed_title" = "Zahlung fehlgeschlagen";
"wallet__toast_payment_failed_description" = "Deine sofortige Zahlung ist fehlgeschlagen. Bitte versuche es erneut.";
"wallet__payment_failed_description" = "Deine sofortige Zahlung ist fehlgeschlagen. Bitte versuche es erneut.";
"wallet__payment_recipient_rejected" = "Der Empfänger hat diese Lightning-Zahlung abgelehnt. Bitte prüfe die Rechnung und versuche es erneut.";
"wallet__payment_abandoned" = "Die Lightning-Zahlung wurde gestoppt, bevor sie abgeschlossen wurde.";
"wallet__payment_expired" = "Diese Lightning-Zahlung ist abgelaufen. Bitte fordere eine neue Rechnung an.";
"wallet__payment_timeout" = "Zeitüberschreitung bei der Zahlung. Bitte versuche es erneut.";
"wallet__send_payment_route_not_found" = "Bitkit konnte keine Lightning-Route für diese Zahlung finden. Tippe auf Wiederholen, um das Zahlungsrouting zu aktualisieren und nach einem neuen Pfad zu suchen.";
"wallet__send_payment_retries_exhausted" = "Bitkit hat mehrere Lightning-Routen ausprobiert, aber die Zahlung konnte nicht abgeschlossen werden. Tippe auf Wiederholen, um das Zahlungsrouting zu aktualisieren und einen neuen Pfad zu probieren.";
"wallet__payment_route_not_found" = "Bitkit konnte keine Lightning-Route für diese Zahlung finden.";
"wallet__payment_retries_exhausted" = "Bitkit hat mehrere Lightning-Routen ausprobiert, aber die Zahlung konnte nicht abgeschlossen werden.";
"wallet__payment_unknown_required_features" = "Diese Lightning-Rechnung verwendet Funktionen, die Bitkit noch nicht unterstützt.";
"wallet__payment_invoice_request_expired" = "Diese Lightning-Rechnungsanfrage ist abgelaufen. Bitte fordere eine neue Rechnung an.";
"wallet__payment_invoice_request_rejected" = "Der Empfänger hat diese Lightning-Rechnungsanfrage abgelehnt.";
"wallet__toast_received_transaction_replaced_title" = "Empfangene Transaktion ersetzt";
"wallet__toast_received_transaction_replaced_description" = "Deine empfangene Transaktion wurde durch eine Gebührenerhöhung ersetzt";
"wallet__toast_transaction_replaced_title" = "Transaktion ersetzt";
Expand Down
13 changes: 12 additions & 1 deletion Bitkit/Resources/Localization/el.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,18 @@
"wallet__tags_filter_title" = "Επιλογή Ετικέτας";
"wallet__tags_no" = "Δεν υπάρχουν διαθέσιμες ετικέτες ακόμα";
"wallet__toast_payment_failed_title" = "Η Πληρωμή Απέτυχε";
"wallet__toast_payment_failed_description" = "Η άμεση πληρωμή σας απέτυχε. Παρακαλώ δοκιμάστε ξανά.";
"wallet__payment_failed_description" = "Η άμεση πληρωμή σας απέτυχε. Παρακαλώ δοκιμάστε ξανά.";
"wallet__payment_recipient_rejected" = "Ο παραλήπτης απέρριψε αυτήν την πληρωμή Lightning. Ελέγξτε το τιμολόγιο και δοκιμάστε ξανά.";
"wallet__payment_abandoned" = "Η πληρωμή Lightning σταμάτησε πριν ολοκληρωθεί.";
"wallet__payment_expired" = "Αυτή η πληρωμή Lightning έληξε. Ζητήστε νέο τιμολόγιο.";
"wallet__payment_timeout" = "Το χρονικό όριο πληρωμής έληξε. Δοκιμάστε ξανά.";
"wallet__send_payment_route_not_found" = "Το Bitkit δεν μπόρεσε να βρει διαδρομή Lightning για αυτήν την πληρωμή. Πατήστε Επανάληψη για να ενημερωθεί η δρομολόγηση πληρωμών και να αναζητηθεί νέα διαδρομή.";
"wallet__send_payment_retries_exhausted" = "Το Bitkit δοκίμασε αρκετές διαδρομές Lightning, αλλά η πληρωμή δεν μπόρεσε να ολοκληρωθεί. Πατήστε Επανάληψη για να ενημερωθεί η δρομολόγηση πληρωμών και να δοκιμαστεί νέα διαδρομή.";
"wallet__payment_route_not_found" = "Το Bitkit δεν μπόρεσε να βρει διαδρομή Lightning για αυτήν την πληρωμή.";
"wallet__payment_retries_exhausted" = "Το Bitkit δοκίμασε αρκετές διαδρομές Lightning, αλλά η πληρωμή δεν μπόρεσε να ολοκληρωθεί.";
"wallet__payment_unknown_required_features" = "Αυτό το τιμολόγιο Lightning χρησιμοποιεί λειτουργίες που το Bitkit δεν υποστηρίζει ακόμη.";
"wallet__payment_invoice_request_expired" = "Αυτό το αίτημα τιμολογίου Lightning έληξε. Ζητήστε νέο τιμολόγιο.";
"wallet__payment_invoice_request_rejected" = "Ο παραλήπτης απέρριψε αυτό το αίτημα τιμολογίου Lightning.";
"wallet__toast_received_transaction_replaced_title" = "Η Ληφθείσα Συναλλαγή Αντικαταστάθηκε";
"wallet__toast_received_transaction_replaced_description" = "Η ληφθείσα συναλλαγή σας αντικαταστάθηκε από ενίσχυση τέλους";
"wallet__toast_transaction_replaced_title" = "Η Συναλλαγή Αντικαταστάθηκε";
Expand Down
17 changes: 12 additions & 5 deletions Bitkit/Resources/Localization/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1305,11 +1305,18 @@
"wallet__toast_payment_success_title" = "Payment Sent";
"wallet__toast_payment_success_description" = "Your instant payment was sent successfully.";
"wallet__toast_payment_failed_title" = "Payment Failed";
"wallet__toast_payment_failed_description" = "Your instant payment failed. Please try again.";
"wallet__toast_payment_failed_timeout" = "Payment timed out. Please try again.";
"wallet__toast_payment_failed_recipient_rejected" = "The recipient rejected this payment. Try a different amount.";
"wallet__toast_payment_failed_retries_exhausted" = "Could not find a route with sufficient liquidity. Try a smaller amount or wait and try again.";
"wallet__toast_payment_failed_route_not_found" = "Could not find a payment path to the recipient.";
"wallet__payment_failed_description" = "Your instant payment failed. Please try again.";
"wallet__payment_recipient_rejected" = "The recipient rejected this Lightning payment. Please check the invoice and try again.";
"wallet__payment_abandoned" = "The Lightning payment was stopped before it completed.";
"wallet__payment_expired" = "This Lightning payment expired. Please request a new invoice.";
"wallet__payment_timeout" = "Payment timed out. Please try again.";
"wallet__send_payment_route_not_found" = "Bitkit couldn't find a Lightning route for this payment. Tap Retry to update payment routing and check for a new path.";
"wallet__send_payment_retries_exhausted" = "Bitkit tried several Lightning routes, but the payment could not be completed. Tap Retry to update payment routing and try a new path.";
"wallet__payment_route_not_found" = "Bitkit couldn't find a Lightning route for this payment.";
"wallet__payment_retries_exhausted" = "Bitkit tried several Lightning routes, but the payment could not be completed.";
"wallet__payment_unknown_required_features" = "This Lightning invoice uses features Bitkit does not support yet.";
"wallet__payment_invoice_request_expired" = "This Lightning invoice request expired. Please request a new invoice.";
"wallet__payment_invoice_request_rejected" = "The recipient rejected this Lightning invoice request.";
"wallet__toast_received_transaction_replaced_title" = "Received Transaction Replaced";
"wallet__toast_received_transaction_replaced_description" = "Your received transaction was replaced by a fee bump";
"wallet__toast_transaction_replaced_title" = "Transaction Replaced";
Expand Down
13 changes: 12 additions & 1 deletion Bitkit/Resources/Localization/es-419.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,18 @@
"wallet__toast_payment_success_title" = "Pago enviado";
"wallet__toast_payment_success_description" = "Su pago instantáneo se ha enviado.";
"wallet__toast_payment_failed_title" = "Pago fallido";
"wallet__toast_payment_failed_description" = "Su pago instantáneo ha fallado. Por favor, inténtelo de nuevo.";
"wallet__payment_failed_description" = "Su pago instantáneo ha fallado. Por favor, inténtelo de nuevo.";
"wallet__payment_recipient_rejected" = "El destinatario rechazó este pago Lightning. Revise la factura e inténtelo de nuevo.";
"wallet__payment_abandoned" = "El pago Lightning se detuvo antes de completarse.";
"wallet__payment_expired" = "Este pago Lightning venció. Solicite una factura nueva.";
"wallet__payment_timeout" = "El pago agotó el tiempo de espera. Inténtelo de nuevo.";
"wallet__send_payment_route_not_found" = "Bitkit no pudo encontrar una ruta Lightning para este pago. Toque Reintentar para actualizar el enrutamiento de pagos y buscar una ruta nueva.";
"wallet__send_payment_retries_exhausted" = "Bitkit probó varias rutas Lightning, pero el pago no se pudo completar. Toque Reintentar para actualizar el enrutamiento de pagos y probar una ruta nueva.";
"wallet__payment_route_not_found" = "Bitkit no pudo encontrar una ruta Lightning para este pago.";
"wallet__payment_retries_exhausted" = "Bitkit probó varias rutas Lightning, pero el pago no se pudo completar.";
"wallet__payment_unknown_required_features" = "Esta factura Lightning usa funciones que Bitkit aún no admite.";
"wallet__payment_invoice_request_expired" = "Esta solicitud de factura Lightning venció. Solicite una factura nueva.";
"wallet__payment_invoice_request_rejected" = "El destinatario rechazó esta solicitud de factura Lightning.";
"wallet__toast_received_transaction_replaced_title" = "Transacción recibida Reemplazada";
"wallet__toast_received_transaction_replaced_description" = "Tu transacción entrante fue reemplazada al aumentar la comisión";
"wallet__toast_transaction_replaced_title" = "Transacción Sustituida";
Expand Down
Loading
Loading