User Story:
As a user when I visit a discussion page I want to be able to read any comment in my own language so that I can participate in the conversation effectively.
Acceptance criteria:
- user should see translation entry point (button) next to all comments
- detect where a new comment ends and start in the DOM so that button appears right after each comment (check in with people who wrote Discussion tools to do so, as we might not have to not reinvent the wheel)
- copy code from https://github.com/santhoshtr/wiki-elements/blob/main/src/wiki-machine-translation.js as it's not available as an npm package yet
- call endpoint to translate text and replace innerHTML
- show original text button
Demo with Santhosh here: https://drive.google.com/file/d/1LyAsYNrE2NkkNSUwJNlU2vlVUwqyeC8_/view
Details for QA:
- check especially nested messages and make sure translate button appears at the right place (after every message)
- make sure translation is replacing original text to translated text
- Automatic translation disclaimer is displayed along with translated text
- Link to change Translation settings (Source and target language) appears in the disclaimer
- Translation button is hidden under the translated text
- Show original text link is displayed and clicking it shows the original text