I am recently working in a project. There I need to convert language from English to Japanese by button click event. The text is in a div. Like this:
\"
Assuming your literals have an id in your database you could put that id as a class in your div. Then with jquery fetch the ID, send it to your Ajax back-end and fetch the translated one.