@@ -382,33 +382,27 @@ protected function _getCurrencyList(): array
382382 $ locale = $ this ->getLocaleCode ();
383383 $ currencies = [];
384384
385- // Get all available currencies from ICU data using ResourceBundle
386- $ bundle = ResourceBundle::create ($ locale , 'ICUDATA-curr ' );
387- if ($ bundle !== null ) {
385+ // For regional locales (e.g. en_GB), the ICU bundle only contains
386+ // locale-specific currency name overrides, not the full list.
387+ // Load from the root language bundle first, then merge overrides.
388+ $ primaryLanguage = \Locale::getPrimaryLanguage ($ locale );
389+ $ bundlesToLoad = ($ primaryLanguage !== $ locale )
390+ ? [$ primaryLanguage , $ locale ]
391+ : [$ locale ];
392+
393+ foreach ($ bundlesToLoad as $ bundleLocale ) {
394+ $ bundle = ResourceBundle::create ($ bundleLocale , 'ICUDATA-curr ' );
395+ if ($ bundle === null ) {
396+ continue ;
397+ }
388398 $ currencyData = $ bundle ->get ('Currencies ' );
389-
390- if ($ currencyData !== null ) {
391- // Get list of all currency codes
392- $ allCodes = [];
393- foreach ($ currencyData as $ code => $ data ) {
394- if (strlen ($ code ) === 3 && ctype_alpha ($ code )) {
395- $ allCodes [] = $ code ;
396- }
397- }
398-
399- // Now get the data for each code
400- foreach ($ allCodes as $ code ) {
401- $ currInfo = $ currencyData ->get ($ code );
402- if ($ currInfo !== null ) {
403- // Get the display name (at index 1)
404- $ displayName = $ currInfo ->get (1 );
405- if ($ displayName !== null ) {
406- $ currencies [$ code ] = $ displayName ;
407- } else {
408- // Fallback to code
409- $ currencies [$ code ] = $ code ;
410- }
411- }
399+ if ($ currencyData === null ) {
400+ continue ;
401+ }
402+ foreach ($ currencyData as $ code => $ data ) {
403+ if (strlen ($ code ) === 3 && ctype_alpha ($ code )) {
404+ $ displayName = $ data ->get (1 );
405+ $ currencies [$ code ] = $ displayName ?? $ code ;
412406 }
413407 }
414408 }
0 commit comments