Localization: Add SDK localization completeness unit tests#2464
Draft
atmamont wants to merge 3 commits into
Draft
Localization: Add SDK localization completeness unit tests#2464atmamont wants to merge 3 commits into
atmamont wants to merge 3 commits into
Conversation
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>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Contributor
|
ℹ️ No baseline data found for 'feature/cosdk-1097-ios-v6-custom-localization-develop'.
|
3 tasks
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
Contributor
✅ No changes detectedComparing Analyzed targets: Adyen, AdyenActions, AdyenCard, AdyenCardScanner, AdyenCashAppPay, AdyenCheckout, AdyenComponents, AdyenDelegatedAuthentication, AdyenDropIn, AdyenEncryption, AdyenSession, AdyenSwiftUI, AdyenTwint, AdyenUI, AdyenWeChatPay |
The base branch was changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Localizabletable and fails on any missing key.Technical note
LocalizationTableCompletenessValidatorin unit tests:bundle,tableName,sourceLocale, and optional locale subset.lprojdirectories in the provided bundleLocalizationTableCompletenessValidatorTests:Bundle.coreInternalResources,Localizable, source localeen-US)tableName: "Localizable") against default behaviorThis new test is expected to fail because of new strings added recently that are not translated yet:
Ticket
COSDK-1097Checklist