chore: Update PayPal locales - #757
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f07871090
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
| public const LOCALES = [ | ||
| 'AL' => [ | ||
| 0 => 'en_US', | ||
| 1 => 'en_US', |
There was a problem hiding this comment.
Keep regional fallback locales at index zero
When the shop locale has an unsupported language but a known region, such as en_ZA, LocaleCodeProvider::findMatchingSupportedLocale() reads SupportedLocales::LOCALES[$region][0]. This update rekeys every region's first locale from 0 to 1, so that lookup now returns null and getFormattedLocaleCode() incorrectly switches to the global en_GB default instead of the region's preferred PayPal locale (for ZA, en_US). Preserve zero-based keys or update the fallback lookup to select the first value.
Useful? React with 👍 / 👎.
|
Closing — this PR contains no actual locale change. All 202 regions, their order and their locale lists are byte-for-byte identical to trunk. The only difference is that the array keys shifted from 0-based to 1-based, because the scraper copied PayPal's "Language support priority" column verbatim into the keys and PayPal renumbered that column. That shift would have broken Fixed in #760: the priority is now only used for sorting and the key is the resulting position, so upstream renumbering can no longer leak into the generated class. Running the fixed scraper against the live page reproduces trunk's |
Automated update of supported PayPal locales list.