[wp-trac] Re: [WordPress Trac] #7989: Translate "topic/topics" in the tag cloud

WordPress Trac wp-trac at lists.automattic.com
Thu Nov 20 23:11:00 GMT 2008


#7989: Translate "topic/topics" in the tag cloud
-----------------------+----------------------------------------------------
 Reporter:  msi08      |        Owner:  ryan
     Type:  defect     |       Status:  new 
 Priority:  normal     |    Milestone:  2.7 
Component:  i18n       |      Version:      
 Severity:  normal     |   Resolution:      
 Keywords:  has-patch  |  
-----------------------+----------------------------------------------------
Changes (by nbachiyski):

  * keywords:  => has-patch

Comment:

 In general it is ok to use {{{__ngettext()}}} as a function to choose the
 right form, based on a count, even if it is not translated. The patch
 above will work well in most of the cases. However, there are languages,
 which have different plural rules (different plural form for counts
 divisible by 13 and such strange stuff).

 Here is a patch, which replaces the two arguments with one -- a callback,
 which given the count, returns the proper text. The default callback is an
 {{{__ngettext()}}} call with {{{'%s topic'}}} and {{{'%s topics'}}}.

 Backward compatibility is maintained, by checking if
 {{{$args['single_text'}}}] and {{{$args['multiple_text']}}} are defined
 and in that case a special callback, using these two is constructed.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7989#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list