Text to Speech and Translation Blocks in Scratch 3.0

Making Your Applications More Accessible

One of my favourite coding environments to learn to code with is Scratch. Recently, Scratch released their 3.0 version with many new additions and capabilities. I have shared some ideas to make use of the new Text to Speech and Translate extensions. The programs below get progressively more challenging.

You might have students follow along. Afterward, be sure to challenge students with extension/challenge activities. I’ve included some challenges for you to consider trying out.

beartranslate


Adjusting your Scratch applications to make them more accessible…

Part 1 – Text to Speech blocks

I will share with you some simple code that you can include in your applications to make them more accessible. I will show you how to make the character say something in a speech bubble as well as with their voice so the user can hear the same text.

Video tutorial: https://youtu.be/vtOuK7PcQLo

Here is what the code looks like…

image1


Translating text in Scratch…

Part 2 – Translate blocks

I will show you how to add code that will translate text from one language to another.

Video tutorial: https://youtu.be/3wUhdTllgKk

Here is what the code looks like…

image2

Part 3 – Including a variable

I will show you how to replace the text that is repeated throughout the program with a variable.

Video tutorial: https://youtu.be/DWcn6ZT4MYU

Here is what the code looks like…

image3

Part 4 – Getting input from the user to translate

I will show you how to ask the user for words or a phrase that will be translated to another language.

Video tutorial: https://youtu.be/m2teQygHNoA

Here is what the code looks like:

image4


Using lists to obtain and translate words entered by the user

Part 5 – Challenge: Translating Lists

For this more advanced application, I’ve used a counter, a loop and lists to create a program that asks the user for a number of words and then translates each word one, by one.

You can see that lists are used rather than variables to store each word.  I’ve also made use of creating my own blocks, which are like functions. Can you figure out how the code works in this application?

Video Demonstration:  https://youtu.be/Z4KlzJT-lq0

Application Link: https://scratch.mit.edu/projects/280044496/editor/


Other Challenges:

1 – Allow the user to select which language they would like to translate the words to.

2 – Can you figure out a way to remove the word “stop” from the list of words other than deleting the last word in the list as I’ve done?

image5

For help with counters, check out the applications on this link.

Let me know if you have more ideas!

Counters in Scratch 3.0

Counter example applications

Simple Score – In this application, I’ve used simple code that can keep track of scores in a game.

teamscores

Video Tutorial: https://youtu.be/VDiGJr2K4Hc

Application Link:  https://scratch.mit.edu/projects/283077497/editor/

Perimeter – Check out this application that uses a counter to keep track of the number of steps the mouse moves. As you press the arrow keys, the counter, or perimeter, in this case, is increased by 1. Feel free to remix this and add your own creative elements to the program!

perimeterperimetercode

Application Link: https://scratch.mit.edu/projects/283077691/editor

Video Demonstration: https://youtu.be/h-9NkrvekMY