Zend_Locale which replacement should I use?

Hi there,

in some of our plugins in Magento, they use Zend_Locale , what do I need to change this into to make use of Laminas? The code where this is used in is:

$form['shipping_address']['country_code'] = Zend_Locale::getTranslation($shippingAddress->getCountryId(), 'Alpha3ToTerritory');

Also at the top of the php file it shows: use Zend_Locale;


Best regards,

As I wrote in the other post, Zend_Locale has not been ported from version 1 of Zend Framework. You must search for a library which uses data from “Common Locale Data Repository” (CLDR) of the Unicode Consortium.

Please check commerceguys/intl and the usage of their the language repository, maybe this will provide the desired country code.

More infos:

Hi @froschdesign,

thanks again and apologies for missing that last sentence about Zend_Library. However just for others I’m sharing the solution. I changed use Zend_Locale to use Laminas\I18n\CountryCode and changed Zend_Locale::getTranslation to \Laminas\I18n\CountryCode::fromString.

1 Like

Thanks for your feedback and great if this works! :+1:t3: