Thread View: pl.comp.lang.ruby
2 messages
2 total messages
Started by FOX
Sun, 26 Oct 2008 23:10
rozszerzony pluralize
Author: FOX
Date: Sun, 26 Oct 2008 23:10
Date: Sun, 26 Oct 2008 23:10
14 lines
1010 bytes
1010 bytes
Witam jest gdzieś jakiś rozszerzony pluralizer dla przypadku: 1 produkt 2 produkty 8 produktów lub inny elegancki sposób na powyższą odmianę ? Pozdrawiam FOX
Re: rozszerzony pluralize
Author: Przemysław Kowalczyk
Date: Mon, 27 Oct 2008 19:31
Date: Mon, 27 Oct 2008 19:31
24 lines
1370 bytes
1370 bytes
On Mon, 27 Oct 2008 00:10:58 +0100, FOX <user@company.xx> wrote:
>
> jest gdzieś jakiś rozszerzony pluralizer
> dla przypadku:
>
> 1 produkt
> 2 produkty
> 8 produktów
>
>
> lub inny elegancki sposób na powyższą odmianę ?
GetText to obsluguje out-of-the-box:
n_('%d produkt', '%d produkty', '%d produktów', x) % x
patrz:
http://www.yotabanana.com/hiki/ruby-gettext-howto.html#How+to+use+GetText.n_%28msgid%2C+msgid_plural%2C+n%29
pzdr
szeryf
--
Przemysław ,,Szeryf'' Kowalczyk :: http://szeryf.wordpress.com/
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads