I wanted to keep the translate feature simple. So, along with the existing text message, we are going to add a Translate button in the meta data column of the text message. Open client\app\view-thread\view-thread.component.html and after the Delete message section, add this code:
// SNIPP SNIPP<!-- Any text message will have a nlpLanguage varible --><div *ngIf="message.nlpLanguage"> <br> <button class="btn btn-info btn-block" type="button" (click)="translateMessage(message)"><i class="fa fa-arrows-h"></i> Translate Message</button></div>// SNIPP SNIPP
Next, the required logic for translateMessage will be placed in client\app\view-thread\view-thread.component.ts and should be as shown here:
// SNIPP SNIPP ...