[wp-trac] [WordPress Trac] #44758: The REST API is not respecting the user's locale properly.

WordPress Trac noreply at wordpress.org
Fri Oct 19 21:33:57 UTC 2018


#44758: The REST API is not respecting the user's locale properly.
-------------------------------------------------+-------------------------
 Reporter:  youknowriad                          |       Owner:  pento
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.0
Component:  REST API                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  2nd-opinion has-patch has-unit-      |     Focuses:  rest-api
  tests dev-feedback                             |
-------------------------------------------------+-------------------------

Comment (by flixos90):

 I like what the current approach looks like, I just made two minor
 modifications in [attachment:"44758.4.diff"]:

 * I changed the name of the filter to `determine_locale`. I think it's a
 more common approach to use the function name (with the verb) instead of
 what you're actually filtering. It confused me when I saw it was called
 `determined_locale`, different than the function and without any action
 verb in the name.
 * I think it would be beneficial to have a short-circuiting filter here,
 thus added `pre_determine_locale`. Some of the default logic has side
 effects (see #43869), so a short-circuit filter would allow working around
 these. I can personally see more use-cases for that than for the default
 one that runs after the default way of determining the current locale,
 however I think both have reasons to exist, so I'd say we should have both
 in.

 It's good for merge in my opinion.

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


More information about the wp-trac mailing list