Skip to content

Commit

Permalink
Merge pull request #5269 from vdmtrv:fix/locale-require
Browse files Browse the repository at this point in the history
[bugfix] Use __dirname for locale import if available
  • Loading branch information
ichernev committed Apr 24, 2020
2 parents 0d0eabd + e5105e4 commit a207d78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/locale/locales.js
Expand Up @@ -52,7 +52,7 @@ function loadLocale(name) {
try {
oldLocale = globalLocale._abbr;
var aliasedRequire = require;
aliasedRequire('./locale/' + name);
aliasedRequire((typeof __dirname !== undefined ? __dirname : '.') + '/locale/' + name);
getSetGlobalLocale(oldLocale);
} catch (e) {
// mark as not found to avoid repeating expensive file require call causing high CPU
Expand Down

0 comments on commit a207d78

Please sign in to comment.