You are on page 1of 2

Do you speak both French and Portuguese?

What are you working on?

I was trying to get back to work after the little distraction from my boss. He had just walked
into the office and was doing the customary checking up on everyone ensuring we were up to
steam and working on productive tasks. Face down at my desk, my attention was drawn again
by the response of my colleagues; she had just said something like she was working on
translating some resource bundle files into Portuguese and French. Now that interested me.
After, a little probing and investigation I found out that she didn’t speak any of these
languages but rather used online language tools to do these translations manually. This was a
really long and monotonous process (at least from the eyes of a programmer), as it required
doing a text by text translation. Definitely, this wouldn’t top the list of anybody’s favourite
kind of task.

The Deal

So I thought, I could make the process of converting and creating resource bundles easier. I
already knew online translators exposed some sort of APIs in form of web services for
programmers to consume. I had already worked with Google Translate in the past while
learning SOAP web services reading tutorial from some Netbeans Blog. Thus, I told my
colleague I can write a utility in my free time that would make the translation much faster and
easier but once am done you would get cans of O.H. Deal or No Deal?

Little Set-Back – Google Translator 

After, some lookup and API study I discovered that google didn’t allow for bulk translation
hence this would mean I do one translation per web service request. Now that wasn’t the kind
of “bulk” translation I was thinking of. It would simply mean I was still doing the translation
the traditional way only difference is that it is the computer that would be doing the “one-by-
one” word lookup. Another reason against using Google translator was that they frowned at
computer generated Translation request.

Thumbs down Google (N)

M$ to the Rescue – Once there is a will there is a code. 

Just when I was beginning to give up on getting some free beer, I found out that Microsoft
Translator did provide both a Web Service API and also allowed for bulk machine generated
Translator requests. So I just spent yesterday afternoon writing a simple utility that would
allow for the bulk translations. Thanks to Microsoft and Netbeans IDE Web Service
generation tool for making this easier.

Output /Conclusions

Now we have a command utility that allows us to easily generate resource bundles in
supported languages by just running this from command line.

java -jar Internationalize.jar language.properties en language.properties_pt pt


This would convert a resource bundle file language.properties in English Language to a
resource bundle file language.properties_pt in Portuguese. en, pt – English & Portugese
Locale respectively.

Finally

I hope to write some more technical stuff at the development forum about the whole
development process to document the process for the more technically inclined readers.

Nice Links

1. Google Translate Site – http://translate.google.com/


2. Google Translate API/Tools Page-
http://code.google.com/apis/language/translate/overview.html
3. Microsoft Translation – http://www.microsofttranslator.com/tools/
4. Microsoft Translation API/Tools - http://www.microsofttranslator.com/tools/
5. Netbeans Web Service Tutorial - http://netbeans.org/kb/67/websvc/zembly-wag.html

You might also like