How to translate from one language to another using java

I want to write a core java program that converts the data from one langualge to another language.for example
English to French,french to German, etc..
for this i have tried with Google Translator API for Java, but this is commertial, i am not able to run my program with out HttpReferrer and Key.
And i downloaded the webtranslator api, but i dont know how to use. So kindly provide the example to use this api.

This test file runs through the various combinations that are supported and fires 'hello world' in various languages at the services used. You can easily test this by altering the english input to something else (line 38).

I did not go through the package in detail, but you should be able to get what you need using this test class as a starting point.

[edit]
I modified the example code to simplify and use just one to/from language:

You stated you did not want to use the Google API. The way your post was phrased indicated that "And i downloaded the webtranslator api" - which to me said that you downloaded a non-Google API. I did a quick search for 'webtranslator api java', and there appear to be quite a few out there. e.g.:

Here is a better GUI based example. I borrowed the tutorial from here as the basis for the GUI.

The download includes a complete source development package ('WebTranslator-all-0.2a.zip'). This can be unzipped and imported as a new project into Eclipse.

I have a single class file and a reference to the main WebTranslator-bin-0.2a.jar file. I made a very basic textarea, language dropdown, button and associated listener. The listener just takes the value in the textarea and submits it with the appropriate to/from languages. The translated result is then placed in the textarea:

You did not mention applet in your original post. The example I provided is for a standard GUI application.

However, it could easily be converted to an applet or a command-line utility. The code I provided simply demonstrates how to use the LIBRARY, and not how to build an application or applet around it.

As I noted above, you need to use the ENTIRE example Eclipse project, NOT just the code I provided. That is just the front-end on top of the translation library. You originally asked this

And i downloaded the webtranslator api, but i dont know how to use. So kindly provide the example to use this api

And that is what I provided. Other posts by yourself suggest you are an experienced java programmer and I am not going to describe the basics of building an applet or how to use Eclipse - there are plenty of resources for that out there.

So:

Did you import the entire sample project ('WebTranslator-all-0.2a.zip')? into Eclipse

If so ,did you successfully run this sample project before using my code?

Did you create a new project and reference the webtranslator JAR? [build path/add external archives/]

Did you add the import statement to actually use the webtranslator package?

I am certainly not a java guru, so the first thing I did when I looked at this was to import the example project into Eclipse and figure out how it worked by running the PROVIDED example code and tracing through what happens. It was only when I had worked out roughly what was going on that I created my own simple project that used the library.