Thread: Gettext in php
View Single Post
  #10 (permalink)  
Old 05-09-2008, 02:55 AM
senraj senraj is offline
D-Web Master
 
Join Date: Jul 2007
Posts: 418
senraj is on a distinguished road
Post Re: Gettext in php

Hi,

ngettext() returns correct plural form of message identified by msgid1 and msgid2 for count n. Some languages have more than one form for plural messages dependent on the count.

ngettext() example

PHP Code:
<?php

setlocale
(LC_ALL'cs_CZ');
printf(ngettext("%d window""%d windows"1), 1); 
printf(ngettext("%d window""%d windows"2), 2); 
printf(ngettext("%d window""%d windows"5), 5); 

?>
This will output
1
2
5
__________________
Regards,
Senraj.A
Reply With Quote