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

Re: [PATCH 2/5] i18n: Add more TRANSLATORS comments

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 30, 2012, 17:37 UTC
Message-ID
<7v4ns1glxt.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1335799995-7667-3-git-send-email-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 26 quoted lines
> I took a pass through git.pot and added comments to various messages
> that could use one, comments still need to be added to a lot of other
> things, but you have to start somewhere.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  advice.c    |    3 +++
>  bundle.c    |    5 +++++
>  commit.c    |    4 ++++
>  connected.c |    3 +++
>  diff.c      |    1 +
>  remote.c    |   10 ++++++++++
>  sequencer.c |   10 ++++++++++
>  7 files changed, 36 insertions(+)
>
> diff --git a/advice.c b/advice.c
> index a492eea..5944abb 100644
> --- a/advice.c
> +++ b/advice.c
> @@ -37,6 +37,9 @@ void advise(const char *advice, ...)
>  
>  	for (cp = buf.buf; *cp; cp = np) {
>  		np = strchrnul(cp, '\n');
> +		/* TRANSLATORS: This will be used to prefix each line of an
> +		 * advice message, with the format string being the line
> +		 */
	/*
         * Our multi-line comments are formatted like
         * this (many other places in the patch).
         */

Also end the sentence with a full-stop, please (many other places in the patch).

It is unclear what "with the format string being the line" means here, at least to me, even though I think I wrote this code.

Show 13 quoted lines
>  		fprintf(stderr,	_("hint: %.*s\n"), (int)(np - cp), cp);
>  		if (*np)
>  			np++;
> diff --git a/bundle.c b/bundle.c
> index 8d31b98..f24999e 100644
> --- a/bundle.c
> +++ b/bundle.c
> @@ -86,6 +86,7 @@ int read_bundle_header(const char *path, struct bundle_header *header)
>  	int fd = open(path, O_RDONLY);
>  
>  	if (fd < 0)
> +		/* TRANSLATORS: The argument is a path that can't be opened */
>  		return error(_("could not open '%s'"), path);

That does not add much information. "path to the file we tried to read the bundle data from but failed"?

Show 7 quoted lines
> @@ -137,6 +138,9 @@ int verify_bundle(struct bundle_header *header, int verbose)
>  	struct object_array refs;
>  	struct commit *commit;
>  	int i, ret = 0, req_nr;
> +	/* TRANSLATORS: This is a heading that'll precede a list of commit
> +	 * hashes and reference names
> +	 */
Please say "commit object names" (many other places in the patch).
Show 9 quoted lines
>  	const char *message = _("Repository lacks these prerequisite commits:");
>  
>  	init_revisions(&revs, NULL);
> @@ -412,6 +416,7 @@ int create_bundle(struct bundle_header *header, const char *path,
>  		return error(_("pack-objects died"));
>  	if (!bundle_to_stdout) {
>  		if (commit_lock_file(&lock))
> +			/* TRANSLATORS: The argument is a path we can't create */
>  			die_errno(_("cannot create '%s'"), path);

That does not add much information. "path to the file we tried to write the bundle data to but failed"?

Show 5 quoted lines
> @@ -365,6 +374,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
>  		struct commit_list *p;
>  
>  		if (!opts->mainline)
> +			/* TRANSLATORS: The argument is a commit digest */
Please consistently say "commit object name".
>  			return error(_("Commit %s is a merge but no -m option was given."),
>  				sha1_to_hex(commit->object.sha1));
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 6 of 12 in “i18n: TRANSLATORS commends and LEGO--”
  1. 0/5 i18n: TRANSLATORS commends and LEGO--Ævar Arnfjörð Bjarmason, Apr 30, 2012
  2. 1/5 diff: move TRANSLATORS comments so they're picked upÆvar Arnfjörð Bjarmason, Apr 30, 2012
  3. Junio C HamanoApr 30, 2012
  4. Ævar Arnfjörð BjarmasonApr 30, 2012
  5. 2/5 i18n: Add more TRANSLATORS commentsÆvar Arnfjörð Bjarmason, Apr 30, 2012
  6. Junio C HamanoApr 30, 2012
  7. 3/5 git-branch: remove lego in i18n messagesÆvar Arnfjörð Bjarmason, Apr 30, 2012
  8. Junio C HamanoApr 30, 2012
  9. 4/5 git-commit: remove lego in i18n messagesÆvar Arnfjörð Bjarmason, Apr 30, 2012
  10. 5/5 git-commit: remove lego in i18n messagesÆvar Arnfjörð Bjarmason, Apr 30, 2012
  11. Junio C HamanoApr 30, 2012
  12. Ævar Arnfjörð BjarmasonApr 30, 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.