java中资源包中的上标文本
有人在资源包中包含上标文本吗?任何有关此事的建议将不胜感激!
即:编程panda
谢谢, 熊猫
has anyone included superscripted text in a resource bundle? any advice on this matter would be appreciated!
ie: programmingpanda
thanks,
panda
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
取决于您对“文本”的概念。 Java 字符串包含 unicode 字符,而 Unicode 没有上标文本的概念,因此您需要根据上下文进行某种解释。
常见的上下文是 HTML,并且“
programmingpanda
”是您可以在资源包中拥有的完全有效的文本字符串。请注意,有多种方法可以提供查找键的值,一种是属性文件,另一种是代码。都有优点和缺点。我建议您查看 Sun Java 教程中的相应章节: http://java.sun.com/docs/books/tutorial/i18n/resbundle/index.html
Depends on your notion of "text". A Java string contains unicode characters and Unicode does not have a notion of superscripted text, so you will need some kind of interpretation depending on context.
A frequent context is HTML, and there "
programming<sup>panda</sup>
" is a perfectly valid text string you can have in a resource bundle. Please note that there are several ways to provide the value for the lookup key, one is a property file and another one is code. All have advantages and disadvantages.I recommend you look at the appropriate chapter in the Sun Java Tutorial: http://java.sun.com/docs/books/tutorial/i18n/resbundle/index.html
资源包是纯文本的。因此,即使您要包含演示文稿详细信息,这也取决于它将在哪里显示。
例如,如果它显示在html页面上,您可以使用:
如果它将有多个演示文稿,那么您可以定义自定义演示方案并根据演示类型解析它。例如:
Resource bundles are plain-text. So even if you are to include presentation details, it will depend on where is it going to be displayed.
For example, if it is displayed on html page, you can use:
If it is going to have multiple presentations, then you may define your custom presentation scheme and to parse it according to the presentation type. For example: