Translate Selected Text With Workflow

You can do a lot with Workflow, including taking selected text and running it through Workflow actions. In this example, we'll take selected text on a web site, run it through Workflow where it will translate it to French, and then speak the translated text with your iPhone's French voice. You can also provide other text, or even pre-translated text to the actions for a handy travel helper.

Video Transcript
So let's take another look at using Workflow to build something useful. Workflow is a free app you can get for your iPhone or iPad. It's from Apple. Just search for Workflow and add it to your apps on your iPhone or iPad. You use to it to build little programs, kind of like how you use Automator on a Mac.

So we're going to go into Workflow here. If this is your first time in Workflow it's going to walk you through a tutorial. Once you're done with that you've got My Workflows and Gallery. We're looking at My Workflows and I can tap Create Workflow to start a new one. Now workflows can be either Normal which is something you can run inside the Workflow app or you can add an icon to the Home screen to run it. Today Widget which appears under Notifications when you swipe to the right so you see what's on the left of your home screen, and also an Action Extension, which is what we want here because we want to be able to select some text and then have the workflow run on that text.

So we've switched to Action Extension. Now we're going to name it by going to the Settings which is the button at the upper right there for Settings. I'm going to call this one Speak French because it's going to take any text that I've selected and speak it but in French. Now, I'm also going to change the icon here. We can pick something nicer here. You can search for something maybe that kind of looks like a translation or speaking. There we go. Maybe like that. We'll use that as the icon. Now we'll go and tap Done and now I'm going to tap Actions at the bottom left. I'm going to tap at the upper left where it says Actions so I can get out of the suggested list of actions into the main list here.

Now I'm going to look for text and I can see right here there's one called Speak Text. I can tap that and I can read about it. I can drag that to the right and it's going to speak whatever text is currently selected. So we haven't gotten to the translation part yet but maybe we should test and see how this works. So we'll hit Done and I can see it says Speak French. It's there. But we've made it an extension here. So we're going to go to Safari and I'm going to select some text. Now usually you would access this type of script by using that Share button at the bottom which would speak all the text from this entire page.

But when you select some text you get the little Copy, Look Up, Speak, Share, you know, that above it. You can see it right there. I'm going to hit Share and now it brings up the Sharing panel here and one of those things is Run Workflow. If you don't see Run Workflow tap More there and add Run Workflow. So I'm going to hit Run Workflow and there is my Speak French workflow. I'm going to tap that. MacMost is a free website with video tutorials for Apple Mac, iPhone, and iPad users. Great, so that works. Now all we need to do is have it translate to French.

So let's go back into Workflow here and I will go into Speak French here. I'm going to go back to Actions and I'm going to look under Text for Translate. There's one called Translate Text. If you don't find it you can always Search for things because there's a ton of different things that you can do. So let's look at the description there. It seems like what we want. We're going to put that before it speaks it. We're going to have it Detect the Language and go to French. So now it's going to translate the text. Hopefully recognize it's in English. Translate it from English to French. Then pipe that into Speak Text. It's going to speak it in French.

We may have gotten a little grant permissions dialogue when we first added translate text or first went to save this when I hit Done but, you know, if you get that just grant permissions. It's not going to do that now because I've already tried this kind of thing out. I'm going to hit Done and let's go back to Safari. I'll tap that Selected Text. I'll hit Share again. I'll hit Run Workflow and I'll hit Speak French.

Now it sounds a little awkward because we were having the text translated to French and then we were having it spoken by the voice on your iPhone but using your Default language. You can see that was an option there. So let's change the language it's going to speak it in, into French. Now it will speak it using the French voice. It should be able to handle the text better. It doesn't improve the translation in any way because the translation is always going to be imperfect. But it will speak it a little bit nicer. There we go. So that's kind of useful in and of itself.

You can do lots of other stuff. Like, for instance, I could have this setup where I add my own text in here. So I'll just search for Text. You can see one of the things here is just Text. You know, if you add this here instead of accepting input you can type whatever text you want. Then you can have it translated and then the translation spoken. Or I can eliminate completely the translation part and actually have the text that's properly translated into French. Then I could set this up, instead of as an extension, I can make it just a normal workflow and I can play it. So, for instance, I could load up my phone if I was visiting France and I didn't speak French I could load it up with ten phrases I may need to say in an emergency and then be able to have my iPhone speak those phrases when I needed to just by using the workflow app.

So a lot of different things you can do. Again you've got to really explore all the different actions that you have in Workflow and see what else you can build that would be useful to you.

Comments: One Response to “Translate Selected Text With Workflow”

    Bob
    4/7/18 @ 11:38 am

    Extremely useful – did not know that App existed.

Comments Closed.