[wp-trac] [WordPress Trac] #39006: REST API: Language setting should not be present when no languages are available

WordPress Trac noreply at wordpress.org
Thu Jan 5 07:21:45 UTC 2017


#39006: REST API: Language setting should not be present when no languages are
available
--------------------------------+-----------------------
 Reporter:  johnbillion         |       Owner:
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  4.7.2
Component:  Options, Meta APIs  |     Version:  4.7
 Severity:  normal              |  Resolution:
 Keywords:  needs-patch         |     Focuses:  rest-api
--------------------------------+-----------------------

Comment (by rmccue):

 Re:
 > I'm wondering whether to abstract the logic into a reusable function
 which both usages call rather than requiring any logic changes to be made
 in two places.

 I think that makes sense, ''but'' we run into a problem here in that
 there's no good name for the function. We have:

 * `get_available_languages` - Get list of language codes based on the .mo
 files.
 * `wp_get_installed_translations` - Get list of language file data based
 on .mo file headers.
 * `wp_get_available_translations` - Get list of language data based on API
 response.

 None of the existing ones can be used authoritatively, and none of the
 return formats match each other. I can't think of a good name for a new
 function, this is a bit of a mess really.

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


More information about the wp-trac mailing list