Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
key={0}/{1} + {2}/{3}
上述值在资源包中定义,并在用户界面中显示为 HTML 文本。上面演示了添加分数,我想将其格式化为 HTML 格式。是否可以在资源包属性文件本身中执行此操作。如果是这样,我该怎么做?
如果我正确理解您的需求,那么您可以在资源文件中指定格式。例如添加一些 html 标签:
key=<i>{0}/{1}</i> + <b>{2}/{3}</b>
您可以将 html 代码放在资源文件中。如果您使用 MessageFormat,则引号应该加倍。