This content has been marked as final.
Show 1 reply
-
1. Re: messages inside javascript functions are not getting translated
shane.bryzak Sep 14, 2010 8:12 AM (in response to josdaniel)You could try assigning the message strings to JavaScript variables instead, and then reference them when you call confirm().
E.g:
var msg_label_assignment_open = "#{messages['label.assignment.open']";
<s:link view="/Assignment" onclick="if (confirm(msg_label_assignment_open)) { var f = $('assignment'); f.method = 'POST'; f.action = f.submit(); } return false;"> <span> <h:outputText value="#{messages['label.assignment.name']}"/> </span> </s:link>
When JSF renders the page it should replace the EL expression with the actual message string. Note that I haven't tested this, so you might have to tweak the code a little bit.