Skip to content

Localization: Add SDK localization completeness unit tests#2464

Draft
atmamont wants to merge 3 commits into
developfrom
feature/cosdk-1097-ios-v6-localization-completeness-tests
Draft

Localization: Add SDK localization completeness unit tests#2464
atmamont wants to merge 3 commits into
developfrom
feature/cosdk-1097-ios-v6-localization-completeness-tests

Conversation

@atmamont

@atmamont atmamont commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds generic localization completeness validation for SDK localization resources. It introduces a reusable validator helper API that accepts any bundle and table name, then verifies that all keys from the source locale are present across all SDK-supported locales. The initial coverage targets the SDK internal Localizable table and fails on any missing key.

Technical note

  • Added LocalizationTableCompletenessValidator in unit tests:
    • supports bundle, tableName, sourceLocale, and optional locale subset
    • discovers supported locales from .lproj directories in the provided bundle
    • reports missing keys per locale
  • Added LocalizationTableCompletenessValidatorTests:
    • validates SDK internal localization completeness (Bundle.coreInternalResources, Localizable, source locale en-US)
    • validates explicit table-name API path (tableName: "Localizable") against default behavior

This new test is expected to fail because of new strings added recently that are not translated yet:

Ticket

COSDK-1097

Checklist

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

Add unit-test helper coverage that validates SDK localization table completeness across all supported locales and fails on missing keys.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This pull request does not contain a valid label. Please add one of the following labels: ['new', 'changed', 'fixed', 'removed', 'deprecated', 'chore', 'improvement']

@github-actions

github-actions Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

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

Framework Size
AdyenComponents.framework 2828 KB
AdyenActions.framework 2404 KB
AdyenDropIn.framework 1361 KB
AdyenDelegatedAuthentication.framework 98 KB
AdyenAuthentication.framework 347 KB
AdyenWeChatPay.framework 266 KB
AdyenUI.framework 3347 KB
AdyenCardScanner.framework 699 KB
AdyenEncryption.framework 508 KB
AdyenSession.framework 753 KB
AdyenTwint.framework 282 KB
AdyenWeChatPayInternal.framework 4135 KB
AdyenCheckout.framework 2093 KB
AdyenCashAppPay.framework 1779 KB
AdyenCard.framework 1753 KB
TwintSDK.framework 97 KB
Adyen3DS2.framework 919 KB
Adyen.framework 5064 KB
total 28733 KB

@atmamont atmamont marked this pull request as draft March 25, 2026 16:38
@atmamont atmamont changed the title chore: Add SDK localization completeness unit tests Localization: Add SDK localization completeness unit tests Mar 25, 2026
@atmamont atmamont added the chore a pull request that has chore changes that shouldn't be in the release notes label Mar 25, 2026
github-actions[bot]
github-actions Bot previously approved these changes Mar 25, 2026
@atmamont atmamont deleted the branch develop March 26, 2026 10:23
@atmamont atmamont closed this Mar 26, 2026
@atmamont atmamont reopened this Mar 26, 2026
atmamont added a commit that referenced this pull request Mar 30, 2026
…g mode (#2467)

# Summary
This PR:
- fixes the current "legacy" localization resolution in debug/simulator
runs where missing strings can be surfaced as uppercased keys instead of
falling through to the expected fallback layers. The resolver now keeps
treating those debug placeholders as missing values, so localization
continues through the existing fallback chain instead of rendering raw
localization keys in the UI. This allows us to use Simulator debug
capabilities to find missing localizations. This is also addressed in an
automated way by introducing [localization coverage unit
tests](#2464)

# Demo
<!-- Add screenshots or link to screen recording demonstrating the
changes -->
<!-- Include both light/dark mode and different device sizes if it
matters -->

| Debug localizations ON before the fix | Debug localizations ON after
the fix |
|-|-|
| <img width="500" height="948" alt="image"
src="https://github.com/user-attachments/assets/8837ea8a-c222-40a1-b24a-8bbbe9fd9109"
/> | <img width="500" height="948" alt="image"
src="https://github.com/user-attachments/assets/8a3d49ed-b878-4d3c-a9b8-f56f59f42195"
/> |

## Technical Information
Main localization logic changes in this PR:
- preserve and document the current legacy fallback order: `Bundle.main`
-> optional `LocalizationParameters.bundle` -> SDK localized resources
-> SDK `en-US` -> raw key
- keep enforced-locale resolution working by reading the requested
`.lproj` from each candidate bundle before falling back to SDK resources
- treat Xcode's `Show non-localized strings` uppercase placeholder
output as a missing translation so fallback continues correctly
- keep custom table and key-separator lookup behavior unchanged
- add focused localization test coverage for the debug placeholder case

## Testing Instructions
- Enable Xcode's debug option to show non-localized strings for
`AdyenUIHost`
- Launch the Demo app and open a flow that renders SDK-owned strings
such as the preselected payment method screen
- Verify missing app-level translations no longer render as raw
localization keys and instead fall back to the SDK translation chain
- Run `LocalizationTests` and confirm the debug placeholder case passes

## Ticket
<ticket>
COSDK-1097
</ticket>

## Checklist
<!-- Mark completed items with an [x] -->
- [x] Tested changes locally
- [x] Added/updated unit tests
- [x] Verified against acceptance criteria
@github-actions

Copy link
Copy Markdown
Contributor

✅ No changes detected

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


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

@atmamont atmamont self-assigned this May 1, 2026
Base automatically changed from feature/cosdk-1097-base to develop May 22, 2026 11:33
@atmamont atmamont dismissed github-actions[bot]’s stale review May 22, 2026 11:33

The base branch was changed.

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:small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant