Making WordPress.org

Opened 10 years ago

Closed 10 years ago

#2415 closed defect (bug) (fixed)

API doesn't return translated plugin infomation

Reported by: ocean90 Owned by: dd32
Priority: high Milestone: Plugin Directory v3.0
Component: Plugin Directory Keywords:
Cc:

Description

The new code for the api.w.org endpoint returns only results in English because the translation filters are not registered. Plugins_Info_API::load_wordpress() sets $_SERVER['HTTP_HOST'] to wordpress.org which means get_locale() returns en_US.

I think we should set $_SERVER['HTTP_HOST'] to the site of the requested locale.

Change History (5)

#1 @ocean90
10 years ago

  • Owner set to dd32
  • Status newreviewing

#2 @dd32
10 years ago

  • Keywords needs-patch removed
  • MilestonePlugin Directory v3.0
  • Priority normalhigh
  • Status reviewingaccepted

#3 @dd32
10 years ago

I think we should set $_SERVER['HTTP_HOST'] to the site of the requested locale.

I think I'd rather add a locale filter (which was the original intention), or define the locale for the request instead of changing the HTTP_HOST.

The filters should also be registered all the time (I guess) bailing early when en_US.

#4 @dd32
10 years ago

I think I'd rather add a locale filter (which was the original intention), or define the locale for the request instead

Which we can now do just by calling switch_to_locale() instead of fancy filters :)

#5 @dd32
10 years ago

  • Resolutionfixed
  • Status acceptedclosed

In 4764:

Plugin Directory: Use translated data for the api.wordpress.org info endpoint.

  • Also translates screenshot titles on the front end
  • Also uses plugin tags in API info endpoint rather than defunct categories.

See #2112
Fixes #2415

Note: See TracTickets for help on using tickets.