Re: Need help with i18nizing some strings



fre 2003-04-11 klockan 21.00 skrev Joe Shaw:
> Right now we have a pretty ugly block of code:
[...]

That was indeed nasty (from an i18n POV). ;-)


> which essentially allows us to get a string similar to:
> 
>         There are currently 2 pending installs and 1 pending removal. 
>         If you quit now, all pending operations will be lost.
>         Are you sure you want to quit?
>         
> Clearly this won't work for a lot of languages.  How can I refactor this
> code to work nicely with all languages?  I guess there's also a more
> general "what is the right way to do plurals" question here as well.

http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#plurals

The only solution that solves all the mentioned plural issues is
ngettext, but using ngettext has portability problems. It should work on
at least all modern GNU/Linux and Solaris systems though (there was a
thread on this back in February;
http://lists.gnome.org/archives/gnome-i18n/2003-February/msg00176.html).

If you can't use that the second best choice is having four message
variants, one for each combination of plurals. But such a solution will
still cause problems for languages with special plurals, such as most
(all?) slavic languages.



Christian




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