Select the "Formatted Text Blocks" from the list of component library available in Drupal. Make sure to set the "text format" to "JSON Friendly". See image below:
Drupal Text Editor - One Column Text
Add the following code to editor:
Don't forget to go to Weglot Dashboard and grab the api_key to include in the Weglot.initialize function below.
Add CSS style to overwrite the current "Translation" text and/or link on the website.
Add Javascript to fix window position of translation link/dropdown on the page: