I have query regarding character limit for Post Call to Google Translator API, it is 5k characters.
Is their any way where i set it unlimited, So that i can translate whole web page at a time.
My website page containing 123504 characters on one page including html. and it can be increase as data entered.
what should i do for this case, when using Google Translator API.
I have searched for this. In one blog i have found following , in which given the solution that..Your text needs to be split into several chunks and translated separately.. Is it a right way??
Can you please suggest me some way for doing this with Google Translator API.
And if no other way instead of this (Your text needs to be split into several chunks and translated separately) then can you please suggest me how i split HTML into chunks and get translated bodies at the same position where it was.
<script type="text/javascript">
$(document).ready(function () {
$(document).on("change", "#ddlTranslateLanguage", function () {
var htmlString = $("html").html();
$.ajax({
type: "POST",
headers: {
"X-HTTP-Method-Override": "GET"
},
data: { q: htmlString, target: "hi", source: "en", fields: "translations", key: "AIzaSyCnqpOsgFssI3wki_KJRmwlAXTWb_UtefA" },
success: function (response) {
$("html").html(response.data.translations[0]["translatedText"])
alert("success");
},
error: function (error) {
alert("error");
}
});
});
});
</script>