如何提供其他语言的javadoc?
我们经常与西班牙、智利、印度等其他国家开发和维护的服务集成。我一直看到来自西班牙和智利的服务/API 调用都是西班牙语。但我们希望我们的代码是英语,Javadoc 是英语和西班牙语。我正在寻找实现这一目标的最佳方法。
对于这种情况是否有一个共同接受的标准?
以下是西班牙特有的第二姓氏示例。 getLastName() 对于说英语的人来说已经足够清楚了,但这个 API 也向说西班牙语的人公开,因此我添加了一个 Javadoc,如下所示。
/**
* Segundo Apellido
*/
String getSecondLastName();
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();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这个 stacloverflow 问题中讨论了一种可能的情况。可能有帮助。
One possible discussed in this stacloverflow question. May help.
使用
l10ndoclet
从源代码生成带有要翻译的文本的 XML 文件
从源文件和翻译文件生成本地化文档
Use
l10ndoclet
Generate XML files from source code with text to be translated
Generate localized documentation from source files and translation files
本身没有约定,但您需要做的事情可以使用这样的 doclet:
http:// sourceforge.jp/projects/sfnet_l10ndoclet/
Sun过去常常根据需要提供其内部本地化doclet的源代码,但我不会赌它:
http://java.sun.com/j2se/javadoc/faq/index.html#localizationdocletsh
就个人而言,我推荐尽可能用单一语言记录,并根据需要为非母语人士编写大量解释性注释。如果您认为有必要,请对开发人员的外语技能进行投资——迟早会得到回报。
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.