Lang::trans PHP Method

trans() public static method

Get the translation for a given key.
public static trans ( string $id, array $parameters = [], string $domain = 'messages', string $locale = null ) : string | array | null
$id string
$parameters array
$domain string
$locale string
return string | array | null
        public static function trans($id, $parameters = array(), $domain = 'messages', $locale = null)
        {
            return \Illuminate\Translation\Translator::trans($id, $parameters, $domain, $locale);
        }

Usage Example

示例#1
0
 protected function validatePattern()
 {
     $result = false;
     if ($this->pattern && strlen($this->value) && !preg_match("~{$this->pattern}~", $this->value)) {
         $result = Lang::trans('PATTERN_MISMATCH');
     }
     return $result;
 }
All Usage Examples Of Lang::trans