#27581 closed defect (bug) (fixed)
Plural form instead of singular for 'Based on %s ratings' in theme-install.php
| Reported by: | kenan3008 | Owned by: | johnbillion |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.9 |
| Component: | I18N | Version: | 3.9 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | administration |
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
@
12 years ago
- Owner set to
- Status new → 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
@
12 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
@
12 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
@
12 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
@
12 years ago
I was thinking we'd change up the string like just do a faint (28) after the five stars.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This is going to be complicated as we don't have JS plurals. We might need to think outside the box.