Permalink
Browse files

locale was outta scope

  • Loading branch information...
1 parent b46778f commit 3438b95d7a9e4fcfbda7395023752707bd80c112 @larafale committed Oct 29, 2012
Showing with 4 additions and 4 deletions.
  1. +3 −3 lib/node-i18n.js
  2. +1 −1 package.json
View
6 lib/node-i18n.js
@@ -59,9 +59,9 @@ module.exports = function (options) {
this.pathHelper = function(locale){
return function(path, forcedLocale) {
- var locale = forcedLocale || locale
- , reg = new RegExp("^\/("+self.options.enabled.join("|")+")\/?.*$")
-
+ locale = forcedLocale || locale || self.options.default
+ var reg = new RegExp("^\/("+self.options.enabled.join("|")+")\/?.*$")
+
if(reg.test(path)) path = path.substring(3)
return (locale === self.options.default) ? path : '/' + locale + path
}
View
2 package.json
@@ -5,7 +5,7 @@
"author": {
"name": "Larafale & silently"
},
- "version": "0.0.18",
+ "version": "0.0.19",
"repository": {
"type": "git",
"url": "http://github.com/larafale/node-i18n.git"

0 comments on commit 3438b95

Please sign in to comment.