pramod choudhari
pramod choudhari

Reputation: 313

Use bing translator in my website

I recently have come across with a need for some type of "translation"-type that could translate specific text fields or areas to other languages.

I want when user will write texts in **<input type="text" id="texttotranslate"/>** html control and after space the text should get converted to local language i.e. Hindi, Arabic Finnish

I am not sure if something like this even is out there - but I thought this might be a good place to ask. Link 1 I came accorss this links as well but i want it Javascript / ajax solution to get it done

Link 2 I went through this and create my APPID I am getting link 1 working in my C# console application but

i want a javascript solution for the same. ie. when i write a word in the text box it should get converted to local language i set .

Upvotes: 0

Views: 4025

Answers (2)

Laurence Moroney
Laurence Moroney

Reputation: 1263

One option would be to put the Microsoft Translator widget on your site (http://www.microsofttranslator.com/widget). Mark up the fields that you don't want translated using the class="notranslate" tag.

Alternatively, if you want to use the API, I recommend following the tutorials here: http://blogs.msdn.com/b/translation/p/gettingstarted1.aspx

and

http://blogs.msdn.com/b/translation/p/gettingstarted2.aspx

While the second link does it in ASP.NET, instead of JavaScript, it should give you a rough idea for how to do it. At the very least I recommend getting your access token server side, using ASP.NET, PHP or something similar, so your Client ID and Client Secret are not in-the-clear on your site.

Finally, take a look here: http://msdn.microsoft.com/en-us/library/ff512385.aspx, for the MSDN documentation on the AJAX API, including how to access it using JavaScript.

Upvotes: 1

Kiran
Kiran

Reputation: 20293

if you are using Bing translator in your website, then there is no need to write any code in C#. You can use the Bing URL directly to translate the words.

Please refer to the following URL: http://basharkokash.com/post/Bing-Translator-for-developers.aspx

Upvotes: 1

Related Questions