I'm relatively new with php and sql but I have managed to implement a lot of the mods on this board to get osticket up and running for what we need.
I am currently trying to implement some sort of translation option for my staff that can take the ticket text as input by the client and translate into english.
Recently our support requests in Russian, German, and Hungarian have increased dramatically.
However, we are currently limited on the number translators on staff and while google or bing translate are far from perfect it could help alleviate the work load for them if the english speaking staff could get the rough idea of what the client is reporting.
I tried adding the google AJAX Language API & translate this both in viewticket.inc.php
I can't get either one to work. The translate this and the bing translate I could get to load the language the selection drop down menu but not actually translate the test russian ticket I created.
If anyone has any tips or could point me in the right direction I would greatly appreciate it.
Here is what the google code looked like
<script type="text/javascript"
src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
// Initialize version 1.0 of Google AJAX API
google.load("language", "1");
function translate(lang) {
var source = document.getElementById("ticketthread").innerHTML;
var len = content.length;
// Google Language API accepts 500 characters per request
var words = 500;
// This is for English pages, you can change the
// sourcelang variable for other languages
var sourcelang = "ru";
document.getElementById("translation").innerHTML = "";
for(i=0; i<=(len/words); i++) {
google.language.translate (source.substr(i*words, words),
"en", lang, function (result) {
if (!result.error) {
document.getElementById("translation").innerHTML
= document.getElementById("translation").innerHTML
+ result.translation;
} }); }
// Hide the text written in the original language
document.getElementById("ticketthread").style.display = 'none';
return false;
}
// Switch to the original language
function original() {
document.getElementById("translation").style.display='none';
document.getElementById("ticketthread").style.display = 'block';
return false;
}
</script>