Skip to content

Localization: fix simulator localizations not being picked up in debug mode#2467

Merged
atmamont merged 9 commits into
feature/cosdk-1097-ios-v6-custom-localization-developfrom
chore/fix-simulator-localizations
Mar 30, 2026
Merged

Localization: fix simulator localizations not being picked up in debug mode#2467
atmamont merged 9 commits into
feature/cosdk-1097-ios-v6-custom-localization-developfrom
chore/fix-simulator-localizations

Conversation

@atmamont

@atmamont atmamont commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

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

Demo

Debug localizations ON before the fix Debug localizations ON after the fix
image image

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

COSDK-1097

Checklist

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

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a critical issue where localization strings were not being correctly loaded and applied within the simulator environment during debug sessions. The fix involved a strategic migration of localization resources from the modern .xcstrings format back to the more traditional .strings format, coupled with necessary updates to the Xcode project configuration to ensure these files are properly recognized and bundled. This change ensures that localized content is correctly displayed in the simulator, improving the debugging experience for internationalized applications.

Highlights

  • Localization File Migration: Migrated localization files from the newer .xcstrings format to the traditional .strings format to address loading issues.
  • Xcode Project Configuration Update: Updated the Xcode project file (project.pbxproj) to correctly reference the newly introduced .strings localization files and their respective language-specific bundles.
  • Simulator Localization Fix: Resolved an issue where localization strings were not being correctly picked up and displayed in the simulator during debug mode.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@atmamont atmamont added the chore a pull request that has chore changes that shouldn't be in the release notes label Mar 26, 2026
@atmamont atmamont changed the base branch from develop to feature/cosdk-1097-ios-v6-custom-localization-develop March 26, 2026 12:53

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request migrates the localization files from the .xcstrings format to the traditional .strings format. This includes deleting the old Localizable.xcstrings file, creating new Localizable.strings files for English and Hindi with the extracted string content, and updating the Xcode project file (Adyen.xcodeproj/project.pbxproj) to reference these new .strings files and their variant group. There are no review comments to address.

@github-actions

github-actions Bot commented Mar 26, 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 requested review from a team, erenbesel and nauaros and removed request for a team March 26, 2026 13:52
@atmamont atmamont marked this pull request as ready for review March 26, 2026 13:52
Comment thread Adyen/Utilities/Localization.swift Outdated
@github-actions

Copy link
Copy Markdown
Contributor

✅ No changes detected

Comparing chore/fix-simulator-localizations 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 merged commit 53bb547 into feature/cosdk-1097-ios-v6-custom-localization-develop Mar 30, 2026
10 checks passed
@atmamont atmamont deleted the chore/fix-simulator-localizations branch March 30, 2026 07:47
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 size:tiny

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants