Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make locales module optional #3

Merged
merged 1 commit into from

2 participants

@guileen

If we do not include locales module, jst can simply return string itself.

@shaunlee shaunlee merged commit 25200d2 into shaunlee:master
@shaunlee
Owner

I'll add locales as of dependencies, and thus it will be installed at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 3, 2011
  1. @guileen

    make locales optional

    guileen authored
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 2 deletions.
  1. +12 −2 lib/jst.js
View
14 lib/jst.js
@@ -5,9 +5,19 @@
*/
var fs = require('fs'),
- locales = require('locales'),
filters = require('./filters'),
- hash = require('./hash');
+ hash = require('./hash'),
+ locales;
+
+try {
+ locales = requires('locales');
+} catch(e) {
+ locales = {
+ configure: function(){},
+ gettext : function(s) { return s },
+ ngettext : function(s) { return s}
+ }
+}
exports.version = '0.0.10';
Something went wrong with that request. Please try again.