From dc4df2a2d6bb76f40f4e66c1b2cc934ad591bf5f Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Tue, 10 Dec 2024 14:42:50 +0100 Subject: [PATCH 1/2] feat(GiniBankSDK): Skonto: Add a separate localizable string key for try again button title PP-936 --- .../DocumentPagesViewController.swift | 8 ++++---- .../Core/GiniBankNetworkingScreenApiCoordinator.swift | 5 ++++- .../Core/Skonto/Models/SkontoDocumentPagesViewModel.swift | 4 +++- .../Core/TransactionDocs/TransactionDocsViewModel.swift | 5 ++++- .../GiniBankSDK/Resources/de.lproj/Localizable.strings | 1 + .../GiniBankSDK/Resources/en.lproj/Localizable.strings | 1 + 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/DocumentPagesPreview/DocumentPagesViewController.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/DocumentPagesPreview/DocumentPagesViewController.swift index 7605fd6ea..9608c73c0 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/DocumentPagesPreview/DocumentPagesViewController.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/DocumentPagesPreview/DocumentPagesViewController.swift @@ -68,14 +68,16 @@ final class DocumentPagesViewController: UIViewController { private var viewModel: DocumentPagesViewModelProtocol? private let configuration = GiniBankConfiguration.shared private let screenTitle: String? + private let errorButtonTitle: String private var errorView: DocumentPagesErrorView? // Constraints private var contentStackViewTopConstraint: NSLayoutConstraint? // MARK: - Init - init(screenTitle: String? = nil) { + init(screenTitle: String? = nil, errorButtonTitle: String) { self.screenTitle = screenTitle + self.errorButtonTitle = errorButtonTitle super.init(nibName: nil, bundle: nil) } @@ -107,9 +109,7 @@ final class DocumentPagesViewController: UIViewController { func setError(errorType: ErrorType, tryAgainAction: @escaping () -> Void) { let errorView = DocumentPagesErrorView( errorType: errorType, - buttonTitle: NSLocalizedStringPreferredGiniBankFormat( - "ginibank.transactionDocs.preview.error.tryAgain.buttonTitle", - comment: "Try again"), + buttonTitle: errorButtonTitle, buttonAction: { tryAgainAction() self.removeErrorView() diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankNetworkingScreenApiCoordinator.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankNetworkingScreenApiCoordinator.swift index e9a7bf85c..c131ee620 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankNetworkingScreenApiCoordinator.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/GiniBankNetworkingScreenApiCoordinator.swift @@ -596,7 +596,10 @@ extension GiniBankNetworkingScreenApiCoordinator: SkontoCoordinatorDelegate { } func didTapDocumentPreview(_ coordinator: Coordinator, _ skontoViewModel: SkontoViewModel) { - let viewController = DocumentPagesViewController(screenTitle: SkontoDocumentPagesViewModel.screenTitle) + let errorButtonTitle = SkontoDocumentPagesViewModel.errorButtonTitle + let screenTitle = SkontoDocumentPagesViewModel.screenTitle + let viewController = DocumentPagesViewController(screenTitle: screenTitle, + errorButtonTitle: errorButtonTitle) viewController.modalPresentationStyle = .overCurrentContext screenAPINavigationController.present(viewController, animated: true) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Models/SkontoDocumentPagesViewModel.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Models/SkontoDocumentPagesViewModel.swift index 2be3b1fed..fb0147fb3 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Models/SkontoDocumentPagesViewModel.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Models/SkontoDocumentPagesViewModel.swift @@ -27,9 +27,11 @@ final class SkontoDocumentPagesViewModel: DocumentPagesViewModelProtocol { private var expiryDate: Date // Information to be displayed in the screen after highlighting Skonto details - private (set) var processedImages = [UIImage]() + private(set) var processedImages = [UIImage]() static var screenTitle = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.document.pages.screen.title", comment: "Skonto discount details") + static var errorButtonTitle = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.document.pages.error.buttonTitle", + comment: "Try again") var bottomInfoItems: [String] { return [expiryDateString, withDiscountPriceString, withoutDiscountPriceString] } diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/TransactionDocsViewModel.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/TransactionDocsViewModel.swift index 131b5e6f0..d4440eb7a 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/TransactionDocsViewModel.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/TransactionDocs/TransactionDocsViewModel.swift @@ -56,7 +56,10 @@ public class TransactionDocsViewModel { func handlePreviewDocument(for documentId: String) { let transactionDoc = transactionDocs.first(where: { $0.documentId == documentId }) let screenTitle = transactionDoc?.fileName ?? "" - let viewController = DocumentPagesViewController(screenTitle: screenTitle) + let errorButtonTitle = NSLocalizedStringPreferredGiniBankFormat( + "ginibank.transactionDocs.preview.error.tryAgain.buttonTitle", + comment: "Try again") + let viewController = DocumentPagesViewController(screenTitle: screenTitle, errorButtonTitle: errorButtonTitle) viewController.modalPresentationStyle = .overCurrentContext documentPagesViewController = viewController presentingViewController?.present(viewController, animated: true) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/de.lproj/Localizable.strings b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/de.lproj/Localizable.strings index 7442db62d..21926c162 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/de.lproj/Localizable.strings +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/de.lproj/Localizable.strings @@ -130,6 +130,7 @@ "ginibank.skonto.help.back" = "Skonto"; "ginibank.skonto.document.pages.screen.title" = "Skonto-Details"; +"ginibank.skonto.document.pages.error.buttonTitle" = "Versuch's nochmal"; // MARK: - Transaction Docs feature "ginibank.transactionDocs.alert.title" = "Fügen Sie der Transaktion einen Anhang hinzu?"; diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/en.lproj/Localizable.strings b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/en.lproj/Localizable.strings index 3efc8d5a5..d1f2647b6 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/en.lproj/Localizable.strings +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/en.lproj/Localizable.strings @@ -137,6 +137,7 @@ "ginibank.skonto.help.back" = "Skonto discount"; "ginibank.skonto.document.pages.screen.title" = "Skonto discount details"; +"ginibank.skonto.document.pages.error.buttonTitle" = "Try again"; // MARK: - Transaction Docs feature "ginibank.transactionDocs.alert.title" = "Add an attachment to this transaction?"; From fc10ec29226eb361dcdde8fb717682e54b1dbcfd Mon Sep 17 00:00:00 2001 From: Gleb Kulik Date: Fri, 13 Dec 2024 15:00:01 +0100 Subject: [PATCH 2/2] feat(GiniBankSDK): change localisation ket for Skonto try again button PP-936 --- .../Core/Skonto/Models/SkontoDocumentPagesViewModel.swift | 5 +++-- .../GiniBankSDK/Resources/de.lproj/Localizable.strings | 2 +- .../GiniBankSDK/Resources/en.lproj/Localizable.strings | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Models/SkontoDocumentPagesViewModel.swift b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Models/SkontoDocumentPagesViewModel.swift index fb0147fb3..fd0ef3384 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Models/SkontoDocumentPagesViewModel.swift +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Core/Skonto/Models/SkontoDocumentPagesViewModel.swift @@ -30,8 +30,9 @@ final class SkontoDocumentPagesViewModel: DocumentPagesViewModelProtocol { private(set) var processedImages = [UIImage]() static var screenTitle = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.document.pages.screen.title", comment: "Skonto discount details") - static var errorButtonTitle = NSLocalizedStringPreferredGiniBankFormat("ginibank.skonto.document.pages.error.buttonTitle", - comment: "Try again") + static var errorButtonTitle = NSLocalizedStringPreferredGiniBankFormat( + "ginibank.skonto.document.pages.error.tryAgain.buttonTitle", + comment: "Try again") var bottomInfoItems: [String] { return [expiryDateString, withDiscountPriceString, withoutDiscountPriceString] } diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/de.lproj/Localizable.strings b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/de.lproj/Localizable.strings index 21926c162..097637447 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/de.lproj/Localizable.strings +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/de.lproj/Localizable.strings @@ -130,7 +130,7 @@ "ginibank.skonto.help.back" = "Skonto"; "ginibank.skonto.document.pages.screen.title" = "Skonto-Details"; -"ginibank.skonto.document.pages.error.buttonTitle" = "Versuch's nochmal"; +"ginibank.skonto.document.pages.error.tryAgain.buttonTitle" = "Versuch's nochmal"; // MARK: - Transaction Docs feature "ginibank.transactionDocs.alert.title" = "Fügen Sie der Transaktion einen Anhang hinzu?"; diff --git a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/en.lproj/Localizable.strings b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/en.lproj/Localizable.strings index d1f2647b6..e81bb1143 100644 --- a/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/en.lproj/Localizable.strings +++ b/BankSDK/GiniBankSDK/Sources/GiniBankSDK/Resources/en.lproj/Localizable.strings @@ -137,7 +137,7 @@ "ginibank.skonto.help.back" = "Skonto discount"; "ginibank.skonto.document.pages.screen.title" = "Skonto discount details"; -"ginibank.skonto.document.pages.error.buttonTitle" = "Try again"; +"ginibank.skonto.document.pages.error.tryAgain.buttonTitle" = "Try again"; // MARK: - Transaction Docs feature "ginibank.transactionDocs.alert.title" = "Add an attachment to this transaction?";