Commit 333403df authored by Clément OUDOT's avatar Clément OUDOT
Browse files

Possibility to override Portal standard messages (#915)

parent 499976b9
...@@ -767,7 +767,31 @@ _RETURN $string Error string ...@@ -767,7 +767,31 @@ _RETURN $string Error string
sub msg { sub msg {
my $self = shift; my $self = shift;
my $code = shift; my $code = shift;
return &Lemonldap::NG::Portal::_i18n::msg( $code, $self->{lang} ); my $msg;
# Check for customized message
foreach ( @{ $self->{lang} } ) {
if ( $self->{ "msg_" . $_ . "_" . $code } ) {
$msg = $self->{ "msg_" . $_ . "_" . $code };
last;
}
}
$msg ||= $self->{ "msg_" . $code };
# Use customized message or built-in message
if ( defined $msg ) {
# Manage UTF-8
utf8::decode($msg);
$self->lmLog( "Use customized message $msg for message $code",
'debug' );
}
else {
$msg = &Lemonldap::NG::Portal::_i18n::msg( $code, $self->{lang} );
}
return $msg;
} }
##@method string error(int code) ##@method string error(int code)
...@@ -803,8 +827,6 @@ sub error { ...@@ -803,8 +827,6 @@ sub error {
$msg = &Lemonldap::NG::Portal::_i18n::error( $code, $self->{lang} ); $msg = &Lemonldap::NG::Portal::_i18n::error( $code, $self->{lang} );
} }
# Return message
# Manage SOAP
return $msg; return $msg;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment