• Post Reply Bookmark Topic Watch Topic
  • New Topic

transliteration of English to Gujarati  RSS feed

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

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.


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........
 
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked the Google Transliteration API, which I have given to you here.

The quick browsing through API give me a thing to ponder:
check: http://code.google.com/apis/ajaxlanguage/documentation/#LowLevelTransliteration

The link suggest the way you can use low level API to write the converted string to wherever you want to write.
 
Deepika Singh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey sagar.. we had tried this too....but the moment transliteration takes place ....the value of previous variable also changes....because after all we are supposed to get value of textbox by using document.getElementById()...

and the moment the value changes in the textbox with that specific Id....the value changes everywhere...
ie, we want to store the values of gujarati as well as English language in two different global variables.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Deepika Singh wrote: ....the value of previous variable also changes....because after all we are supposed to get value of textbox by using document.getElementById()...




Are you "appending" the data or simply over writing the previous one. ?

Here is what I should do:

 
Deepika Singh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey , i have done it.
Thanks for your help...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!