#27581 closed defect (bug) (fixed)
Plural form instead of singular for 'Based on %s ratings' in theme-install.php
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | I18N | Keywords: | has-patch |
Focuses: | administration | Cc: |
Description
String from the theme installer (wp-admin/theme-install.php) needs to be changed from the current singular form to plural.
/wp-admin/theme-install.php (line 208)
Attachments (1)
Change History (10)
#2
@
11 years ago
- Owner set to johnbillion
- Status changed from new to assigned
The problem here is that the theme install screen is doing a direct AJAX call to api.wordpress.org
. If we changed this to a local AJAX call which done a server-side request to api.wordpress.org
we could post-process the data and use _n()
to populate a string with the complete correctly pluralised phrase.
I'll knock up a patch.
#3
@
11 years ago
- Keywords has-patch added
27581.patch switches the theme install screen over to using a local AJAX call instead of calling api.wordpress.org
directly. The results of the call are processed and a correctly localised num_ratings_text
item is added to each item in the themes
array which is then used in the template.
#4
@
11 years ago
The localized issue is pointed out in #27581 as well. Definitely something to consider...
The issue with going through WordPress always is that it's slower. The direct api.wordpress.org hit was something I did deliberately for speed reasons. On the other hand, we could then use themes_api() again, which would solve some mostly academic back compat concerns.
Another option is to ditch POST, XHR, CORS: The 1.1 endpoint (as of 3 minutes ago) now supports GET and JSONP via a 'callback' parameter. Additionally, to save query string length, queried tags can now be passed as comma-separated, instead of an array.
#5
@
11 years ago
The phrase containing num_ratings
needs to pass through _n()
in order to correctly pluralise it, which means the result of the call to api.wordpress.org
needs to go through WordPress one way or another.
Another option would be to add a language parameter to the API call and get the API to return our localised string for us, but that doesn't sound like a good idea.
#6
@
11 years ago
I was thinking we'd change up the string like just do a faint (28)
after the five stars.
This is going to be complicated as we don't have JS plurals. We might need to think outside the box.