[Engine-devel] Localization of canDoAction error messages

Einav Cohen ecohen at redhat.com
Wed Oct 16 15:27:11 UTC 2013


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 at redhat.com>
> To: "engine-devel" <engine-devel at 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 at redhat.com
> Red Hat Czech
> RHEV-M SLA / Brno, CZ
> 
> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
> 
> 
>



More information about the Devel mailing list