Skip to content

Commit

Permalink
allow different signature on translate helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Denis committed Oct 15, 2012
1 parent dfa2956 commit 8ea070b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/node-i18n.js
Expand Up @@ -73,7 +73,6 @@ module.exports = function (options) {
res.locals[self.options['helper_translate']] = self.translateHelper(locale)
res.locals[self.options['helper_path']] = self.pathHelper(locale)
res.locals[self.options['helper_locale']] = locale

next()
}

Expand All @@ -90,6 +89,13 @@ module.exports = function (options) {

this.translate = function(locale, key, variables){

var locale = locale
var variables = variables
if(typeof(variables) === 'string') {
locale = variables
variables = {}
}

word = this.words[locale]

if(!word){
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -3,7 +3,7 @@
"description": "i18n for node with expressJS",
"main": "./index",
"author": "Larafale & silently",
"version": "0.0.15",
"version": "0.0.16",
"repository": {
"type": "git",
"url": "http://github.com/larafale/node-i18n.git"
Expand Down

0 comments on commit 8ea070b

Please sign in to comment.