You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by "Anthony Carlucci (Commented) (JIRA)" <ji...@apache.org> on 2012/01/13 23:00:40 UTC
[jira] [Commented] (RAVE-299) Create mechanism for using message
bundle text inside javascript code
[ https://issues.apache.org/jira/browse/RAVE-299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13185897#comment-13185897 ]
Anthony Carlucci commented on RAVE-299:
---------------------------------------
We now have internationalization support in our javascript code for messages that need to be displayed via javascript. Simply:
1) Add messages to the java messages.properties files with keys that start with "_rave_client." (see bottom of file)
2) Ensure your JSP page is loading the rave_client_messages.js controller path:
<script src="<spring:url value="/app/messagebundle/rave_client_messages.js"/>"></script>
3) Access the text on the client side by using: rave.getClientMessage(key) ie: rave.getClientMessage
("_rave_client.api.error")
Dutch translations courtesy of Google Translate...
Still TODO: improve performance by caching the javascript response content per locale in the controller rather than generating it with every request
> Create mechanism for using message bundle text inside javascript code
> ---------------------------------------------------------------------
>
> Key: RAVE-299
> URL: https://issues.apache.org/jira/browse/RAVE-299
> Project: Rave
> Issue Type: Improvement
> Affects Versions: 0.5-INCUBATING
> Reporter: Anthony Carlucci
> Assignee: Anthony Carlucci
> Priority: Minor
>
> Come up with a common way for using java message bundle text inside our javascript code. A good example is a javascript alert or confirmation dialog box that we currently have to hard-code the text for inside the javascript code.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira