diff --git a/Sources/ProcessOut/Resources/Localizable.xcstrings b/Sources/ProcessOut/Resources/Localizable.xcstrings index 19c0adfac..c82776e74 100644 --- a/Sources/ProcessOut/Resources/Localizable.xcstrings +++ b/Sources/ProcessOut/Resources/Localizable.xcstrings @@ -1,622 +1,37 @@ { "sourceLanguage" : "en", "strings" : { - "native-alternative-payment.cancel-button.title" : { - "extractionState" : "stale", + "dummy" : { + "extractionState" : "manual", "localizations" : { "ar" : { "stringUnit" : { "state" : "translated", - "value" : "إلغاء" + "value" : "N/A" } }, "en" : { "stringUnit" : { "state" : "translated", - "value" : "Cancel" + "value" : "N/A" } }, "fr" : { "stringUnit" : { "state" : "translated", - "value" : "Annuler" + "value" : "N/A" } }, "pl" : { "stringUnit" : { "state" : "translated", - "value" : "Anuluj" + "value" : "N/A" } }, "pt-PT" : { "stringUnit" : { "state" : "translated", - "value" : "Cancelar" - } - } - } - }, - "native-alternative-payment.email.placeholder" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "name@example.com" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "name@example.com" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "nom@exemple.fr" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "imię@przykład.pl" - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "nome@exemplo.pt" - } - } - } - }, - "native-alternative-payment.error.invalid-email" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "البريد الإلكتروني غير صالح." - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Email is not valid." - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Votre adresse e-mail est invalide." - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Niepoprawny adres email." - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Endereço de e-mail inválido." - } - } - } - }, - "native-alternative-payment.error.invalid-length-%d" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "variations" : { - "plural" : { - "one" : { - "stringUnit" : { - "state" : "translated", - "value" : "إن الطول غير صالح، الرجاء التقيد بحرف واحد فقط." - } - }, - "other" : { - "stringUnit" : { - "state" : "translated", - "value" : "إن الطول غير صالح، الرجاء التقيد بـ %d حرفًا." - } - } - } - } - }, - "en" : { - "variations" : { - "plural" : { - "one" : { - "stringUnit" : { - "state" : "translated", - "value" : "Invalid length, expected %d character." - } - }, - "other" : { - "stringUnit" : { - "state" : "translated", - "value" : "Invalid length, expected %d characters." - } - } - } - } - }, - "fr" : { - "variations" : { - "plural" : { - "one" : { - "stringUnit" : { - "state" : "translated", - "value" : "Longueur incorrecte, %d caractère est attendu." - } - }, - "other" : { - "stringUnit" : { - "state" : "translated", - "value" : "Longueur incorrecte, %d caractères sont attendus." - } - } - } - } - }, - "pl" : { - "variations" : { - "plural" : { - "one" : { - "stringUnit" : { - "state" : "translated", - "value" : "Nieprawidłowa długość. Oczekiwano %d znaku." - } - }, - "other" : { - "stringUnit" : { - "state" : "translated", - "value" : "Nieprawidłowa długość. Oczekiwano %d znaków." - } - } - } - } - }, - "pt-PT" : { - "variations" : { - "plural" : { - "one" : { - "stringUnit" : { - "state" : "translated", - "value" : "Quantidade de caracteres incorreta, espera-se %d caractere." - } - }, - "other" : { - "stringUnit" : { - "state" : "translated", - "value" : "Quantidade de caracteres incorreta, espera-se %d caracteres." - } - } - } - } - } - } - }, - "native-alternative-payment.error.invalid-number" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "الرقم غير صحيح." - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Number is not valid." - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Numéro invalide." - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Niepoprawny numer." - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Número inválido." - } - } - } - }, - "native-alternative-payment.error.invalid-phone" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "رقم الهاتف غير صحيح." - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Phone number is not valid." - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Votre numéro de téléphone est invalide." - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Niepoprawny numer telefonu." - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Número de telemóvel inválido." - } - } - } - }, - "native-alternative-payment.error.invalid-value" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "القيمة غير صحيحة." - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Value is not valid." - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Valeur invalide." - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Niepoprawna wartość." - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Texto inválido." - } - } - } - }, - "native-alternative-payment.error.required-parameter" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "البيانات مطلوبة." - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Parameter is required." - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Paramètre requis." - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Parametr jest wmagany." - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Campo obrigatório." - } - } - } - }, - "native-alternative-payment.phone.placeholder" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "أدخل رقم الهاتف" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Enter phone number" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Entrez votre numéro de téléphone" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Twój numer telefonu" - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Insira o seu número de telemóvel" - } - } - } - }, - "native-alternative-payment.submit-button.default-title" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "الدفع" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pay" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Payer" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Zapłać" - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pagar" - } - } - } - }, - "native-alternative-payment.submit-button.title" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "الدفع %@" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pay %@" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Payer %@" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Zapłać %@" - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pagar %@" - } - } - } - }, - "native-alternative-payment.success.message" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "نجاح! تمت الموافقة على الدفع" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Success!\\nPayment approved." - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Succès !\nPaiement confirmé." - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Sukces!\\nPłatność przyjęta." - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Successo!\\nPagamento aprovado." - } - } - } - }, - "native-alternative-payment.title" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "الدفع بواسطة %@" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pay with %@" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Payer avec %@" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Zapłać przy pomocy %@" - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pagar com %@" - } - } - } - }, - "test-3ds.challenge.accept" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "قبول" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Accept" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Accepter" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Zaakceptować" - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Aceitar" - } - } - } - }, - "test-3ds.challenge.reject" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "رفض" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Reject" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Rejeter" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Odrzucić" - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Rejeitar" - } - } - } - }, - "test-3ds.challenge.title" : { - "extractionState" : "stale", - "localizations" : { - "ar" : { - "stringUnit" : { - "state" : "translated", - "value" : "هل ترغب في قبول تحقيق 3DS2 ؟" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Do you want to accept the 3DS2 challenge?" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Souhaitez-vous accepter le défi (challenge) 3DS2 ?" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Czy chcesz przyjąć wyzwanie 3DS2?" - } - }, - "pt-PT" : { - "stringUnit" : { - "state" : "translated", - "value" : "Você quer aceitar o desafio 3DS2?" + "value" : "N/A" } } } diff --git a/Sources/ProcessOut/Sources/Core/Utils/Strings+PreferredLocalization.swift b/Sources/ProcessOut/Sources/Core/Utils/Strings+PreferredLocalization.swift index dcd33ece2..9d1f556e0 100644 --- a/Sources/ProcessOut/Sources/Core/Utils/Strings+PreferredLocalization.swift +++ b/Sources/ProcessOut/Sources/Core/Utils/Strings+PreferredLocalization.swift @@ -10,8 +10,9 @@ import Foundation enum Strings { static var preferredLocalization: String { - // todo(andrii-vysotskyi): it should be possible to inject supported localizations - // instead of only relying on languages that are supported by current bundle. + // Supported languages are same for all products. There is "dummy" key defined in + // ProcessOut's Localizable.xcstrings that is translated to all supported languages + // to ensure that resolved value is consistent between targets. let bundle: Bundle if Bundle.main.preferredLocalizations.first == BundleLocator.bundle.preferredLocalizations.first { bundle = BundleLocator.bundle diff --git a/Sources/ProcessOut/Sources/Repositories/Invoices/Responses/POInvoice.swift b/Sources/ProcessOut/Sources/Repositories/Invoices/Responses/POInvoice.swift index becca98d0..09e5bdaa5 100644 --- a/Sources/ProcessOut/Sources/Repositories/Invoices/Responses/POInvoice.swift +++ b/Sources/ProcessOut/Sources/Repositories/Invoices/Responses/POInvoice.swift @@ -13,6 +13,7 @@ public struct POInvoice: Decodable, Sendable { /// String value that uniquely identifies this invoice. public let id: String + /// Invoice amount. @POStringCodableDecimal public private(set) var amount: Decimal diff --git a/Sources/ProcessOutUI/Sources/Modules/DynamicCheckout/Interactor/DynamicCheckout/DynamicCheckoutDefaultInteractor.swift b/Sources/ProcessOutUI/Sources/Modules/DynamicCheckout/Interactor/DynamicCheckout/DynamicCheckoutDefaultInteractor.swift index eb6a163e0..16848f62a 100644 --- a/Sources/ProcessOutUI/Sources/Modules/DynamicCheckout/Interactor/DynamicCheckout/DynamicCheckoutDefaultInteractor.swift +++ b/Sources/ProcessOutUI/Sources/Modules/DynamicCheckout/Interactor/DynamicCheckout/DynamicCheckoutDefaultInteractor.swift @@ -298,7 +298,7 @@ final class DynamicCheckoutDefaultInteractor: case .recovering: logger.debug("Ignoring attempt to cancel payment during error recovery.") default: - assertionFailure("Attempted to cancel payment from unsupported state.") + logger.debug("Ignoring attempt to cancel payment from unsupported state.") } } diff --git a/project.yml b/project.yml index bfa073813..31204d08d 100644 --- a/project.yml +++ b/project.yml @@ -6,7 +6,7 @@ settings: SWIFT_TREAT_WARNINGS_AS_ERRORS: true CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED: true SUPPORTS_MACCATALYST: false - LOCALIZED_STRING_MACRO_NAMES: "$(inherited) POStringResource" + LOCALIZED_STRING_MACRO_NAMES: "$(inherited) StringResource" LOCALIZATION_PREFERS_STRING_CATALOGS: true SWIFT_STRICT_CONCURRENCY: complete ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS: false