Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update comments in `i18n.js`.

  • Loading branch information...
commit 91da188a1d7e0f3ac00ab539717796d507207544 1 parent 1f211a0
authored April 27, 2011

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  lib/i18n.js
3  lib/i18n.js
@@ -6,7 +6,7 @@ var path = require('path'), I18n = module.exports = function I18n(path, language
6 6
 // The current version of `node-i18n`. Keep in sync with `package.json`.
7 7
 I18n.VERSION = '0.2';
8 8
 
9  
-// Default template settings; used in `I18n#t`.
  9
+// Default template settings; used in `I18n#interpolate`.
10 10
 I18n.templateSettings = {
11 11
   'evaluate': /<%([\s\S]+?)%>/g,
12 12
   'interpolate': /<%=([\s\S]+?)%>/g
@@ -42,6 +42,7 @@ I18n.prototype.interpolate = function interpolate(item, context) {
42 42
 
43 43
   if (typeof context == 'object') {
44 44
     settings = I18n.templateSettings;
  45
+    // JavaScript micro-templating implementation; taken from Underscore.
45 46
     return Function('obj', 'var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push(\'' +
46 47
       result.replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(settings.interpolate, function(match, code) {
47 48
            return "'," + code.replace(/\\'/g, "'") + ",'";

0 notes on commit 91da188

Please sign in to comment.
Something went wrong with that request. Please try again.