0

Hi,

i have two input box

input box 1 : name is first

input box 2 : name is second

suppose if i enter "fresh" should be transliterated using google and the output in french should be displayed in the second input box.

does anyone have any idea how to do this???

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by 360anish
0

If you are going to use google, you need their API (javascript library). Not sure if they have this library available.

0

thanks for replying.


the google API is available...

the transliteration library actually does not support French so we can use Greek language

please check the code below

<html>
<head>
<title> Transliteration Help </title>
<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("second");

	var options = {
		sourceLanguage:
		google.elements.transliteration.LanguageCode.ENGLISH,
		destinationLanguage:
		[google.elements.transliteration.LanguageCode.GREEK],
		shortcutKey: 'ctrl+g',
		transliterationEnabled: true
	};

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

	}

	google.setOnLoadCallback(OnLoad);

</script> 

<script type="text/javascript">
function tcall()
	{
		document.getElementById('second').value = document.getElementById('first').value;
	}
	
	
</script>

</head>
<body>
<br>
Translietration test.
<br><br><center>


	<form name="trans">First Box
		<input size="40" type="text" id="first" name="first" onkeydown="javascript: tcall();" onkeyup="javascript: tcall();"  />

		<br /><br />Second Box
		<input size="40" type="text" id="second" name="second"  />

	</form>

<br /><br />transliterated text should be there in the second box.

</body>
</html>

i hope this may help proceed further.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.