Skip to contentSkip to conversation

difftool: translate "combined diff formats" error message

PATCH In review Ammaar Bakshi via GitGitGadget 2 participants 2 messages Oct 17 – Oct 22

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 difftool: translate "combined diff formats" error message

From: AMMAAR-IC <[email protected]>

The error shown when "git difftool --dir-diff" is given a combined diff format ('-c' or '--cc') is wrapped in N_(), which only marks the string for extraction by xgettext and does nothing at runtime. As the string is passed straight to die(), users always see it in English, even though it already has translations in the po files.

Use _() instead, and adjust the indentation of the continuation lines to match.

---
difftool: translate "combined diff formats" error message

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2447%2FAmmaarBakshi%2Fdifftool-i18n-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2447/AmmaarBakshi/difftool-i18n-v1
Pull-Request: https://github.com/git/git/pull/2447

 builtin/difftool.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
builtin/difftool.c +3 -3
index bc7b2ea443..13b3d3ce47 100644
@@ -450,9 +450,9 @@ static int run_dir_diff(struct repository *repo,
 		const char *src_path, *dst_path;
 
 		if (starts_with(info.buf, "::"))
-			die(N_("combined diff formats ('-c' and '--cc') are "
-			       "not supported in\n"
-			       "directory diff mode ('-d' and '--dir-diff')."));
+			die(_("combined diff formats ('-c' and '--cc') are "
+			      "not supported in\n"
+			      "directory diff mode ('-d' and '--dir-diff')."));
 
 		if (parse_index_info(repo, info.buf, &lmode, &rmode, &loid, &roid, &status))
 			break;

base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd

Signature · 1 line
gitgitgadget
#1 lore raw
Quoted 8 lines · Ammaar Bakshi via GitGitGadget

From: AMMAAR-IC <[email protected]>

The error shown when "git difftool --dir-diff" is given a combined diff format ('-c' or '--cc') is wrapped in N_(), which only marks the string for extraction by xgettext and does nothing at runtime. As the string is passed straight to die(), users always see it in English, even though it already has translations in the po files.

Quoted 4 lines

Use _() instead, and adjust the indentation of the continuation lines to match.

The name that appears on the "From:" header in your email, "Ammaar Bakshi <[email protected]>", somehow looks more real than the handle-looking "AMMAAR-IC".

Please consult Documentation/SubmittingPatches and specifically look for [[dco]] and [[real-name]].

The patch text may look like an improvement but without a proper authorship and sign-off, we cannot use the change in our project.

Thanks.

Quoted 29 lines

---
difftool: translate "combined diff formats" error message

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2447%2FAmmaarBakshi%2Fdifftool-i18n-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2447/AmmaarBakshi/difftool-i18n-v1
Pull-Request: https://github.com/git/git/pull/2447

 builtin/difftool.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
builtin/difftool.c +3 -3
index bc7b2ea443..13b3d3ce47 100644
@@ -450,9 +450,9 @@ static int run_dir_diff(struct repository *repo,
 		const char *src_path, *dst_path;
 
 		if (starts_with(info.buf, "::"))
-			die(N_("combined diff formats ('-c' and '--cc') are "
-			       "not supported in\n"
-			       "directory diff mode ('-d' and '--dir-diff')."));
+			die(_("combined diff formats ('-c' and '--cc') are "
+			      "not supported in\n"
+			      "directory diff mode ('-d' and '--dir-diff')."));
 
 		if (parse_index_info(repo, info.buf, &lmode, &rmode, &loid, &roid, &status))
 			break;

base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd