Repository navigation
Playlist: seek value text localization - #79834
Conversation
|
Size Change: +1.13 kB (+0.01%) Total Size: 7.67 MB 📦 View Changed
|
Expose the waveform player's seek control as a keyboard-operable ARIA slider with a translated accessible label and value text, on both the editor and the front end. The strings are localized with @wordpress/i18n (and esc_attr_x on the server) and handed to @arraypress/waveform-player through its native `seekLabel` and `seekValueText` options via data attributes. The library owns all time formatting and interpolates the current time and duration into the slider's aria-valuetext; Gutenberg only supplies the translated templates, with no client-side patching of library internals. Consolidates the seek-accessibility work from #78980 using the library's native seek options. Full non-English value-text localization depends on the `seekValueText` option (arraypress/waveform-player#13), so bump @arraypress/waveform-player once it is released. Co-authored-by: Ben Dwyer <ben@scruffian.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8e06fe1 to
ec19345
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
scruffian
left a comment
There was a problem hiding this comment.
i think this looks good, lets bring it in.
|
Flaky tests detected in 84efae8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/28857022302
|
Alternate to #78980
Important
This PR is dependent on the assumption the
seekValueTextPR on Waveform Player gets merged. If it does, then we can version bump Waveform Player (TODO) and merge this PR.Update: It's merged.
What?
Follow-up to #78980 that removes Gutenberg's client-side seek value-text localization now that
@arraypress/waveform-playercan do it natively.Why?
To localize the seek slider's spoken
aria-valuetext, #78980 had to reach into library internals — monkey-patchingupdateSeekAccessibilityandoptions.onTimeUpdate— because the library hardcoded an English"X of Y"string with no way to customize it. That's fragile (it depends on undocumented method names and event ordering) and it forced us to duplicate the library's own time-formatting.The library now exposes a
seekValueTexttemplate option (settable viadata-seek-value-text) and interpolates the formatted current time and duration itself. So we can just pass the already-translated template through and delete the workaround.How?
createWaveformContainer()now forwards aseekValueTextoption to the library asdata-seek-value-text.initWaveformPlayer()passeslabels.seekValueTextthrough to the container.The library owns all time formatting; Gutenberg only supplies the translated strings.
Testing Instructions
aria-valuetextreads the localized "current of total" (e.g.0:30 of 2:00), updating as playback progresses.Unit tests
npm run test:unit -- packages/block-library/src/utils/test/waveform-utils.js— updated to cover the newdata-seek-value-textattribute and drop the removed localization helper (28 passing).Accessibility
No behavior change for users: the seek slider still exposes a translated, natural-language
aria-valuetext. This only moves where the string is assembled (library instead of Gutenberg).