git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: Jeff Epler <jepler@unpythonic.net>,
	Git Mailing List <git@vger.kernel.org>,
	Jakub Narebski <jnareb@gmail.com>,
	Dmitry Potapov <dpotapov@gmail.com>, Jan Hudec <bulb@ucw.cz>,
	Thomas Rast <trast@student.ethz.ch>,
	Marc Weber <marco-oweber@gmx.de>
Subject: Re: [PATCH] WIP: begin to translate git with gettext
Date: Tue, 18 May 2010 08:11:51 +0000	[thread overview]
Message-ID: <AANLkTikNzz5T4oJR1MQjdWjs-4zmWfXrPaBOHNfAi-1S@mail.gmail.com> (raw)
In-Reply-To: <4BF24467.7000204@drmicha.warpmail.net>

On Tue, May 18, 2010 at 07:40, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> I have no experience whatsover with gettext, but it looks quite
> dangerous to me to have printf format specifiers as part of the
> localized text. It means that our programs can crash depending on the
> LANG setting at run time if localisers mess up. We'll never catch this
> unless we run all tests in all languages!

I don't have much experience with gettext either (except through
Launchpad), maybe it has some internal facilities to avoid errors in
these cases.

You can test if the translated messages contain the same format
specifiers as the originals, and in any case much larger projects than
Git manage dozens of translations with gettext while avoiding
disaster.

> Also, the basic structure of the output should probably be independent
> of the language, preferring consistent structure across languages over
> linguistically consistent structure  within a language.
>
> That means we'll have to do a lot of strcat's (the _() things are not
> compile time constants, are they?) rather than those mechanical
> replacements above. Are you prepared to do that?

Generally you don't to strcat's since you don't want to enforce word
order, doing so will make the messages sound like Yoda in some of the
target languages.

That does mean re-arranging some code if it's to be done properly.

>>               break;
>>       default:
>> -             die("bug: unhandled diff status %c", status);
>> +             die(_("bug: unhandled diff status %c"), status);
>>       }
>>       if (extra.len) {
>> -             color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "%s", extra.buf);
>> +             color_fprintf(s->fp, color(WT_STATUS_HEADER, s), _("%s"), extra.buf);
>
> Seriously?

No, as Jeff said it's just a proof of concept. That patch as-is
doesn't reflect good translation practices, it just bootstraps
gettext.

Which is very useful by the way, thanks Jeff.

  reply	other threads:[~2010-05-18  8:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-17 16:05 [PATCH] WIP: begin to translate git with gettext Jeff Epler
2010-05-17 23:29 ` Robert Buck
2010-05-18  4:23   ` Ævar Arnfjörð Bjarmason
2010-05-18  7:40 ` Michael J Gruber
2010-05-18  8:11   ` Ævar Arnfjörð Bjarmason [this message]
2010-05-18 16:40   ` Jeff Epler
2010-05-18 17:02     ` Ævar Arnfjörð Bjarmason
2010-05-20 16:02       ` Ævar Arnfjörð Bjarmason
2010-05-21 18:02         ` Dévai Tamás
     [not found] <20100517160208.GA20842@unpythonic.net>
2010-05-18 10:57 ` Ævar Arnfjörð Bjarmason
2010-05-18 16:07   ` Jeff Epler
2010-05-18 16:47     ` Ævar Arnfjörð Bjarmason

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=AANLkTikNzz5T4oJR1MQjdWjs-4zmWfXrPaBOHNfAi-1S@mail.gmail.com \
    --to=avarab@gmail.com \
    --cc=bulb@ucw.cz \
    --cc=dpotapov@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=jepler@unpythonic.net \
    --cc=jnareb@gmail.com \
    --cc=marco-oweber@gmx.de \
    --cc=trast@student.ethz.ch \
    /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 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 NNTP newsgroup(s).