Re: [PATCH] WIP: begin to translate git with gettext

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 18, 2010 at 07:40, Michael J Gruber
<git@xxxxxxxxxxxxxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]