modify to display field's language

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8620 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-07-22 07:32:24 +00:00
parent 579ac47d85
commit 3ffba2152b

View file

@ -211,10 +211,9 @@ class Validator
* @return always false
*/
function error($field, $msg){
global $lang;
$msg = isset($lang->filter->{$msg})?$lang->filter->{$msg}:$lang->filter->invalid;
$msg = sprintf($msg, $field);
$lang_filter = Context::getLang('filter');
$msg = isset($lang_filter->{$msg})?$lang_filter->{$msg}:$lang_filter->invalid;
$msg = sprintf($msg, Context::getLang($field));
$this->_last_error = array('field'=>$field, 'msg'=>$msg);