function loadLocale(name) {
var oldLocale = null,
- aliasedRequire,
- localePath;
+ aliasedRequire;
// TODO: Find a better way to register and load all the locales in Node
if (
locales[name] === undefined &&
try {
oldLocale = globalLocale._abbr;
aliasedRequire = require;
- localePath = (typeof __dirname !== 'undefined' ? __dirname : '.') +
- '/locale/' +
- name;
- aliasedRequire(localePath);
+ aliasedRequire('./locale/' + name);
getSetGlobalLocale(oldLocale);
} catch (e) {
// mark as not found to avoid repeating expensive file require call causing high CPU