Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #8 from godsflaw/master

Changed resp.local() calls to resp.locals()
  • Loading branch information...
commit 38e4874ac1ebb9923825083ac2c1bc092bd5d2cd 2 parents fa2c6b4 + 18e1351
@ozten ozten authored
Showing with 10 additions and 8 deletions.
  1. +10 −8 lib/i18n.js
View
18 lib/i18n.js
@@ -99,21 +99,23 @@ exports.abide = function (options) {
lang = 'db-LB'; // What? http://www.youtube.com/watch?v=rJLnGjhPT1Q
}
- resp.local('lang', lang);
+ resp.locals('lang', lang);
// BIDI support, which direction does text flow?
lang_dir = BIDI_RTL_LANGS.indexOf(lang) >= 0 ? 'rtl' : 'ltr';
- resp.local('lang_dir', lang_dir);
+ resp.locals('lang_dir', lang_dir);
req.lang = lang;
locale = localeFrom(lang);
- resp.local('locale', locale);
+ resp.locals('locale', locale);
req.locale = locale;
- resp.local('format', format);
+ resp.locals('format', format);
req.format = format;
+ resp.locals('format', format);
+
if (mo_cache[locale].mo_exists) {
if (mo_cache[locale].gt === null) {
mo_cache[locale].gt = new Gettext();
@@ -123,16 +125,16 @@ exports.abide = function (options) {
mo_cache[locale].gt.textdomain(locale);
}
var gt = mo_cache[locale].gt;
- resp.local(options.gettext_alias, gt.gettext.bind(gt));
+ resp.locals(options.gettext_alias, gt.gettext.bind(gt));
req.gettext = gt.gettext.bind(gt);
- resp.local(options.ngettext_alias, gt.ngettext.bind(gt));
+ resp.locals(options.ngettext_alias, gt.ngettext.bind(gt));
req.ngettext = gt.ngettext.bind(gt);
} else {
// en-US in a non gettext environment... fake it
var identity = function (a, b) { return a; };
- resp.local(options.gettext_alias, identity);
+ resp.locals(options.gettext_alias, identity);
req.gettext = identity;
- resp.local(options.ngettext_alias, identity);
+ resp.locals(options.ngettext_alias, identity);
req.ngettext = identity;
}
next();
Please sign in to comment.
Something went wrong with that request. Please try again.