From 503bed85ebdc51f2c6fc20ab13a44633e7b93355 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 1 Oct 2018 15:19:19 +0100 Subject: i18n: Dgit.pm: mark some of messages (1) Signed-off-by: Ian Jackson --- Debian/Dgit.pm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 2e9fa64..8260e9f 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -198,7 +198,7 @@ sub messagequote ($) { sub shellquote { my @out; local $_; - defined or confess 'internal error' foreach @_; + defined or confess __ 'internal error' foreach @_; foreach my $a (@_) { $_ = $a; if (!length || m{[^-=_./:0-9a-z]}i) { @@ -292,7 +292,7 @@ sub _us () { } sub failmsg { - my $s = "error: @_\n"; + my $s = f_ "error: %s\n", "@_"; $s =~ s/\n\n$/\n/g; my $prefix = _us().": "; $s =~ s/^/$prefix/gm; @@ -312,7 +312,7 @@ sub ensuredir ($) { sub must_getcwd () { my $d = getcwd(); - defined $d or fail "getcwd failed: $!\n"; + defined $d or fail f_ "getcwd failed: %s\n", $!; return $d; } @@ -331,32 +331,32 @@ our @signames = split / /, $Config{sig_name}; sub waitstatusmsg () { if (!$?) { - return "terminated, reporting successful completion"; + return __ "terminated, reporting successful completion"; } elsif (!($? & 255)) { - return "failed with error exit status ".WEXITSTATUS($?); + return f_ "failed with error exit status %s", WEXITSTATUS($?); } elsif (WIFSIGNALED($?)) { my $signum=WTERMSIG($?); - return "died due to fatal signal ". + return f_ "died due to fatal signal %s", ($signames[$signum] // "number $signum"). ($? & 128 ? " (core dumped)" : ""); # POSIX(3pm) has no WCOREDUMP } else { - return "failed with unknown wait status ".$?; + return f_ "failed with unknown wait status %s", $?; } } sub failedcmd_report_cmd { my $intro = shift @_; - $intro //= "failed command"; + $intro //= __ "failed command"; { local ($!); printcmd \*STDERR, _us().": $intro:", @_ or die $!; }; } sub failedcmd_waitstatus { if ($? < 0) { - return "failed to fork/exec: $!"; + return f_ "failed to fork/exec: %s", $!; } elsif ($?) { - return "subprocess ".waitstatusmsg(); + return f_ "subprocess %s", waitstatusmsg(); } else { - return "subprocess produced invalid output"; + return __ "subprocess produced invalid output"; } } -- cgit v1.2.3