Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#34275 closed defect (bug) (fixed)

Missing i18n in the WP_oEmbed_Controller class

Reported by: johnbillion's profile johnbillion Owned by: ocean90's profile ocean90
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.4
Component: Embeds Keywords: commit has-patch
Focuses: Cc:

Description

The WP_oEmbed_Controller::parse_query() method includes the following line:

echo 'URL parameter missing';

The WP_oEmbed_Controller::json_response() method includes the following line:

return 'Not implemented';

The WP_oEmbed_Controller::xml_response() method includes the following line:

return 'Not implemented';

The first instance needs internationalizing. The second and third instances should either not output the 'Not implemented' string at all, or they should use the return value of get_status_header_desc( 501 ).

Attachments (1)

34275.patch (2.8 KB) - added by ocean90 9 years ago.

Download all attachments as: .zip

Change History (6)

#1 @swissspidy
9 years ago

+1

See also #34207. The latest patch there already introduces these suggestions.

#2 @ocean90
9 years ago

I don't think that these error messages should be translatable. It's an API which should return them only in one language.

[35354] has replaced one instace of "Not implemented" with get_status_header_desc( 501 ).

@ocean90
9 years ago

#3 @pento
9 years ago

  • Keywords commit added; 2nd-opinion removed
  • Owner set to ocean90
  • Status changed from new to assigned

I'm inclined to go with 34275.patch, though there's a good argument that we should be translating the messages in get_status_header_desc() - the HTTP status code is the only part that's meant to be machine read, the message is for humans. That's for a different ticket, though, should anyone feel that way inclined.

#4 @SergeyBiryukov
9 years ago

  • Keywords has-patch added; needs-patch removed

#5 @ocean90
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 35408:

Embeds: Replace hardcoded error messages with get_status_header_desc( $http_code ).

Fixes #34275.

Note: See TracTickets for help on using tickets.