How to override a service message?

I use the OOTB service in Moqui, for example, I will say any service from PartyServices.xml, then the displayed message comes from the services themselves, but I want to make a slight modification to the message that is displayed so that I am currently redefining the service in my component only message changes.

So, I wanted to know that I was following best practice? or is there any other way to do the same?

+4
source share
1 answer

You can use automatic internationalization for this. Just add an entry for the LocalizedMessage object with the message from the code as "original", the desired language (maybe "en", even if the original is in English) and the desired message in the "localized" field.

Please note that the “original” must be the actual text coming from the code. If it has the extension of the string $ {}, which should be left as is. In other words, localization is performed before the line is expanded so that the placeholders can move as needed (or even change ...) to handle different languages ​​or to configure messages.

The user interface for adding / editing l10n messages is on the screen Application => Tool => Localization => Messages.

, , "l10n.message" ( = > = > = > ).

+1

All Articles