[wp-trac] [WordPress Trac] #42510: Can't reflect translation

WordPress Trac noreply at wordpress.org
Mon Nov 13 01:06:51 UTC 2017


#42510: Can't reflect translation
--------------------------+------------------
 Reporter:  munyagu       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.9
Component:  I18N          |     Version:  4.9
 Severity:  major         |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------

Comment (by dd32):

 Replying to [comment:15 westonruter]:
 > Maybe the _n_noop() is clobbering the _n(). I confess I don't understand
 the mechanics of i18n very well.

 The issue is the `_n_noop()` doesn't perform translations - it's literally
 an array passthrough for use later by `translate_nooped_plural()` - it's
 not an issue of being clobbered.
 https://developer.wordpress.org/reference/functions/_n_noop/ has an
 example of that usage (plus the source of the function there)

 So instead, it should pass through a translated 'singular' and a
 translated 'plural' string to JS (be that two `_n()`'s using 1 & 2 as the
 count as in [attachment:42510.patch], or literally `__()` twice), both of
 those will be incorrect in some languages, but as @ocean90 said, until we
 have a JS translation API such as what Gutenberg is using, we have no
 other way to do it properly.

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


More information about the wp-trac mailing list