
Hi Martin, please follow instructions in [1] for adding new messages to the system. [you should not add the English message to the canDoActionMessages collection - you should add a key from the AppErrors resource - look for other examples in the code that add items to a command's canDoActionMessages field] ---- Thanks, Einav [1] http://www.ovirt.org/Engine_Adding_Messages ----- Original Message -----
From: "Martin Sivak" <msivak@redhat.com> To: "engine-devel" <engine-devel@ovirt.org> Sent: Wednesday, October 16, 2013 11:22:02 AM Subject: [Engine-devel] Localization of canDoAction error messages
Hi,
I am trying to improve the messages the user gets when scheduling fails. But I have found an interesting issue regarding localization. The texts here are simplified, but should demonstrate what I am trying to do.
So here is the flow:
- RunVmCommand's canDoAction fails because there is no host that fits the constraints - For each host I add a message to getReturnValue().getCanDoActionMessages() in the format of "Host XYZ failed constraint ABCD". - I log the same message to the log
I expect the log to contain the strings in english and a localized version to be shown in the error popup that will be displayed by the webadmin.
And the question is.. how do I localize this? I looked at AppErrors and AppMessages, but there is not way of using them from the backend side.
Any ideas?
-- Martin Sivák msivak@redhat.com Red Hat Czech RHEV-M SLA / Brno, CZ
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel