Skip to content

Localization: Phase 2 - public API#2477

Merged
atmamont merged 13 commits intofeature/cosdk-1097-ios-v6-custom-localization-developfrom
feature/cosdk-1097-ios-v6-custom-localization-phase2
Apr 20, 2026
Merged

Localization: Phase 2 - public API#2477
atmamont merged 13 commits intofeature/cosdk-1097-ios-v6-custom-localization-developfrom
feature/cosdk-1097-ios-v6-custom-localization-phase2

Conversation

@atmamont
Copy link
Copy Markdown
Contributor

@atmamont atmamont commented Apr 2, 2026

Summary

✅ Phase 0 — #2463
✅ Phase 1 — Internalize legacy localization API
➡️ Phase 2 — Introduce the new public contract
Phase 3 — Wire provider resolution into card flow
Phase 4 — Unsupported locale warnings
Phase 5 — Final confidence pass for card alpha scope

This change completes Phase 2 of the custom localization feature by introducing the new Android-aligned public localization contract: CheckoutLocalizationKey, CheckoutLocalizationProvider, and CheckoutConfiguration.localizationProvider(_).

The provider is propagated generically through CheckoutComponentBuilder into checkout component configurations, with demo usage and focused unit coverage added.

Note: I cannot make internal public struct LocalizationKey to become package yet, as it causes a massive amount of downstream dependencies changes.

Ticket

COSDK-1097

Checklist

  • Tested changes locally
  • Added/updated unit tests
  • Verified against acceptance criteria

@atmamont atmamont added the chore a pull request that has chore changes that shouldn't be in the release notes label Apr 2, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a custom localization framework for the Adyen SDK, allowing developers to override default UI strings via a new CheckoutLocalizationProvider protocol. The implementation includes the definition of public and internal localization keys, updates to various component configurations to propagate the provider, and an adapter for cross-module compatibility. Unit tests and a demo implementation are also provided. Review feedback highlights a potential runtime risk due to enum mapping and suggests using CaseIterable to ensure exhaustive synchronization between modules.

Comment thread AdyenCheckout/Localization/CheckoutLocalizationKey.swift Outdated
Comment thread Adyen/Utilities/AnyCheckoutLocalizationProvider.swift Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

ℹ️ No baseline data found for 'feature/cosdk-1097-ios-v6-custom-localization-develop'.

Framework Size
AdyenComponents.framework 2821 KB
AdyenActions.framework 2411 KB
AdyenDropIn.framework 1329 KB
AdyenDelegatedAuthentication.framework 98 KB
AdyenAuthentication.framework 347 KB
AdyenWeChatPay.framework 266 KB
AdyenUI.framework 3357 KB
AdyenCardScanner.framework 699 KB
AdyenEncryption.framework 508 KB
AdyenSession.framework 753 KB
AdyenTwint.framework 282 KB
AdyenWeChatPayInternal.framework 4135 KB
AdyenCheckout.framework 2036 KB
AdyenCashAppPay.framework 1781 KB
AdyenCard.framework 1736 KB
TwintSDK.framework 97 KB
Adyen3DS2.framework 919 KB
Adyen.framework 5109 KB
total 28684 KB

@atmamont atmamont requested review from a team, erenbesel and nauaros and removed request for a team April 3, 2026 08:39
@atmamont
Copy link
Copy Markdown
Contributor Author

atmamont commented Apr 3, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the CheckoutLocalizationProvider protocol and CheckoutLocalizationKey enum to facilitate custom localization across checkout components. The localizationProvider property was added to multiple configuration objects, including those for Card, 3DS2, Twint, ACH, and BLIK, and integrated into the CheckoutComponentBuilder for propagation. Unit tests and a demo implementation were also provided. Feedback suggests explicitly defining snake_case raw values for the localization keys to align with the Android SDK and updating the configuration setter to accept optional values for consistency.

Comment thread Adyen/Utilities/CheckoutLocalizationProvider.swift Outdated
Comment thread AdyenCheckout/CheckoutConfiguration/CheckoutConfiguration.swift
@atmamont atmamont marked this pull request as ready for review April 3, 2026 11:28
Comment thread Adyen/Utilities/CheckoutLocalizationProvider.swift Outdated
@github-actions
Copy link
Copy Markdown
Contributor

👀 3 public changes detected

Comparing feature/cosdk-1097-ios-v6-custom-localization-phase2 to feature/cosdk-1097-ios-v6-custom-localization-develop

❇️3 Additions

Adyen

❇️ Added

public protocol CheckoutLocalizationProvider {
  func localizedString(
    _ key: Adyen.CheckoutLocalizationKey,
    locale: Foundation.Locale
  ) -> Swift.String?
}
public struct CheckoutLocalizationKey: Swift.Hashable {
  public func hash(into hasher: inout Swift.Hasher) -> Swift.Void
  public static func ==(
    lhs: Adyen.CheckoutLocalizationKey,
    rhs: Adyen.CheckoutLocalizationKey
  ) -> Swift.Bool
  public static let awaitLoading: Adyen.CheckoutLocalizationKey { get }
  public static let blikCode: Adyen.CheckoutLocalizationKey { get }
  public static let blikCodeHint: Adyen.CheckoutLocalizationKey { get }
  public static let blikCodeInvalid: Adyen.CheckoutLocalizationKey { get }
  public static let blikHelperText: Adyen.CheckoutLocalizationKey { get }
  public static let cardDualBrandSelectorDescription: Adyen.CheckoutLocalizationKey { get }
  public static let cardDualBrandSelectorTitle: Adyen.CheckoutLocalizationKey { get }
  public static let cardExpiryDate: Adyen.CheckoutLocalizationKey { get }
  public static let cardExpiryDateHint: Adyen.CheckoutLocalizationKey { get }
  public static let cardExpiryDateInvalid: Adyen.CheckoutLocalizationKey { get }
  public static let cardExpiryDateInvalidTooFarInTheFuture: Adyen.CheckoutLocalizationKey { get }
  public static let cardExpiryDateInvalidTooOld: Adyen.CheckoutLocalizationKey { get }
  public static let cardHolderName: Adyen.CheckoutLocalizationKey { get }
  public static let cardHolderNameInvalid: Adyen.CheckoutLocalizationKey { get }
  public static let cardNumber: Adyen.CheckoutLocalizationKey { get }
  public static let cardNumberInvalid: Adyen.CheckoutLocalizationKey { get }
  public static let cardNumberInvalidUnsupportedBrand: Adyen.CheckoutLocalizationKey { get }
  public static let cardSecurityCode: Adyen.CheckoutLocalizationKey { get }
  public static let cardSecurityCodeHint3Digits: Adyen.CheckoutLocalizationKey { get }
  public static let cardSecurityCodeHint4Digits: Adyen.CheckoutLocalizationKey { get }
  public static let cardSecurityCodeInvalid: Adyen.CheckoutLocalizationKey { get }
  public static let cardSocialSecurityNumber: Adyen.CheckoutLocalizationKey { get }
  public static let cardSocialSecurityNumberInvalid: Adyen.CheckoutLocalizationKey { get }
  public static let cardStorePaymentMethod: Adyen.CheckoutLocalizationKey { get }
  public static let dropInManageFavoritesCardsSectionTitle: Adyen.CheckoutLocalizationKey { get }
  public static let dropInManageFavoritesOthersSectionTitle: Adyen.CheckoutLocalizationKey { get }
  public static let dropInManageFavoritesRemove: Adyen.CheckoutLocalizationKey { get }
  public static let dropInManageFavoritesRemoveConfirmation: Adyen.CheckoutLocalizationKey { get }
  public static let dropInManageFavoritesTitle: Adyen.CheckoutLocalizationKey { get }
  public static let dropInOtherPaymentMethods: Adyen.CheckoutLocalizationKey { get }
  public static let dropInPaymentMethodCardDescription: Adyen.CheckoutLocalizationKey { get }
  public static let dropInPaymentMethodListDescription: Adyen.CheckoutLocalizationKey { get }
  public static let dropInPaymentMethodListFavoritesSectionAction: Adyen.CheckoutLocalizationKey { get }
  public static let dropInPaymentMethodListFavoritesSectionTitle: Adyen.CheckoutLocalizationKey { get }
  public static let dropInPaymentMethodListOptionsSectionTitle: Adyen.CheckoutLocalizationKey { get }
  public static let dropInPaymentMethodListOptionsTitleWithFavorites: Adyen.CheckoutLocalizationKey { get }
  public static let generalBack: Adyen.CheckoutLocalizationKey { get }
  public static let generalCancel: Adyen.CheckoutLocalizationKey { get }
  public static let generalClose: Adyen.CheckoutLocalizationKey { get }
  public static let generalOptional: Adyen.CheckoutLocalizationKey { get }
  public static let generalSearchHint: Adyen.CheckoutLocalizationKey { get }
  public static let mbwayCountryCode: Adyen.CheckoutLocalizationKey { get }
  public static let mbwayInvalidPhoneNumber: Adyen.CheckoutLocalizationKey { get }
  public static let mbwayPhoneNumber: Adyen.CheckoutLocalizationKey { get }
  public var hashValue: Swift.Int { get }
}

AdyenCheckout

CheckoutConfiguration

❇️ Added

public func localizationProvider(_ localizationProvider: any Adyen.CheckoutLocalizationProvider) -> AdyenCheckout.CheckoutConfiguration

Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCardScanner, AdyenCashAppPay, AdyenCheckout, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenUI, AdyenWeChatPay

@atmamont atmamont merged commit 5a4ed2d into feature/cosdk-1097-ios-v6-custom-localization-develop Apr 20, 2026
9 checks passed
@atmamont atmamont deleted the feature/cosdk-1097-ios-v6-custom-localization-phase2 branch April 20, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore a pull request that has chore changes that shouldn't be in the release notes size:medium size:small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants