Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / August 2006

Tip: Looking for answers? Try searching our database.

Java source code translation/obfuscation into another language

Thread view: 
prepsuku@gmail.com - 01 Aug 2006 10:44 GMT
Hi,

We have a requirement where in we wanted to translate the Java code
developed in english to antoher language (not the computer language,
but the language which we talk).

For eg,  The coding will happen in english and we wanted to change the
method name, class name and attribute names to Spanish language.  Is
there any tool which will help us do this.

I can see some tools like JODE which has capability to read from the
translation table for replacement.  But only issue is that it works
with the bytecode and not the source code.

Any help or pointers for this?

Thanks,
Sukumar
Thomas Weidenfeller - 01 Aug 2006 11:00 GMT
> We have a requirement where in we wanted to translate the Java code
> developed in english to antoher language (not the computer language,
[quoted text clipped - 9 lines]
>
> Any help or pointers for this?

It sounds as if you want what is in general called "localization" and
"internationalization". Typically abbreviated as "l10n" and "i18n", or
sometimes "intl"

a) See http://java.sun.com/j2se/1.5.0/docs/guide/intl/index.html for
information of how to code it in Java in general.

b) See also the API documentation of resource bundles.

c) To help you build such bundles, IDEs like Netbeans have build in
tools. The process is called "string externalization" or similar. I am
sure the Eclipse IDE has something similar, tool. Check your IDE
documentation.

If you don't use an IDE, but a powerful platform like Unix, the Unix
text processing tools are your friend for 99% of the extraction tasks at
hand. The rest is manual labor.

d) Hire experienced (experienced in l10n, computers and the application
domain) translators which are native(!) speakers of the language to
which you want to translate (e.g. Spanish). The guy from next door who
happened to have had one holiday in the country is not good enough.

/Thomas
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

Ingo R. Homann - 01 Aug 2006 11:08 GMT
Hi,

> We have a requirement where in we wanted to translate the Java code
> developed in english to antoher language (not the computer language,
[quoted text clipped - 3 lines]
> method name, class name and attribute names to Spanish language.  Is
> there any tool which will help us do this.

I think this must be done (semi-)manually. E.g. when I would want to
translate a "toArray" into German, I would name it "alsArray" or
"alsFeld" (or perhaps I would not translate it at all, because English
is *the* computer-language). An automatic translator-program would
perhaps translate it as "zuAnordnung" or "fürAufstellung" (which could
be re-translated as "forAdjustment" or "intoAsking") which do not make
any sense at all.

So, use an IDE (e.g. Eclipse) which helps you to automatically *replace*
the method-name and the method-calls but for heavens sake to not never
ever try to automatically *translate* the names!

Ciao,
Ingo
Oliver Wong - 01 Aug 2006 14:58 GMT
> Hi,
>
[quoted text clipped - 17 lines]
> the method-name and the method-calls but for heavens sake to not never
> ever try to automatically *translate* the names!

   If it's a really huge code base, it may be worth learning the Eclipse
API and writing your own plugin. You could design the plugin so that it
would show you a list of all method names in your entire project. Print this
out and give it to your translator, and then type in a translation for every
term, to have the plugin do the conversion all in one go.

   - Oliver
steve - 01 Aug 2006 22:00 GMT
> Hi,
>
[quoted text clipped - 14 lines]
> Thanks,
> Sukumar

it sounds like a lot of work that will serve no significant purpose,
ultimately   rightly or wrongly, java is written in English.

Steve
Oliver Wong - 02 Aug 2006 15:05 GMT
>> Hi,
>>
[quoted text clipped - 4 lines]
>> For eg,  The coding will happen in english and we wanted to change the
>> method name, class name and attribute names to Spanish language.
[...]

> it sounds like a lot of work that will serve no significant purpose,
> ultimately   rightly or wrongly, java is written in English.

   The purpose is, of course, to earn paychecks. If the clients list this
as a requirement, then you haven't got much choice about it.

   That said, it's not unusual to see source code in which all the
identifier names (e.g. methods, classes, local variables, etc.) are written
in a language other than English. If that language is better understood by
the development team as a whole than English, using that language will
result in easier to understand code for that team.

   - Oliver
Patricia Shanahan - 06 Aug 2006 16:43 GMT
>> Hi,
>>
[quoted text clipped - 19 lines]
>
> Steve

Some programmers have very specialized knowledge of English. They know
technical terms, but not everyday terms. I've had lunch with people who
had no trouble discussing a programming problem in English, but did not
know enough English words about food to help me with a menu written in
their primary language.

Someone like that might know all the Java keywords, and be able to read
the API documentation, but have trouble with application identifiers and
comments that related to the problem domain.

Patricia


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.