Text to Speech plugin
Hi Boone - Member Samuel Ghelli is using this new plugin for his Italian class - but each time the page reloads, he has to pick "Italian" from a dropdown list of over 50 languages. I looked at the code and made some changes to the back-end to add a "defaultVoice" option and to the front-end of the widget to default to that when voice when the page reloads. Seems to work fine. What is our policy for something like this? Can I just provide the zip file and we'll use it - or do we need to rename it, or do we need to contact the original author?
#1 Updated by Boone Gorges over 1 year ago
- Status changed from New to Reporter Feedback
Could you point out the place in the code where you made the change? I can take a look to see if there's a way that we can make such a change without changing the plugin's source code (via a filter or something like that). If so, we can create a small plugin for this specific site that'll set the default. If not, we can talk about alternative approaches. (In general, we don't modify plugin source code, as it wreaks havoc with future updates.)
#2 Updated by scott voth over 1 year ago
Thanks Boone - He also wanted the option to speak the text more slowly - so I added checkbox for that too. I have attached the zip file.
Changes to voice.js lines 16-19
changes to text-to-speech-widget.php - lines 50-60, 66, 82-90, 98-104
Hope this is not too much work for you.
#4 Updated by Boone Gorges over 1 year ago
- Status changed from Assigned to Hold
Hi Scott - I've had a chance to look over your changes. I have to say, the features you've suggested are pretty good additions to the plugin. If you want to pursue them, you might consider sending an enhancement request to the plugin author. It looks like this is the author's GitHub repo https://github.com/pmbaldha/Text-To-Speech-Widget-Wordpress-Plugin. No idea whether he'll consider a pull request - it doesn't look like the repo has been updated since the plugin was initially added.
Unfortunately, I can't accept the changes as-is on the Commons, because we can't maintain plugin forks (except in extreme circumstances). So what I've done is move your mods into a separate plugin, which makes the requested changes in JS (there are no applicable filters in the PHP). Here's the changeset on the Commons repo, which I've just granted you access to: https://github.com/cuny-academic-commons/cac/commit/15177d2cd52e9b6732b3f924104a4ebf24d11275 Note my trick in the plugin loader file: I wait until after the text-to-speech-widget plugin has registered its JS at wp_enqueue_scripts (with implied priority 10 - thus my own priority 20), and then I deregister its script and register our version of it with the same name. Then the mods in the voice.js file match your mods pretty closely. In a separate commit, I limited the plugin so that it can only be activated on the elementaryitalian site. I'll activate it there and verify that it works properly after the next release.
Thanks for your work on this - you went above and beyond. Let me know if you have more questions or thoughts about implementation on this ticket.