コード例 #1
0
ファイル: Exception.php プロジェクト: matthieusieben/sedra
 protected function translate($message)
 {
     try {
         return Locale::t($message, $this->get_translation_replace_pairs());
     } catch (\Exception $e) {
         return strtr($message, $this->get_translation_replace_pairs());
     }
 }
コード例 #2
0
ファイル: Field.php プロジェクト: matthieusieben/sedra
 public function validate()
 {
     if (isset($this->valid)) {
         return $this->valid;
     }
     if ($this->required && !isset($this->value)) {
         $this->errors[] = Locale::t('The field @name is required.', array('@name' => $this->label));
     }
     return $this->valid = empty($this->errors);
 }