Comparing version 0.2.0 to 0.2.1
@@ -125,2 +125,21 @@ var utils = require('./utils'); | ||
prototype.string = function(file, key){ | ||
if(!this.context.getObject("strings", file)){ | ||
var stringsDir = this.context.get("appDir")+"/strings/"+file; | ||
var data = fs.readFileSync(stringsDir); | ||
if(data){ | ||
var object = {}; | ||
var strings = data.toString().split('\n'); | ||
for(var i in strings){ | ||
var string = strings[i]; | ||
var key = string.split('=')[0]; | ||
var val = string.split('=')[1]; | ||
object[key] = val; | ||
} | ||
this.context.setObject("strings", file, object); | ||
} | ||
} | ||
var strings = this.context.getObject("strings", file); | ||
return strings[key]; | ||
} | ||
@@ -127,0 +146,0 @@ prototype.load = function(file, options){ |
{ | ||
"name": "icecream", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "rapid web framework for nodejs", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/nodengine/icecream", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28773
715