PDA

View Full Version : Transliterate from English to French



360anish
11-04-2010, 06:08 PM
Hi,

i have two input box

input box 1 : name is first

input box 2 : name is second

suppose if i enter "family" 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???

jscheuer1
11-04-2010, 07:25 PM
Are you sure you don't mean translate? The pronunciation and characters are so similar. What you are asking is to spell English words phonetically in French, so as that a native French speaker would be using the correct English pronunciation.

If you do mean transliterate you will need a Google Transliterate API Key, see:

http://code.google.com/apis/language/transliterate/v1/getting_started.html#getting_started

if you don't already have one.

The closest example on the Google Transliterate API pages to what you want appears to be:

http://code.google.com/apis/language/transliterate/v1/getting_started.html#Single

Once you insert you key into the call for


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

you should be able to simply change the 'hi' to 'fr' and then switch the 'fr' and the 'en'. This assumes they are supported.

You can always use the:


google.elements.transliteration.LanguageCode.ENGLISH

google.elements.transliteration.LanguageCode.FRENCH

But I think it still will depend upon whether these are supported or not. English apparently is. I'm not sure about French.