Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dsame authored Oct 23, 2016
1 parent 62b911a commit ad2fc9f
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

//var mongoose = require('mongoose');
var mongoose = require('mongoose');

var locales=['en','ru'];
var locale='en';

var prototype_mongoose=function(mongoose){
var prototype_mongoose=function(){
var ma = mongoose.Schema.prototype.add;
var addI18n=function(schema,obj){
var keys = Object.keys(obj);
Expand Down Expand Up @@ -77,24 +77,19 @@ var prototype_mongoose=function(mongoose){
};
};

var localize=module.exports = function(mongoose,opt){
if (opt){
if (opt.locales) locales=opt.locales;
if (opt.locale) locale=opt.locale;
}
prototype_mongoose(mongoose);
return {}
}
localize.locale=function(){
prototype_mongoose();

module.exports = {
locale:function(){
return locale;
}
localize.setLocale=function(sLocale){
},
setLocale:function(sLocale){
locale=sLocale;
}
localize.locales=function(){
},
locales:function(){
return locales;
}
localize.setLocales=function(sLocales){
},
setLocales=function(sLocales){
locales=sLocales;
}

}

0 comments on commit ad2fc9f

Please sign in to comment.