Changes between Initial Version and Version 1 of Ticket #22229, comment 5
- Timestamp:
- 10/31/2012 10:40:54 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #22229, comment 5
initial v1 6 6 * 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: 7 7 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. 9 9 10 10 * 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.