Created
February 1, 2011 19:13
-
-
Save oravecz/806418 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i18n: function(key) { | |
var args = Array.prototype.slice.call(arguments) || []; | |
args.shift(); | |
var req = require('../actions').app.request; | |
var servlet = req.env.servlet; | |
var servletRequest = req.env.servletRequest; | |
var locale = req.locale || servletRequest.getLocale(); | |
var result = servlet.getMessage(key, args, locale); | |
if (log.isDebugEnabled()) | |
log.debug('Retrieving resource message, key: ' + key | |
+ ', locale: ' + locale + ', value: ' + result); | |
if (!result) { | |
log.warn('No resource message found, key: ' + key + ', locale: ' + locale); | |
} | |
return result; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment