Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(GiniBankSDK): Skonto: Add a separate localizable string key for … #756

Open
wants to merge 2 commits into
base: Release-3.13.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
mrkulik marked this conversation as resolved.
Show resolved Hide resolved

// MARK: - Transaction Docs feature
"ginibank.transactionDocs.alert.title" = "Add an attachment to this transaction?";
Expand Down