[Phpmyadmin-devel] concatenate locales

Sebastian Mendel lists at sebastianmendel.de
Thu Oct 18 08:03:40 CEST 2007


Michal Čihař schrieb:
> Hi
> 
> On Thu, 18 Oct 2007 07:17:56 +0200
> Sebastian Mendel <lists at sebastianmendel.de> wrote:
> 
>> $strRowsDeleted = '%1$d rows deleted.';
>> $strRowDeleted = '1 row deleted.';
>>
>> $strRowsDeleted = '%1$d row(s) deleted.';
>>
>> i think i would prefer the last one
> 
> How about using gettext support in PHP for localisation? I just
> migrated one my tiny project from similar system like phpMyAdmin uses
> to gettext one and it was quite easy [*].
> 
> With gettext we can use ngettext calls, which are exactly designed for
> getting correct localized translation of these strings. This way we
> can get correct wording for all possibilities in different languages.
> For example in Czech correct would be something like this:
> 
> Smazán 1 záznam.
> Smazány 2 záznamy.
> Smazány 3 záznamy.
> Smazány 4 záznamy.
> Smazáno 5 záznamů.
> 
> 
> [*] I hacked two simple python scripts to migrate code and translation
> data:
> http://viewsvn.cihar.com/viewvc.cgi/ukolovnik/trunk/admin/locales-convert?revision=108&view=markup&pathrev=132
> http://viewsvn.cihar.com/viewvc.cgi/ukolovnik/trunk/admin/locales-data-migrate?revision=109&view=markup&pathrev=132

yes, gettext would really be nice, but reading through
http://php.net/gettext makes me nervous ...

do you know any not so special application that uses gettext and works "out
of the box" like phpMyAdmin does?

-- 
Sebastian





More information about the Developers mailing list