Solution design

To achieve our solution, we are going to do the following:

  1. On the view-thread page, the user is going see a Translate button.
  2. Clicking on the translate button, we show a popup where the user selects the target language.
  3. When then send the target language and the message to the Cloud Translation API and get the response.
  4. We then tag the response against the language and save the entire message to the database, so, from the next time onwards, we can reply from DB instead of making an API call. The persisted response will then be sent back to the browser.
  5. The Angular app will process the response and update the thread.

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.