[wp-trac] [WordPress Trac] #38918: delete_plugins() needs a proper singular and plural form for its error message

WordPress Trac noreply at wordpress.org
Tue Oct 3 13:52:10 UTC 2017


#38918: delete_plugins() needs a proper singular and plural form for its error
message
------------------------------------+--------------------------
 Reporter:  johnbillion             |       Owner:  johnbillion
     Type:  enhancement             |      Status:  reviewing
 Priority:  normal                  |   Milestone:  4.9
Component:  Plugins                 |     Version:  2.6
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+--------------------------

Comment (by SergeyBiryukov):

 I think it's exactly one of the cases where we should check for `1 ===
 count( $errors )` specifically instead of using `_n()`, to avoid
 displaying the singular string for
 [https://codex.wordpress.org/I18n_for_WordPress_Developers#Plurals 21, 31,
 etc. in some languages].

 Using `%l` and `wp_sprintf()` seems fine, but we only use it two places in
 core: in `get_the_taxonomies()` and on Credits page. The goal there is to
 display a "smart" list with an Oxford comma and such: `%s, %s, and %s` for
 more than 2 items or `%s and %s` for only 2 items.

 As noted above, it's rare for plugin deletion error message to contain
 multiple filenames, so I think there's no need for this list to be
 "smart", a simple `implode( ', ', $errors )` should be fine as well.

 See [attachment:38918.3.diff].

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


More information about the wp-trac mailing list