我正在尝试为古巴的一个按钮设置不同的本地化消息(取决于国家)。在xml中,我有
<button caption="msg://contact"
invoke="onContactBtnClick"
width="100%"/>现在我想更改onContactBtnClick-Method中的标题。但是当我将标题设置为" msg://hello“时,我没有得到本地化的Button,而只是得到了msg://hello。
我要怎么设置这个?
Thx
发布于 2016-05-26 18:06:10
如果您希望从窗口控制器获取本地化消息,则必须使用带有message键的getMessage方法。
button.setCaption(getMessage("hello"));您还可以使用消息基础架构接口:
@Inject
private Messages messages;
...
messages.getMessage(YourClass.class, "hello")请参阅此处有关消息的文档:https://doc.cuba-platform.com/manual-6.1/messages.html
https://stackoverflow.com/questions/37446897
复制相似问题