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

Re: [PATCH] i18n: fix some badly formatted i18n strings

From
Jean-Noël Avila <jn.avila@free.fr>
Date
Apr 12, 2022, 09:03 UTC
Message-ID
<44b46614-9e3d-3f6e-5e65-e1d246ce78c3@free.fr>
In-Reply-To
<220412.86y20ahgpu.gmgdl@evledraar.gmail.com>
Le 12/04/2022 à 09:59, Ævar Arnfjörð Bjarmason a écrit :
Show 73 quoted lines
> 
> On Mon, Apr 11 2022, Jean-Noël Avila via GitGitGadget wrote:
> 
>> From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>
>>
>> String in submodule--helper is not correctly formatting
>> placeholders. The string in git-send-email is partial.
>>
>> Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
>> ---
>>      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(-)
>>
>> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
>> index 0b8b226c8ff..2c87ef9364f 100644
>> --- a/builtin/submodule--helper.c
>> +++ b/builtin/submodule--helper.c
>> @@ -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.
> 
>>   		NULL
>>   	};
>>   
>> diff --git a/git-send-email.perl b/git-send-email.perl
>> index a98460bdb96..5861e99a6eb 100755
>> --- a/git-send-email.perl
>> +++ b/git-send-email.perl
>> @@ -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;
> 	 		}
> 	 	}

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.

Previous: Ævar Arnfjörð Bjarmason
Message 4 of 4 in “i18n: fix some badly formatted i18n strings”
  1. i18n: fix some badly formatted i18n stringsJean-Noël Avila via GitGitGadget, Apr 11, 2022
  2. Junio C HamanoApr 11, 2022
  3. Ævar Arnfjörð BjarmasonApr 12, 2022
  4. Jean-Noël AvilaApr 12, 2022

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.