I've been using Yesod's messages system to help keep my language consistent. For example, I have a message named MsgBrand, which gets interpolated into Hamlet files with no problem. However, I am now using a JavaScript library which needs this kind of information.
var tour = Tour.new();
tour.addSteps([
{ element: "#some-id",
title: "Some Title",
content: "_{MsgTourStepFoo}"
}
]);
However, _{MsgTourStepFoo} is appearing in the rendered JavaScript code verbatim. In other words, there is no interpolation. Is this normal or am I missing something?
This is normal. We could have a i18n-variant of Julius, but have avoided it so far simply because it seems like it would be more confusion than it's worth. Instead, you can use getMessageRender to get the message rendering function and then call it from Julius, something like:
Haskell:
messageRender <- getMessageRender
Julius:
content: "#{messageRender MsgTourStepFoo}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With