Dev
Dev

Reputation: 360

how to translate language of a control using google api

I download the GoogleTranslateAPI.dll file and added the reference of it to my project. Now i took a textbox and wrote 'John' in it and took a label and want to be written 'John' in it but in 'French' language. So i wrote in the button_click event....

    private void button1_Click(object sender, EventArgs e)
    {
        string TT = Txt1.Text;

        Label1.Text=Google.API.Translate.Translator.Translate(TT, Google.API.Translate.Language.English,Google.API.Translate.Language.French);
    }

This gives an error saying "TRANSLATE FAILED"... Can anyone tell what i did wrong ?? This is a desktop application and will run off line.

Dev..

Upvotes: 1

Views: 4609

Answers (1)

Yahia
Yahia

Reputation: 70369

Google Translate API v2 is the current version and is (since December 1, 2011) only available as a paid service...

Anyway to access the API the way you want to you need to register a key with Google and use that in your code. For some general information see http://code.google.com/intl/en-US/apis/language/translate/v2/getting_started.html

UPDATE - as per comments and after the OP update the question:

The Google API is only usable online - the DLL you downloaded is just a wrapper around the http-based server API.

IF you need to do this offline you will have to buy some commercial package with dictionaries for any language pairs you need and install that locally...

Upvotes: 1

Related Questions