Mercurial > pub > Impl
diff Lib/IMPL/DOM/Schema/ValidationError.pm @ 383:2f16f13b000c
DOM localization
author | cin |
---|---|
date | Thu, 23 Jan 2014 17:26:34 +0400 |
parents | 4ddb27ff4a0b |
children | 5aff94ba842f |
line wrap: on
line diff
--- a/Lib/IMPL/DOM/Schema/ValidationError.pm Thu Jan 23 02:35:28 2014 +0400 +++ b/Lib/IMPL/DOM/Schema/ValidationError.pm Thu Jan 23 17:26:34 2014 +0400 @@ -31,7 +31,14 @@ } else { die new IMPL::InvalidArgumentException("A 'parent' or a 'node' parameter is required"); } - $this->{$message} = FormatMessage(delete $args{message}, \%args) if $args{message}; + + if(my $msg = $args{message}) { + if (my($msgId) = ( $msg =~ /^ID:([\w\.]+)$/ ) ) { + $this->{$message} = ($args{schema} || $args{source})->document->stringMap->GetString($msgId, \%args); + } else { + $this->{$message} = FormatMessage(delete $args{message}, \%args) if $args{message}; + } + } } sub toString {