ZF-9488: only use the region part (instead of locale) if only the region is needed (Iban, PostCode)

Issue Type: New Feature Created: 2010-03-20T10:53:03.000+0000 Last Updated: 2010-04-03T05:39:33.000+0000 Status: Resolved Fix version(s): - 1.10.4 (28/Apr/10)

Reporter: Marc Bennewitz (private) (mabe) Assignee: Thomas Weidner (thomas) Tags: - Zend_Validate

Related issues: Attachments:


The validators Zend_Validate_Iban & Zend_Validate_PostCode need (or can use) a region code to validate a value. But they don't need the a complete local!

Additionally The language part is not in evidence if your application only knows a region. -> For example the region of china is CN but cn_CN isn't a valid locale. You have to use zh_CN.

I see Zend_Validate_PostCode uses the locale:

<pre class="highlight">
$format = Zend_Locale::getTranslation(

I don't tested it if there is a way to get the format of the post code but i don't know why a post code could be specific by a language as by the region.


Posted by Thomas Weidner (thomas) on 2010-03-20T11:01:47.000+0000

There is no way to get the data from a locale only by region without a full qualified locale.

This is already described within the manual.

Posted by Thomas Weidner (thomas) on 2010-04-03T03:15:10.000+0000

Implemented by another feature.

Note: "They need no complete locale" is wrong. A locale always consist of language and region. The region alone is no locale. Therefor the region alone can not be seen as locale. Components which are based on localization must work according to this rule.

Posted by Marc Bennewitz (private) (mabe) on 2010-04-03T05:39:33.000+0000

I doesn't say that IBAN and PostCode validators are localized. They aren't. They are based on territory. I understand if you say there is no way to get the PostCode only from a region but to select a locale from a territory to get it is more a workaround as a fix. Additionally there are special territories without having a locale (e.g. Hong Kong)

Wikipedia: In February 2005, 117 of the 190 member countries of the Universal Postal Union had postal code systems. Countries that do not have national systems include Ireland and Panama. Although Hong Kong and Macau are now Special Administrative Regions of China, each maintain their own long-established postal system, which does not utilize postal codes for domestic mail.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.