[wp-trac] [WordPress Trac] #29022: Screen reader text (and link title) isn't updated when plugin update count is updated
WordPress Trac
noreply at wordpress.org
Tue Aug 5 13:50:58 UTC 2014
#29022: Screen reader text (and link title) isn't updated when plugin update count
is updated
-------------------------+-------------------------------------------------
Reporter: pento | Owner:
Type: defect | Status: new
(bug) | Milestone: Future Release
Priority: normal | Version: 3.9
Component: | Resolution:
Upgrade/Install | Focuses: accessibility, javascript,
Severity: minor | administration
Keywords: has-patch |
2nd-opinion |
-------------------------+-------------------------------------------------
Comment (by adamsilverstein):
Jed looks cool and worth adding - we are going to face this issue with
increasing frequency as we add more JavaScript/Backbone to core.
The problem with relying on the php translation function is that the
updates occur in an iframe and there can be multiple updates, the
JavaScript runs on the page without a refresh. Hitting the php would
likdely require an ajax call.
I like the last, simplest option: reconstruct the string so we don't have
to worry about plurals. Not sure this works correctly in all languages,
I'm ok with that even if the resulting string isn't perfectly
grammatically correct. The code would be greatly simplified and the
resulting string would still convey the important information.
Something like:
```Updates available - Themes: 3, Plugins: 1, Wordpress: 1```
Even when only one update remains, the string still makes perfect sense:
```Updates available - Themes: 1```
Doing it this way eliminates the translations entirely, what do you think?
Replying to [comment:17 pento]:
> That's a good point, I think we'll need a different approach to handle
plurals properly.
>
> We have a few options, but I'm not sure which is the least insane:
>
> * Add [https://slexaxton.github.io/Jed/ Jed] to core. We can use this to
properly handle the multiple plural forms, with minimum modification to
existing code.
>
> * After an update has happened, manipulate the appropriate transient
that `wp_get_update_data()` uses to generate the string, then
`WP_Upgrader_Skin::decrement_update_count` can call
`wp_get_update_data()`, send the string to the browser, then the string
can be updated easily.
>
> * Same as above, but call
`wp_version_check()`/`wp_update_plugins()`/`wp_update_themes()` to update
the transients.
>
> Alternatively, we can go for the easier option of just setting the
string to "Updates available", and not bothering trying to generate an
accurate string.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29022#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list