0

So I have a couple of messages in my property file that looks like this:

email.errordetailstemplate.subject=An error occurred in {0}
email.errordetailstemplate.errordetails=--- Error details ---

Going by the recommendations here I can then easily do this:

$messages.getMessage("email.errordetailstemplate.errordetails", null, $locale)

...but what I would love to be able to do is to be able to do substitution of {0} like this:

$messages.getMessage("email.errordetailstemplate.subject", $productname, $locale)

I'm sure it's possible, but I just can't figure out the proper syntax. Can anybody help me out?

Community
  • 1
  • 1
Anders Johansen
  • 10,165
  • 7
  • 35
  • 52

1 Answers1

0

Answer here: http://www.liferay.com/community/forums/-/message_boards/message/5513067

Just using this syntax should work:

$messages.getMessage("email.errordetailstemplate.errordetails", [$productName], $locale)

I say "should" because my need disappeared, and so I haven't had a reason to verify.

Anders Johansen
  • 10,165
  • 7
  • 35
  • 52