• Post Reply Bookmark Topic Watch Topic
  • New Topic

english to gujarati translator

 
Deepika Singh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody help me to find a code for english to gujarati translator that translates english to gujarati on some event
I have searched a lot but I didnt get it anywhere.Actually I want an accurate one..i.e it must give exact translation of the word entered.


Can anyone guide me for that.

Please its urgent

Thanks..
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
 
Deepika Singh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for your solution......
actually , we have already seen this and tried to implement but the problem is translitrated text comes in the same text area on pressing ENTER key. we want the translitrated text in a different text box, so that we can use both the original text as well as the translitrated text in a query fired just after this function call.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then, while writing AJAX response, write it in the different text area.

}
 
Deepika Singh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi.....

actually my code that i had implemented for the translator is...

<input type="text" id="firstName" name="firstName" default="${firstName}" />

<script type="text/javascript" src="http://www.google.com/jsapi">
</script>

<script type="text/javascript">
google.load("elements", "1", {packages: "transliteration"});
</script>

<script>
function OnLoad() {
var currValue = document.getElementById("firstName");
alert(document.getElementById("firstName").value);
var options = {
sourceLanguage:
google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage:
[google.elements.transliteration.LanguageCode.GUJARATI],
shortcutKey: 'ctrl+g',
transliterationEnabled: true
};


var control = new google.elements.transliteration.TransliterationControl(options);
control.makeTransliteratable(["firstName"]);
var postValue = document.getElementById("firstName");

}

google.setOnLoadCallback(OnLoad);

</script>

....................................................................................................................................................................................


here, firstName is the name of the text box.
in this textbox only the code is getting converted.I want it to convert it in the other textbox.
Thanks a lot for your response.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, this is something out of my knowledge. You have to find out the working of Google transliteration code, consult the transliteration code home page.
And please PM any moderator to move this thread to "HTML-JavaScript" section, there we can get more input.

and please: http://faq.javaranch.com/java/UseCodeTags

Find out the docs for "TransliterationControl" class, it may have some field to set which redirect out put to different texarea,
 
Deepika Singh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, actually the code that I have pasted is from the google translator only.

I am really very much thankful for your response.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Pleasure and the above AJAX approach I mentioned should work for you
 
Deepika Singh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But actually the link that you had suggested does not exists..


http://www.google.com/transliter/indic?lang=GJ&text=abc
 
Deepika Singh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to write only this much code for the translation

function translit()
{
callAjax(http://www.google.com/transliter/indic?lang=GJ&text=abc);

ajax.callback = processResponse;
}

function processResponse()
{
var resText = ajax.response;
document.getElementById('text-area').append(resText);
}
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That thing never gonna work, because thats a approach I suggested, its not a code.

Between, have look at this Google Ajax transliteration library page,
http://code.google.com/apis/ajaxlanguage/documentation/#Transliteration
thats get you started.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!