Skip to content
Browse files

Merge branch 'master' of github.com:mozilla/i18n-abide

  • Loading branch information...
2 parents 53013c5 + 38e4874 commit c052f7665dc244997683ba1287ae640e4ea5cd07 @ozten ozten committed Dec 14, 2012
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();

0 comments on commit c052f76

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