Subject: Re: [PATCH v6 3/6] object-name: make ambiguous object output translatable

From: Junio C Hamano <[email-masked]>
Date: Thu, 30 Dec 2021 15:46:42 -0800

Ævar Arnfjörð Bjarmason  <[email-masked]> writes:

> +		/*
> +		 * TRANSLATORS: This is a line of
> +		 * ambiguous tag object output. E.g.:
> +		 *
> +		 *    "deadbeef tag Some Tag Message"
> +		 *
> +		 * The second argument is the "tag" string from
> +		 * object.c, it should (hopefully) already be
> +		 * translated.
> +		 */
> +		strbuf_addf(&desc, _("%s tag %s"), hash, tag_tag);

It is better to lose ", it should (hopefully) already be translated"
near the end of the comment.

> +	} else if (type == OBJ_TREE) {
> +		/*
> +		 * TRANSLATORS: This is a line of ambiguous <type>
> +		 * object output. E.g. "deadbeef tree".
> +		 */
> +		strbuf_addf(&desc, _("%s tree"), hash);
> +	} else if (type == OBJ_BLOB) {
> +		/*
> +		 * TRANSLATORS: This is a line of ambiguous <type>
> +		 * object output. E.g. "deadbeef blob".
> +		 */
> +		strbuf_addf(&desc, _("%s blob"), hash);
>  	}
>  
> +
>  out:
> -	advise("  %s %s",
> -	       repo_find_unique_abbrev(ds->repo, oid, DEFAULT_ABBREV),
> -	       desc.buf);
> +	/*
> +	 * TRANSLATORS: This is line item of ambiguous object output
> +	 * from describe_ambiguous_object() above.
> +	 */
> +	advise(_("  %s"), desc.buf);

What do we expect the translators to do here?  Swap order of the
leading space and the string around?

All the other sentence legos we see in the earlier part of this
patch (omitted) looked quite sensibly done.  Especially the part
that shows a commit object, which lets the translators to take the
object name, the date string, and the message and combine them into
a single string in an order of their choice is nice.