开发者

Generate localized javadoc

I woul开发者_开发知识库d like to know if there was a simple way of generating localized javadoc : I would like to have translated (for example in french) title and keywords instead of "return", "parameter", "class" in the html.


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

I just tried the Chinese one, and it works: it writes 抛出: JSchException instead of Throws: JSchException.

So you would have to translate these to your language (if you don't want one of these).

Some years ago I created an Esperanto translation of those resources for the then-current version (1.2 or such), if you are interested I could dig them out. (But it seems now they are using another format.)


There is the javadoc -locale option, though I'm not sure that it changes keywords like return and class. There is only one, non-localized set of keywords in Java, so I don't think it makes sense to alter those in the JavaDocs anyway.

Specifies the locale that javadoc uses when generating documentation. The argument is the name of the locale, as described in java.util.Locale documentation, such as en_US (English, United States) or en_US_WIN (Windows variant).

Specifying a locale causes javadoc to choose the resource files of that locale for messages (strings in the navigation bar, headings for lists and tables, help file contents, comments in stylesheet.css, and so forth). It also specifies the sorting order for lists sorted alphabetically, and the sentence separator to determine the end of the first sentence. It does not determine the locale of the doc comment text specified in the source files of the documented classes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜