Generate localized javadoc

北战南征 提交于 2019-11-28 11:46:25

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!