WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #22229, comment 5


Ignore:
Timestamp:
10/31/12 22:40:54 (18 months ago)
Author:
nbachiyski
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22229, comment 5

    initial v1  
    66 * The default number of plurals and the default expression do not belong to this part of the code. We're dealing with JS here, not with gettext specifics. I have two ideas around this problem: 
    77  0. Make {{{nplurals_and_expression_from_header()}}} and {{{parenthesize_plural_exression()}}} static. Then just call {{{Gettext_Translations::nplurals_and_expression_from_header( $mo->get_header( 'Plural-Forms' ) );}}}. Or better, create an instance method of {{{Gettext_Translations}}} called {{{nplurals_and_expression()}}}, which uses the header from the instance. 
    8   0. We can create a {{{NOOP_Gettext_tarnslations}}}, which extends {{{Gettext_Translations}}} and all the functionality, except actually translating is still there. The note about {{{nplurals_and_expression()}}} still applies. 
     8  0. We can create a {{{NOOP_Gettext_Translations}}}, which extends {{{Gettext_Translations}}} and all the functionality, except actually translating is still there. The note about {{{nplurals_and_expression()}}} still applies. 
    99 
    1010* I agree with scribu that we shouldn't create a new function each time. I think we should keep the pretty syntax of {{{numItems(5)}}} (it's pretty and I don't need to remember any other function names) and we should have a function generator, building a single function and just varying on singular/plural.