From: Junio C Hamano <gitster@pobox.com>
To: Emir SARI <emir_sari@icloud.com>
Cc: git@vger.kernel.org
Subject: Re: Feature Request - Better i18n support
Date: Thu, 09 Mar 2023 14:16:14 -0800 [thread overview]
Message-ID: <xmqqfsad8tap.fsf@gitster.g> (raw)
In-Reply-To: <ZAnXddDN7v0AOBdm@mbp.local> (Emir SARI's message of "Thu, 9 Mar 2023 15:56:21 +0300")
Emir SARI <emir_sari@icloud.com> writes:
> For instance, in Turkish (and in French AFAIK), percentages are indicated
> in different formats. In Turkish it precedes the number like %54. However,
> all the percentages use the standard 54%. By marking these as translatable,
> we could easily provide the correct formats.
Interesting. Let's take a look to see how bad it is.
$ git grep '[fd]%%' \*.[ch] ':!compat/' ':!t/'
apply.c: printf(" %s %.*s{%s => %s} (%d%%)\n", renamecopy,
apply.c: printf(" %s %s => %s (%d%%)\n", renamecopy,
apply.c: printf(" rewrite %s (%d%%)\n",
These are currently not even marked with _() to be translatable, and
it should be just the matter of enclosing them in _().
If these should be translated in the first place, that is. I do not
think these are originally meant to be machine parseable (it is
shown as part of "git apply --summary"), but existing users may
already be abusing them as such.
diff.c: fprintf(opt->file, "%s%4d.%01d%% %.*s\n", line_prefix,
This is part of "git diff --dirstat" output. I do not think it
should be translated, even though it probably is not machine
parseable.
diff.c: strbuf_addf(msg, "%s%ssimilarity index %d%%",
diff.c: strbuf_addf(msg, "%s%ssimilarity index %d%%",
diff.c: strbuf_addf(msg, "%s%sdissimilarity index %d%%%s\n",
diff.c: strbuf_addf(&sb, " %s %s (%d%%)\n",
These are part of the extended diff headers (e.g. "rename A to B
with similarity index of X%") that are very much designed to be
machine parseable, and cannot be touched.
diff.c: strbuf_addf(&sb, " (%d%%)\n", similarity_index(p));
This is part of "git diff --summary" to show "rewrite", similarly to
"rename" and "copy" that we saw earlier.
wt-status.c: _("You are in a sparse checkout with %d%% of tracked files present."),
This is already marked _(translatable) and your l10n files should be
able to do "%d%%" -> "%%%d" as needed.
next prev parent reply other threads:[~2023-03-09 22:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-09 12:56 Feature Request - Better i18n support Emir SARI
2023-03-09 22:16 ` Junio C Hamano [this message]
2023-03-09 23:12 ` Emir SARI
2023-03-09 22:27 ` brian m. carlson
2023-03-09 22:35 ` Junio C Hamano
2023-03-09 22:41 ` brian m. carlson
2023-05-10 2:50 ` Emir SARI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqfsad8tap.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=emir_sari@icloud.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.