I'm working on a pt_BR project that provides a final user API to extends functionalities.
I need to generate the javadoc of this classes (in Java), but, when using javadoc.exe the static texts, not the content, of the output document is in English.
So, I want to generate the documentation in pt_BR
.
I tried to use like this:
javadoc -locale pt_BR -sourcepath scr -d c:\TEMP
But it didn't work.
Note: Just to be clear, I'm not intent to translate the content (that is already in pt_BR
) but the static texts (the navigation bar, titles, etc).
How can I do that?
We had to do that on a project of ours. This is what we did:
First, we decompiled the following classes from Java's tools.jar
file:
Those two classes act like .properties
files: their only method returns an array of keys-values pairs of strings.
Most of those strings are the ones that appear on the HTML files created by Javadoc, such as the navigation bar, section headers and help page.
After translating the files, we renamed them, adding _pt_BR to their names.
We also changed the name of their classes, also adding _pt_BR.
Finally, we compiled the files and put them into tools.jar
, on their correct packages.
After that, the HTML output from Javadoc was presented in Portuguese.
You will have to find the properties files in your jdk and translate them. I think they are located at tools.jar. I only found the JDK 1.3 Doclet sources on the net. They might give you a hint on the needed property files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With