From: "René Scharfe" <l.s.r@web.de>
To: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>
Cc: Git List <git@vger.kernel.org>,
"brian m. carlson" <sandals@crustytoothpaste.net>
Subject: Re: [PATCH] use strbuf_addstr() for adding constant strings to a strbuf, part 2
Date: Thu, 15 Sep 2016 21:55:09 +0200 [thread overview]
Message-ID: <79f6cfb5-3b9b-2ae7-d9a3-5c1c65c7d4cf@web.de> (raw)
In-Reply-To: <20160915193804.d2mmmeard2rj6vye@sigill.intra.peff.net>
Am 15.09.2016 um 21:38 schrieb Jeff King:
> On Thu, Sep 15, 2016 at 12:25:43PM -0700, Junio C Hamano wrote:
>
>>>> Silly question: Is there a natural language that uses percent signs
>>>> as letters or e.g. instead of commas? :)
>>>
>>> I don't know, but if they do, they'd better get used to escaping them.
>>> :)
>>
>> I do not know either, but I am curious where that question comes
>> from. I stared at this patch for a few minutes but couldn't guess.
>
> My initial thought is that the next step after picking this low-hanging
> fruit would be to find cases where the strings do not contain "%", and
> thus we do not have to care about formatting. But a case like:
>
> strbuf_addf(&buf, "this does not have any percents!", foo);
>
> is simply broken (albeit in a way that we ignore foo, so it's just ugly
> code, not a real bug).
>
> So I dunno. I too am curious.
Take this for example:
- strbuf_addf(&o->obuf, _("(bad commit)\n"));
+ strbuf_addstr(&o->obuf, _("(bad commit)\n"));
If there's a language that uses percent signs instead of parens or as
regular letters, then they need to be escaped in the translated string
before, but not after the patch. As I wrote: silly.
René
next prev parent reply other threads:[~2016-09-15 19:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-15 18:31 [PATCH] use strbuf_addstr() for adding constant strings to a strbuf, part 2 René Scharfe
2016-09-15 18:44 ` Jeff King
2016-09-15 19:25 ` Junio C Hamano
2016-09-15 19:38 ` Jeff King
2016-09-15 19:55 ` René Scharfe [this message]
2016-09-15 20:01 ` Junio C Hamano
2016-09-15 21:25 ` René Scharfe
2016-09-15 21:39 ` Junio C Hamano
2016-10-02 22:58 ` René Scharfe
2016-09-15 23:47 ` brian m. carlson
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=79f6cfb5-3b9b-2ae7-d9a3-5c1c65c7d4cf@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=sandals@crustytoothpaste.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).