How to provide the javadoc in other languages? [duplicate]

爷,独闯天下 提交于 2019-12-23 03:46:35

问题


We frequently integrate with services developed and maintained in other countries like Spain, Chile, India etc. I see consitently that the services/API calls from Spain and Chile are in Spanish. But we want our code to be English and Javadoc to be both in English and Spanish. I am seeking the best way to achieve this.

Is there a common accepted standard for this kind of scenario?

Below is the example of second last name that is specific to Spain. getLastName() is clear enough for English speaking people but this API is also exposed to Spanish speaking people and hence I added a Javadoc as you see below.

     /**
     * Segundo Apellido
     */
    String getSecondLastName();

回答1:


One possible discussed in this stacloverflow question. May help.




回答2:


Use l10ndoclet

  • Generate XML files from source code with text to be translated

  • Generate localized documentation from source files and translation files




回答3:


There is no convention per se, but what you need to do is possible using a doclet like this:

http://sourceforge.jp/projects/sfnet_l10ndoclet/

Sun used to provide the source for its internal localization doclets on demand, but I wouldn't bet the house on it:

http://java.sun.com/j2se/javadoc/faq/index.html#localizationdocletsh

Personally, I recommend to document in a single language whenever possible, and write extensive explanatory notes for non-native speakers as necessary. Invest in the foreign-language skills of your developers if you feel it is necessary -- it will pay off sooner or later.



来源:https://stackoverflow.com/questions/3389459/how-to-provide-the-javadoc-in-other-languages

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