Create localized javadoc

I would like to know if there was an easy way to generate a localized javadoc: I would like to translate (for example, into French) the heading and keywords instead of "return", "parameter", "class" in html.

+2
source share
2 answers

As Matt Ball said, you can provide the -locale option for javadoc to affect some things. The problem is that tools.jar contains only English by default and additionally one Japanese ( ja ) and one Chinese ( cn_ZH ) translation.

I just tried Chinese and it works: it writes ζŠ›ε‡Ί: JSchException instead of Throws: JSchException .

Thus, you will have to translate them into your language (if you do not want one of them).

A few years ago I created an Esperanto translation of these resources for the current version (1.2 or such), if you are interested, I could dig them out. (But now it seems that they are using a different format.)

+2
source

There is a javadoc -locale option, although I'm not sure if it changes keywords such as return and class . There is only one non-localized set of keywords in Java, so I don’t think it makes sense to modify the ones in JavaDocs.

Defines the language used by javadoc when creating documentation. The argument is the locale name, as described in the java.util.Locale documentation, for example, en_US (English, United States) or en_US_WIN (Windows version).

Specifying a locale causes javadoc to select the resource files of this language for messages (lines in the navigation bar, headers of lists and tables, contents of the help file, comments in stylesheet.css, etc.). It also determines the sort order of lists sorted alphabetically, and the separator of sentences to determine the end of the first sentence. It does not define the locale for the doc comment text specified in the source files of the documented classes.

+3
source

Source: https://habr.com/ru/post/955270/


All Articles