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

Re: [PATCH] i18n: Not add stripped contents for translation

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 5, 2012, 02:27 UTC
Message-ID
<7v7gyz7pei.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1330910494-17216-1-git-send-email-worldhello.net@gmail.com>
Jiang Xin <worldhello.net@gmail.com> writes:
Show 9 quoted lines
> The last two chars of the concatenate str from the i18n marked strings
> (", ") will be stripped out by strbuf_setlen.
>
>         before: "new commits, modified content, "
>         end:    "new commits, modified content"
>
> If the translations won't end with COMMA+SPACE, will break the integrity
> of the concatenate string. As for Chinese, COMMA+SPACE may translated to
> "," -- a 3-byte UTF-8 Chinese comma character.

Hmph. Why would that be a bad thing in the first place? For example, for the diff.c::print_stat_summary() message, you have this translation:

>  1 个文件被修改,插入 3 行(+),删除 3 行(-)
where the original would be:
   %d file changed, %d insertions(+), %d deletions(-).

and I would imagine that it entirely is plausible if a native reader would wish to read a Japanese translation like this:

   1個のファイルを変更、挿入 3 行(+)、削除 3 行(-)
without using ASCII comma, but using "、" instead.
Show 19 quoted lines
> diff --git a/wt-status.c b/wt-status.c
> index 9ffc535..0042dbc 100644
> --- a/wt-status.c
> +++ b/wt-status.c
> @@ -245,11 +245,11 @@ static void wt_status_print_change_data(struct wt_status *s,
>  		if (d->new_submodule_commits || d->dirty_submodule) {
>  			strbuf_addstr(&extra, " (");
>  			if (d->new_submodule_commits)
> -				strbuf_addf(&extra, _("new commits, "));
> +				strbuf_addf(&extra, "%s, ", _("new commits"));
>  			if (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED)
> -				strbuf_addf(&extra, _("modified content, "));
> +				strbuf_addf(&extra, "%s, ", _("modified content"));
>  			if (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)
> -				strbuf_addf(&extra, _("untracked content, "));
> +				strbuf_addf(&extra, "%s, ", _("untracked content"));
>  			strbuf_setlen(&extra, extra.len - 2);
>  			strbuf_addch(&extra, ')');
>  		}
Previous: Jiang XinNext: Jiang Xin
Message 2 of 10 in “i18n: Not add stripped contents for translation”
  1. i18n: Not add stripped contents for translationJiang Xin, Mar 5, 2012
  2. Junio C HamanoMar 5, 2012
  3. Jiang XinMar 5, 2012
  4. Junio C HamanoMar 5, 2012
  5. Jens LehmannMar 5, 2012
  6. Junio C HamanoMar 5, 2012
  7. Jiang XinMar 6, 2012
  8. Junio C HamanoMar 6, 2012
  9. Jiang XinMar 6, 2012
  10. Jiang XinMar 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.