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

Re: [PATCH] merge-recursive: add hint for translators in handle_change_delete()

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 5, 2012, 20:03 UTC
Message-ID
<7vwr1d2jje.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1344189332-27082-1-git-send-email-ralf.thielow@gmail.com>
Ralf Thielow <ralf.thielow@gmail.com> writes:
Show 13 quoted lines
> The outputs in handle_change_delete() contain a lot of placeholders.
> This could end up in confusion to translators since two parts of them
> are translated separately. Add a hint for translators that they can
> easily understand it without study the code.
>
> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
> ---
> This patch is based on a confusion on my own of the values of the
> replacements. The first idea of Thomas was to remove the legos of
> the static replacements. After thinking about and trying, it would
> end up in a lot more of lines in this function mainly caused by the
> different outputs. It might be nicer to just add a hint for translators
> to describe the static replacements.

Annotating only the first and then the fourth without explaining others did not help me when I tried to guess what the message was trying to say without looking at the variable names (which are not directly available to people who work on *.po files).

I wonder something along this line to annotate all placeholders in the order they appear might be easier to read:

    /*
     * TRANSLATORS: this message has many placeholders.
     *
     * CONFLICT (
     * %s=<translation of noun "rename" or "modify">/delete):
     * %s=<name of the path being merged> deleted in
     * %s=<name of a branch> and
     * %s=<translation of verb pp "renamed" or "modified"> in
     * %s=<name of a branch>. Version
     * %s=<name of a branch> of
     * %s=<name of the path being merged> left in tree.
     */
Show 17 quoted lines
>  merge-recursive.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/merge-recursive.c b/merge-recursive.c
> index 8903a73..7f661f2 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -1035,6 +1035,9 @@ static void handle_change_delete(struct merge_options *o,
>  		update_file(o, 0, o_sha, o_mode, renamed ? renamed : path);
>  	} else if (!a_sha) {
>  		if (!renamed) {
> +			/* TRANSLATORS: The first %s will be "rename" or "modify",
> + 			   the fourth %s will be "renamed" or "modified". These replacements
> +			   are translated separately. This counts for the next four messages. */
>  			output(o, 1, _("CONFLICT (%s/delete): %s deleted in %s "
>  			       "and %s in %s. Version %s of %s left in tree."),
>  			       change, path, o->branch1, change_past,
Previous: Ralf ThielowNext: Ralf Thielow
Message 2 of 4 in “merge-recursive: add hint for translators in handle_change_delete()”
  1. merge-recursive: add hint for translators in handle_change_delete()Ralf Thielow, Aug 5, 2012
  2. Junio C HamanoAug 5, 2012
  3. [PATCHv2] merge-recursive: add hint for translators in handle_change_delete()Ralf Thielow, Aug 6, 2012
  4. Junio C HamanoAug 6, 2012

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.