Bladeren bron

[ZF-8612] Zend_Validate:

- rewrote error messages

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@21485 44c647ce-9c0f-0410-b52a-842ac1e357ba
thomas 16 jaren geleden
bovenliggende
commit
6eaac08901
1 gewijzigde bestanden met toevoegingen van 6 en 6 verwijderingen
  1. 6 6
      library/Zend/Validate/PostCode.php

+ 6 - 6
library/Zend/Validate/PostCode.php

@@ -44,8 +44,8 @@ class Zend_Validate_PostCode extends Zend_Validate_Abstract
      * @var array
      */
     protected $_messageTemplates = array(
-        self::INVALID  => "Invalid type given, value should be string or integer",
-        self::NO_MATCH => "'%value%' does not appear to be an postal code",
+        self::INVALID  => "Invalid type given. The value should be a string or a integer",
+        self::NO_MATCH => "'%value%' does not appear to be a postal code",
     );
 
     /**
@@ -99,7 +99,7 @@ class Zend_Validate_PostCode extends Zend_Validate_Abstract
         $format = $this->getFormat();
         if (empty($format)) {
             require_once 'Zend/Validate/Exception.php';
-            throw new Zend_Validate_Exception("Format has to be a not empty string");
+            throw new Zend_Validate_Exception("A postcode-format string has to be given for validation");
         }
     }
 
@@ -129,7 +129,7 @@ class Zend_Validate_PostCode extends Zend_Validate_Abstract
         $region        = $locale->getRegion();
         if (empty($region)) {
             require_once 'Zend/Validate/Exception.php';
-            throw new Zend_Validate_Exception("Unable to detect a region from the locale '$locale'");
+            throw new Zend_Validate_Exception("Unable to detect a region for the locale '$locale'");
         }
 
         $format = Zend_Locale::getTranslation(
@@ -140,7 +140,7 @@ class Zend_Validate_PostCode extends Zend_Validate_Abstract
 
         if (empty($format)) {
             require_once 'Zend/Validate/Exception.php';
-            throw new Zend_Validate_Exception("Unable to detect a format from the region '{$locale->getRegion()}'");
+            throw new Zend_Validate_Exception("Unable to detect a postcode format for the region '{$locale->getRegion()}'");
         }
 
         $this->setFormat($format);
@@ -168,7 +168,7 @@ class Zend_Validate_PostCode extends Zend_Validate_Abstract
     {
         if (empty($format) || !is_string($format)) {
             require_once 'Zend/Validate/Exception.php';
-            throw new Zend_Validate_Exception("Format has to be a not empty string");
+            throw new Zend_Validate_Exception("A postcode-format string has to be given for validation");
         }
 
         if ($format[0] !== '/') {