Skip to contentSkip to conversation

i18n: fix some badly formatted i18n strings

PATCH In review Jean-Noël Avila via GitGitGadget 4 participants 4 messages Apr 11, 2022 – Apr 12, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i18n: fix some badly formatted i18n strings

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <[email protected]>

String in submodule--helper is not correctly formatting placeholders. The string in git-send-email is partial.

---
V2.36 i18n fixes

While translating the latest version of the messages, I encountered a few errors of formatting or management.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1212%2Fjnavila%2Fv2.36_i18n_fixes-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1212/jnavila/v2.36_i18n_fixes-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1212

 builtin/submodule--helper.c | 2 +-
 git-send-email.perl         | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
builtin/submodule--helper.c +1 -1
index 0b8b226c8ff..2c87ef9364f 100644
@@ -3082,7 +3082,7 @@ static int module_create_branch(int argc, const char **argv, const char *prefix)
 		OPT_END()
 	};
 	const char *const usage[] = {
-		N_("git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--quiet] [-t|--track] [-n|--dry-run] <name> <start_oid> <start_name>"),
+		N_("git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--quiet] [-t|--track] [-n|--dry-run] <name> <start-oid> <start-name>"),
 		NULL
 	};
 
git-send-email.perl +3 -4
index a98460bdb96..5861e99a6eb 100755
@@ -2096,10 +2096,9 @@ sub validate_patch {
 			chdir($cwd_save) or die("chdir: $!");
 		}
 		if ($hook_error) {
-			$hook_error = sprintf(__("fatal: %s: rejected by %s hook\n" .
-						 $hook_error . "\n" .
-						 "warning: no patches were sent\n"),
-					      $fn, $hook_name);
+			$hook_error = sprintf(
+			    __("fatal: %s: rejected by %s hook\n%s\nwarning: no patches were sent\n"),
+			    $fn, $hook_name, $hook_error);
 			die $hook_error;
 		}
 	}

base-commit: ab1f2765f78e75ee51dface57e1071b3b7f42b09

Signature · 1 line
gitgitgadget
#1 lore raw
Quoted 11 lines · Jean-Noël Avila via GitGitGadget

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <[email protected]>

String in submodule--helper is not correctly formatting placeholders. The string in git-send-email is partial.

---
V2.36 i18n fixes

While translating the latest version of the messages, I encountered a few errors of formatting or management.

Thanks. Will queue directly on top of 'master'.

#2 lore raw
In reply to Jean-Noël Avila via GitGitGadget
Quoted 25 lines · Jean-Noël Avila via GitGitGadget

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <[email protected]>

String in submodule--helper is not correctly formatting placeholders. The string in git-send-email is partial.

---
V2.36 i18n fixes

While translating the latest version of the messages, I encountered a few errors of formatting or management.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1212%2Fjnavila%2Fv2.36_i18n_fixes-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1212/jnavila/v2.36_i18n_fixes-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1212

 builtin/submodule--helper.c | 2 +-
 git-send-email.perl         | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
builtin/submodule--helper.c +0 -0
index 0b8b226c8ff..2c87ef9364f 100644

builtin/submodule--helper.c static int module_create_branch(int argc, const char **argv, const char *prefix) · line 3085

Quoted 5 lines
builtin/submodule--helper.c +1 -1
@@ -3082,7 +3082,7 @@ static int module_create_branch(int argc, const char **argv, const char *prefix)
 		OPT_END()
 	};
 	const char *const usage[] = {
-		N_("git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--quiet] [-t|--track] [-n|--dry-run] <name> <start_oid> <start_name>"),
+		N_("git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--quiet] [-t|--track] [-n|--dry-run] <name> <start-oid> <start-name>"),

Okey, so s/_/-/g here.

Quoted 8 lines
builtin/submodule--helper.c +0 -0
 		NULL
 	};
 
git-send-email.perl +0 -0
index a98460bdb96..5861e99a6eb 100755

git-send-email.perl sub validate_patch { · line 2101

Quoted 10 lines
git-send-email.perl +3 -4
@@ -2096,10 +2096,9 @@ sub validate_patch {
 			chdir($cwd_save) or die("chdir: $!");
 		}
 		if ($hook_error) {
-			$hook_error = sprintf(__("fatal: %s: rejected by %s hook\n" .
-						 $hook_error . "\n" .
-						 "warning: no patches were sent\n"),
-					      $fn, $hook_name);
+			$hook_error = sprintf(
+			    __("fatal: %s: rejected by %s hook\n%s\nwarning: no patches were sent\n"),
+			    $fn, $hook_name, $hook_error);

Isn't this much narrower change going to do the same thing?:

	diff --git a/git-send-email.perl b/git-send-email.perl
	index a98460bdb96..5adb7593ce3 100755
	--- a/git-send-email.perl
	+++ b/git-send-email.perl
	@@ -2097,9 +2097,9 @@ sub validate_patch {
	 		}
	 		if ($hook_error) {
	 			$hook_error = sprintf(__("fatal: %s: rejected by %s hook\n" .
	-						 $hook_error . "\n" .
	+						 "%s\n" .
	 						 "warning: no patches were sent\n"),
	-					      $fn, $hook_name);
	+					      $fn, $hook_name, $hook_error);
	 			die $hook_error;
	 		}
	 	}
#3 lore raw

Le 12/04/2022 à 09:59, Ævar Arnfjörð Bjarmason a écrit :

Quoted 57 lines · Jean-Noël Avila via GitGitGadget
Quoted 26 lines

From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <[email protected]>

String in submodule--helper is not correctly formatting placeholders. The string in git-send-email is partial.

---
V2.36 i18n fixes

While translating the latest version of the messages, I encountered a few errors of formatting or management.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1212%2Fjnavila%2Fv2.36_i18n_fixes-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1212/jnavila/v2.36_i18n_fixes-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1212

  builtin/submodule--helper.c | 2 +-
  git-send-email.perl         | 7 +++----
  2 files changed, 4 insertions(+), 5 deletions(-)
builtin/submodule--helper.c +0 -0
index 0b8b226c8ff..2c87ef9364f 100644

builtin/submodule--helper.c static int module_create_branch(int argc, const char **argv, const char *prefix) · line 3085

Quoted 5 lines
builtin/submodule--helper.c +1 -1
@@ -3082,7 +3082,7 @@ static int module_create_branch(int argc, const char **argv, const char *prefix)
  		OPT_END()
  	};
  	const char *const usage[] = {
-		N_("git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--quiet] [-t|--track] [-n|--dry-run] <name> <start_oid> <start_name>"),
+		N_("git submodule--helper create-branch [-f|--force] [--create-reflog] [-q|--quiet] [-t|--track] [-n|--dry-run] <name> <start-oid> <start-name>"),

Okey, so s/_/-/g here.

Quoted 8 lines
builtin/submodule--helper.c +0 -0
  		NULL
  	};
 
git-send-email.perl +0 -0
index a98460bdb96..5861e99a6eb 100755

git-send-email.perl sub validate_patch { · line 2101

Quoted 10 lines
git-send-email.perl +3 -4
@@ -2096,10 +2096,9 @@ sub validate_patch {
  			chdir($cwd_save) or die("chdir: $!");
  		}
  		if ($hook_error) {
-			$hook_error = sprintf(__("fatal: %s: rejected by %s hook\n" .
-						 $hook_error . "\n" .
-						 "warning: no patches were sent\n"),
-					      $fn, $hook_name);
+			$hook_error = sprintf(
+			    __("fatal: %s: rejected by %s hook\n%s\nwarning: no patches were sent\n"),
+			    $fn, $hook_name, $hook_error);

Isn't this much narrower change going to do the same thing?:

Quoted 16 lines
	diff --git a/git-send-email.perl b/git-send-email.perl
	index a98460bdb96..5adb7593ce3 100755
	--- a/git-send-email.perl
	+++ b/git-send-email.perl
	@@ -2097,9 +2097,9 @@ sub validate_patch {
	 		}
	 		if ($hook_error) {
	 			$hook_error = sprintf(__("fatal: %s: rejected by %s hook\n" .
	-						 $hook_error . "\n" .
	+						 "%s\n" .
	 						 "warning: no patches were sent\n"),
	-					      $fn, $hook_name);
	+					      $fn, $hook_name, $hook_error);
	 			die $hook_error;
	 		}
	 	}

I wasn't sure that msgmerge would correctly handle this, but it seems so. So, yes, your version is much less invasive. Mine has an additional property of repelling developpers from trying to concatenate strings.