Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
templating-support-1.0.0
Description
It appears that the templating-support-thymeleaf library doesn't properly handle message parameters.
Say we have a resource bundle message
orderConfirmationMessage = Your order {0} is in the works. We sent an email to {1} with your order confirmation.
and the fragment
<div data-th-fragment="order-confirmation-message(order)"> <div data-th-if="${order}"> <hst:setBundle hst:basename="common-orders"/> <p data-th-text="#{orderConfirmationMessage(${order.orderNumber},${order.customerEmail})}"/> </div> </div>
, then the output in the HTML document is
Your order {0} is in the works. We sent an email to {1} with your order confirmation.
This indicates that the order variable exists and that the common-orders resource bundle was properly loaded, but that the message parameters weren't included.
After some debugging it turned out that Thymeleaf does correctly translate the message parameters, but that the placeholders are never replaced. The org.onehippo.forge.templating.support.thymeleaf.servlet.resolvers.HstMessageResolver does take the correct message parameters (i.e. the messageParameters array contains the values {"12345678","email@example.com}, but it doesn't do anything with them.