function googleTranslateElementInit() {
new google.translate.TranslateElement(
{
pageLanguage: "en",
layout: google.translate.TranslateElement.InlineLayout.VERTICAL
},
"google_translate_element"
);
}
function googleTranslateElementInit() {
new google.translate.TranslateElement(
{
pageLanguage: "en",
layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL
},
"google_translate_element"
);
}
function googleTranslateElementInit() {
new google.translate.TranslateElement(
{
pageLanguage: "en",
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
},
"google_translate_element"
);
}
If there are sections or pieces of content that you do not want to translate, then you can bypass translation by wrapping that text in an element with class name notranslate
:
<!-- This content will be translated -->
<p>Translate this content.</p>
<!-- This content will not be translated -->
<p class="notranslate">Do not translate this content.</p>
This was a simple walkthrough of the Google Translate API. It's effective, supports many different languages, and is free to use. You can either use it to translate your content in real-time, or even use it to translate different pieces of content that you can then save and server any way you need.
Comments
There are no comments yet. Start the conversation!