Fix messages "problemes enregistres" : handle singular form

This commit is contained in:
root 2018-01-16 11:24:44 +01:00
parent 2c69859d5a
commit e89e58440b

View File

@ -252,7 +252,13 @@ sub on_public {
}
} elsif ($arg =~ /^(?:$mynick[,: ]|!)\s*list\s*$/) {
&refresh ();
$conn->privmsg([ @to ], sprintf ( "%d problemes enregistres", ( scalar @ACKS )) );
my $msg;
if( scalar @ACKS == 0 or scalar @ACKS == 1) {
$msg = "%d probleme enregistre";
} else {
$msg = "%d problemes enregistres";
}
$conn->privmsg([ @to ], sprintf ( $msg, ( scalar @ACKS )) );
my $id = 0;
foreach ( @ACKS )
{
@ -263,7 +269,13 @@ sub on_public {
}
} elsif ($arg =~ /^(?:$mynick[,: ]|!)\s*refresh\s*$/) {
&refresh ();
$conn->privmsg([ @to ], sprintf ( "%d problemes enregistres", ( scalar @ACKS )) );
my $msg;
if( scalar @ACKS == 0 or scalar @ACKS == 1) {
$msg = "%d probleme enregistre";
} else {
$msg = "%d problemes enregistres";
}
$conn->privmsg([ @to ], sprintf ( $msg, ( scalar @ACKS )) );
} elsif ($arg =~ /^(?:$mynick[,: ]|!)\s*recheck:?\s*(\d*)$/) {
if ( $ACKS[$1] )
{
@ -274,7 +286,13 @@ sub on_public {
close CMDPIPE;
$conn->privmsg([ @to ], sprintf ( "Recheck forcé pour %s: %s", $host, $svc ) );
&refresh ();
$conn->privmsg([ @to ], sprintf ( "%d problemes enregistres", ( scalar @ACKS )) );
my $msg;
if( scalar @ACKS == 0 or scalar @ACKS == 1) {
$msg = "%d probleme enregistre";
} else {
$msg = "%d problemes enregistres";
}
$conn->privmsg([ @to ], sprintf ( $msg, ( scalar @ACKS )) );
}
else
{
@ -283,7 +301,13 @@ sub on_public {
} elsif ($arg =~ /^(?:$mynick[,: ]|!)\s*recheck:?\s*all$/) {
#recheck all
&refresh ();
$conn->privmsg([ @to ], sprintf ( "%d problemes enregistres", ( scalar @ACKS )) );
my $msg;
if( scalar @ACKS == 0 or scalar @ACKS == 1) {
$msg = "%d probleme enregistre";
} else {
$msg = "%d problemes enregistres";
}
$conn->privmsg([ @to ], sprintf ( $msg, ( scalar @ACKS )) );
for my $i ( 0..(@ACKS-1) )
{
next unless($ACKS[$i]);