ZF-10038: Zend_Currency uses locale settings to determine currency
There is no way using Zend_Currency to show a price in dollars to a German user (browser language set to 'de_DE') geo-located in the US, because 'de_US' is not a valid locale.
I'm not clear on why Zend_Currency determines the currency to use by doing a locale region-based lookup. It would be much better to be able to explicitly set the currency using the ISO 4217 code ('USD' etc), and only use a locale region-based lookup as a fallback/default if the ISO 4217 code is not provided.
Related, it's counter-intuitive that the 'currency' option to Zend_Currency specifies the currency abbreviation to display, rather than actually specifying which currency to use for the object.
Basically I expect to be able to do the following:
$currency = new Zend_Currency(array( 'value' => 1234.56 'set_currency' => 'USD', 'format' => 'de')); print $currency; // returns $1.234,56
Currently Zend_Currency throws an exception if a user's browser has no region information in the locale (e.g. 'de' instead of 'de_DE'). This is because as currently built, Zend_Currency is dependent on the locale region to determine currency to display. With the changes above, Zend_Currency should only throw an exception if a) 'set_currency' did not contain a valid ISO 4217 code AND b) the locale region is not set.