[wp-trac] [WordPress Trac] #34308: The _n*() functions don't cater for a string that represents exactly one item

WordPress Trac noreply at wordpress.org
Thu Oct 15 16:23:55 UTC 2015


#34308: The _n*() functions don't cater for a string that represents exactly one
item
--------------------------------------+------------------------------
 Reporter:  johnbillion               |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  I18N                      |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  dev-feedback 2nd-opinion  |     Focuses:
--------------------------------------+------------------------------

Comment (by GaryJ):

 Replying to [comment:3 johnbillion]:
 > Another option would be to extend `_n_noop()` and allow a fourth
 parameter for the 'exactly one item' string, but this would result in it
 being the only l10n function which accepted a parameter that came after
 its textdomain parameter.

 I would discount this option, for exactly the reason you've given.
 Automated tools that check and add textdomains to known functions, would
 now need to account for the potential occurrence of this extra param.

 Plugins and themes which need to use `_n_noop()` with this extra param
 would need to specify a textdomain, instead of letting automated tools do
 it.

 ----

 Could the first param accept an array, such that, if it is an array, the
 exactly-one string was in key 0, and singular-but-not-one string was in
 key 1?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34308#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list