Reputation: 181
I've just started a new job where I am coding emails daily in multiple languages, and I am hoping to come across a solution to make my work efforts a bit more streamlined. Essentially I create an English HTML email and then copy and paste the exact HTML into another document and translate the text to say, German or French. Does anyone know of a solution to translate an entire HTML document to another language, obviously only the main content? I came across this Azure tool that does it, but it's a bit complicated for me to understand. Is there a Javascript function to do this? Any direction would be great.
Upvotes: 1
Views: 3115
Reputation: 805
Google Translate has a free HTML page translator you can find here. It does look ugly in my opinion, but it works perfectly.
<script type="text/javascript">// <![CDATA[
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
// ]]></script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit" type="text/javascript"></script>
JSFiddle example: https://jsfiddle.net/bsru1823/2/
Upvotes: 3