[wp-trac] [WordPress Trac] #50493: more detailed notice for register_rest_route

WordPress Trac noreply at wordpress.org
Sat Jul 25 14:06:28 UTC 2020


#50493: more detailed notice for register_rest_route
-------------------------------------+-----------------------------
 Reporter:  Lwangaman                |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  REST API                 |     Version:  5.4.2
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  rest-api
-------------------------------------+-----------------------------
Changes (by Lwangaman):

 * keywords:  has-patch => has-patch needs-testing


Comment:

 @TimothyBlynJacobs I cleaned up the translator requests and they are now
 numbered 1. 2. ...
 Also, the numbers are all sequential like you suggested except for one
 string:

 {{{#!php
 /* translators: 1: rest_api_init, 2: string value of the namespace, 3:
 string value of the route */
 __( 'REST API routes must be registered on the %1$s action. Instead route
 \'%3$s\' with namespace \'%2$s\' was not registered on this action.' ),
 '<code>rest_api_init</code>',
 '<code>'.$namespace.'</code>',
 '<code>'.$route.'</code>'
 }}}

 The subject of the first sentence are the "routes". So it makes sense that
 in the second sentence, the subject of the sentence is the "route" in
 question. I don't see a way of switching the order of "route" and
 "namespace" in the second sentence without changing the meaning or keeping
 "route" as the subject. And I figure the code is cleaner if the parameters
 `$namespace` and `$route` are passed into the `sprintf` in the same
 logical order as all the other messages before it. Is this acceptable? Do
 you think it can be any cleaner?

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


More information about the wp-trac mailing list