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

Re: [PATCH] i18n: move the trailing space out of translatable strings

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 9, 2013, 19:46 UTC
Message-ID
<xmqqeh5lzu1k.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1386468704-18339-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
Show 7 quoted lines
> I've got this with Vietnamese translation
>
>     $ git status
>     HEAD được tách rời từorigin/master
>
> One does not need to understand Vietnamese to see that a space is
> missing before "origin/master"...

Not really. Only if one guesses (or knows) that Vietnamese is among the languages that use SP to separate words. There are languages that do not use inter-word spaces.

Because those languages are in the minority, it would be easier to unconditionally add SP after translatable string regardless of the l10n target languages, but I am afraid that it is going in a wrong direction in the longer term.

>  		clean_print_color(CLEAN_COLOR_PROMPT);
> -		printf(_("Input ignore patterns>> "));
> +		printf("%s ", _("Input ignore patterns>>"));
>  		clean_print_color(CLEAN_COLOR_RESET);

As this space after the prompt may be different from inter-word space after all, this one may probably be on the borderline.

Show 7 quoted lines
> @@ -754,7 +754,8 @@ static int ask_each_cmd(void)
>  		/* Ctrl-D should stop removing files */
>  		if (!eof) {
>  			qname = quote_path_relative(item->string, NULL, &buf);
> -			printf(_("remove %s? "), qname);
> +			printf(_("remove %s?"), qname);
> +			putchar(' ');
As is this change.

But it is an example that can be used to illustrate my earlier point. The l10n target language may want to have _no_ space between words, i.e. to turn the above into:

	printf("%sを削除しますか?", qname);
        putchar(' ');

i.e. no space between the object of the verb ("the path being removed") and the verb ("to remove"), while still wanting to have SP between the prompt and its answer like everybody else. And having SP after "remove" in the gettext key _is_ a good thing, as l10n people can choose not to have any SP between the verb and its object.

Show 16 quoted lines
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 874e0fd..d48ccee 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -551,12 +551,12 @@ static void update_remote_refs(const struct ref *refs,
>  
>  	if (check_connectivity) {
>  		if (transport->progress)
> -			fprintf(stderr, _("Checking connectivity... "));
> +			fprintf(stderr, _("Checking connectivity..."));
>  		if (check_everything_connected_with_transport(iterate_ref_map,
>  							      0, &rm, transport))
>  			die(_("remote did not send all necessary objects"));
>  		if (transport->progress)
> -			fprintf(stderr, _("done.\n"));
> +			fprintf(stderr, " %s", _("done.\n"));

But I think that this changes enforces the inter-word SP policy that could go against convention by specific l10n target languages.

Previous: Keshav Kini
Message 4 of 4 in “i18n: move the trailing space out of translatable strings”
  1. i18n: move the trailing space out of translatable stringsNguyễn Thái Ngọc Duy, Dec 8, 2013
  2. Duy NguyenDec 8, 2013
  3. Keshav KiniDec 8, 2013
  4. Junio C HamanoDec 9, 2013

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.