如何创建多语言JavaDocs? [英] How to create multi-language JavaDocs?

查看:93
本文介绍了如何创建多语言JavaDocs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

普通Java API的JavaDoc有英文版和中文版,但似乎要求每个版本都有单独的源代码。有没有更方便的方法呢?

There is JavaDoc of a normal Java API with an English edition and a Chinese edition, but it seems to require having separate source code for each edition. Is there any more convenient way to do this?

推荐答案

不,基本上没办法做到这一点。

No, there is essentially no way of doing this.

我想到的唯一解决方法适用于生成的HTML页面:您可以在使用CSS在语言之间切换的块元素中包围JavaDoc。考虑:

The only work-around that comes to mind applies to the generated HTML pages: you could surround the JavaDocs in block elements that toggle between languages using CSS. Consider:

/**
 * <div class="en">Documentation in English</div>
 * <div class="nl">Documentatie in Nederlands</div>
 */
public void myFunction() {}

随后编辑CSS JavaDocs以便用户可以切换语言,例如:

Subsequently edit the CSS of the JavaDocs so that the user can switch languages, e.g.:

div.en { display:none; }
div.nl { display:block; }

这篇关于如何创建多语言JavaDocs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆