Brady Ward
92 posts
Registered:
19 Aug 2021
Answered
23 Sep 2021
in reply to
Madson Almeida
Link to this post
Hello Madson,
You can add a Google Translate button to Sitefinity/TPC quite easily. When dropped into a page, the Google Translate button will attempt to translate all text on the page.
To add the button to a specific page you can:
1. Add a Content Block widget onto the page and insert
a div (ie. <div id="google_translate_element"></div>)
2. Use an “Embed Code” widget and
insert the following script <script type="text/javascript"
src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
3. Use a “JavaScript” widget to
insert the following code:
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
To add the translate button to every page, use the above code samples in a page template following the same steps. Keep in mind, the button will appear wherever the above div is placed. If you require further assistance, please don't
hesitate to join one of our daily Q&A sessions or email support at support@crmportalconnector.com.
All the best,
Brady