Beispiel #1
0
 /**
  * set the locale, this is needed to update the rule
  * translations, that have been passed to the container
  * element
  *
  * @access     public
  * @param      string		new locale
  * @return     boolean
  */
 function setLocale($locale)
 {
     // rules do not store locale information
     if (!patForms::isCustomLocale($locale)) {
         return true;
     }
     $errorMessages = patForms::getCustomLocale($locale, 'Rule::' . $this->getRuleName());
     if (is_array($errorMessages)) {
         $this->validatorErrorCodes[$locale] = $errorMessages;
     }
     $this->container->addValidatorErrorCodes($this->validatorErrorCodes, $this->errorOffset);
     return true;
 }
 /**
  * sets the locale (language) to use for the validation error messages of the form.
  *
  * @access     public
  * @param      string	$lang
  * @return     bool	$result	True on success
  * @see        $locale
  */
 function setLocale($lang)
 {
     $this->locale = $lang;
     // check, whether this is a custom locale
     if (patForms::isCustomLocale($lang)) {
         $errorMessages = patForms::getCustomLocale($lang, 'Element::' . $this->elementName);
         if (is_array($errorMessages)) {
             $this->validatorErrorCodes[$lang] = $errorMessages;
         }
     }
     return true;
 }