Testing the app

To test the app, from the root of the application folder, run this:

$ npm run devor$ yarn dev

This will launch our application. From the home page, click on Create Thread and create a new thread named Translate API Test or any name you want. Once we create a new thread and navigate to the view thread page, we should see the translate button next to each text message:

Next, when we click on the Translate button, we should see a popup where we see the original message and a selection for translated language. When we pick a language and click on Translate, we should see the translated message, as shown here:

I have translated ...

Get Google Cloud AI Services Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.