Skip to content

Instantly share code, notes, and snippets.

@shunjikonishi
Created May 1, 2013 04:52
Show Gist options
  • Save shunjikonishi/5493795 to your computer and use it in GitHub Desktop.
Save shunjikonishi/5493795 to your computer and use it in GitHub Desktop.
Template of messages.js (Playframework 1)
if (typeof(flect) == "undefined") flect = {};
if (typeof(flect.app) == "undefined") flect.app = {};
if (typeof(flect.app.XXXX) == "undefined") flect.app.XXXX = {};
flect.app.XXXX.MSG = {
#{list items:map.entrySet(), as:'entry' }
"${entry.getKey()}" : "${entry.getValue()}",#{/list}
"format" : function(fmt) {
for (i = 1; i < arguments.length; i++) {
var reg = new RegExp("\\{" + (i - 1) + "\\}", "g")
fmt = fmt.replace(reg,arguments[i]);
}
return fmt;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment