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

[Feature] Ability to set the button title dynamically #175

Closed
ahmetws opened this issue Jun 8, 2020 · 4 comments
Closed

[Feature] Ability to set the button title dynamically #175

ahmetws opened this issue Jun 8, 2020 · 4 comments

Comments

@ahmetws
Copy link

ahmetws commented Jun 8, 2020

Is your feature request related to a problem? Please describe.
I want to use the Card Component for two different cases: Make a Payment and Add a Card. The button title is static adyen.submitButton and I can't change it.

Describe the solution you'd like
I wanted to add a buttonTitle parameter to the constructor and use it as footerItem.submitButtonTitle

@mohammedDehairy
Copy link
Contributor

Hi @ahmetws ,

You can customize the adyen.submitButton by creating a custom .strings file and adding the following line:

"adyen.submitButton" = "[Your String]";

And you can even have two .strings files one for making a payment and one for adding a card.

  1. In the .strings file for making a payment add this line:
"adyen.submitButton" = "[Your String for making a payment]";

and when initializing the CardComponent for the making a payment.

cardComponent.localizationParameters = LocalizationParameters(tableName: "[The file name of the .strings file specific to making a payment]")
  1. And in the .strings file for adding a card:
"adyen.submitButton" = "[Your String for adding a card]";

and when initializing the CardComponent for the making a payment.

cardComponent.localizationParameters = LocalizationParameters(tableName: "[The file name of the .strings file specific to adding a card]")

@ahmetws
Copy link
Author

ahmetws commented Jun 8, 2020

Thanks @mohammedDehairy 👍 It'll solve my problem for now.

@mohammedDehairy
Copy link
Contributor

I am going to close the issue, and you can open it again in case you wanted some more help.

@nsimunko
Copy link

Hi @mohammedDehairy,

I'm building a cocoapod (for internal usage) that uses your Card component for encrypting card data. I'm trying to change the title of the submit button, when the user wants to store the card.

The issue I have is, Adyen component looks for .strings file in it's own bundle. How can I make it look for my strings file, in a Bundle that is not the core application, but in my pod which uses your pod?

I have the same project structure that you get when doing pod lib create and my Localizable.strings works in my code, but your Localization.swift, line 56, looks for translations in the main bundle.

I can open a separate issue with a detailed description, but my suggestion would be to maybe add a Bundle param, that defaults to main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants