git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 11/11] i18n: difftool: mark warnings for translation

From
Vasco Almeida <vascomalmeida@sapo.pt>
Date
Jun 21, 2016, 11:44 UTC
Message-ID
<20160621114413.9467-11-vascomalmeida@sapo.pt>
In-Reply-To
<20160621114413.9467-1-vascomalmeida@sapo.pt>
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 git-difftool.perl | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/git-difftool.perl b/git-difftool.perl
index ebd13ba..fe7f003 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -22,6 +22,7 @@ use File::Path qw(mkpath rmtree);
 use File::Temp qw(tempdir);
 use Getopt::Long qw(:config pass_through);
 use Git;
+use Git::I18N;
 
 sub usage
 {
@@ -144,7 +145,7 @@ sub setup_dir_diff
 	my $i = 0;
 	while ($i < $#rawdiff) {
 		if ($rawdiff[$i] =~ /^::/) {
-			warn << 'EOF';
+			warn __ <<'EOF';
 Combined diff formats ('-c' and '--cc') are not supported in
 directory diff mode ('-d' and '--dir-diff').
 EOF
@@ -451,11 +452,11 @@ sub dir_diff
 		}
 
 		if (exists $wt_modified{$file} and exists $tmp_modified{$file}) {
-			my $errmsg = "warning: Both files modified: ";
-			$errmsg .= "'$workdir/$file' and '$b/$file'.\n";
-			$errmsg .= "warning: Working tree file has been left.\n";
-			$errmsg .= "warning:\n";
-			warn $errmsg;
+			warn sprintf __(
+"warning: Both files modified:
+'%s/%s' and '%s/%s'.
+warning: Working tree file has been left.
+warning:\n"), $workdir, $file, $b, $file;
 			$error = 1;
 		} elsif (exists $tmp_modified{$file}) {
 			my $mode = stat("$b/$file")->mode;
@@ -467,8 +468,9 @@ sub dir_diff
 		}
 	}
 	if ($error) {
-		warn "warning: Temporary files exist in '$tmpdir'.\n";
-		warn "warning: You may want to cleanup or recover these.\n";
+		warn sprintf __(
+"warning: Temporary files exist in '%s'.
+warning: You may want to cleanup or recover these.\n"), $tmpdir;
 		exit(1);
 	} else {
 		exit_cleanup($tmpdir, $rc);
-- 
2.6.6
Previous: Vasco AlmeidaNext: David Aguilar
Message 8 of 13 in “i18n: add--interactive: mark strings for translation”
  1. 01/11 i18n: add--interactive: mark strings for translationVasco Almeida, Jun 21, 2016
  2. 02/11 i18n: add--interactive: mark simple here documents for translationVasco Almeida, Jun 21, 2016
  3. 04/11 i18n: add--interactive: mark plural stringsVasco Almeida, Jun 21, 2016
  4. 03/11 i18n: add--interactive: mark strings with interpolation for translationVasco Almeida, Jun 21, 2016
  5. 05/11 i18n: add--interactive: mark message for translationVasco Almeida, Jun 21, 2016
  6. 09/11 i18n: send-email: mark warnings and errors for translationVasco Almeida, Jun 21, 2016
  7. 06/11 i18n: add--interactive: i18n of help_patch_cmdVasco Almeida, Jun 21, 2016
  8. 11/11 i18n: difftool: mark warnings for translationVasco Almeida, Jun 21, 2016
  9. David AguilarJun 22, 2016
  10. Vasco AlmeidaJun 22, 2016
  11. 10/11 i18n: send-email: mark string with interpolation for translationVasco Almeida, Jun 21, 2016
  12. 08/11 i18n: send-email: mark strings for translationVasco Almeida, Jun 21, 2016
  13. 07/11 i18n: add--interactive: mark edit_hunk message for translationVasco Almeida, Jun 21, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.