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

Paywalls: prioritize Locale.current over Locale.preferredLocales #3657

Merged
merged 4 commits into from
Feb 8, 2024

Commits on Feb 7, 2024

  1. Paywalls: prioritize Locale.current over Locale.preferredLocales

    Fixes #3655.
    Follow up to #3633.
    
    This improves upon that PR by using `Locale.current.removingRegion` **before** trying to look up `Locale.preferredLocales`.
    
    This fixes this scenario:
    - Configure your phone with: `en_UK` and `es_ES`
    - Launch paywall with localization `en_US` and `es_ES`
    
    Prior to this change, we'd be looking up localizations in this order:
    - `en_UK`
    - `es_ES`
    - `en` (no region)
    
    Because there _is_ a localization for `es_ES` we'd return that one before attempting to look up `Locale.current.removingRegion`.
    NachoSoto committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    dc300c5 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2024

  1. Improve implementation

    NachoSoto committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    5a1123e View commit details
    Browse the repository at this point in the history
  2. Added comment

    NachoSoto committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    dabd5cd View commit details
    Browse the repository at this point in the history
  3. Simplified tests

    NachoSoto committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    de50cbb View commit details
    Browse the repository at this point in the history