Skip to content

Commit ad2fc9f

Browse files
authored
Update index.js
1 parent 62b911a commit ad2fc9f

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

index.js

+13-18
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use strict';
22

3-
//var mongoose = require('mongoose');
3+
var mongoose = require('mongoose');
44

55
var locales=['en','ru'];
66
var locale='en';
77

8-
var prototype_mongoose=function(mongoose){
8+
var prototype_mongoose=function(){
99
var ma = mongoose.Schema.prototype.add;
1010
var addI18n=function(schema,obj){
1111
var keys = Object.keys(obj);
@@ -77,24 +77,19 @@ var prototype_mongoose=function(mongoose){
7777
};
7878
};
7979

80-
var localize=module.exports = function(mongoose,opt){
81-
if (opt){
82-
if (opt.locales) locales=opt.locales;
83-
if (opt.locale) locale=opt.locale;
84-
}
85-
prototype_mongoose(mongoose);
86-
return {}
87-
}
88-
localize.locale=function(){
80+
prototype_mongoose();
81+
82+
module.exports = {
83+
locale:function(){
8984
return locale;
90-
}
91-
localize.setLocale=function(sLocale){
85+
},
86+
setLocale:function(sLocale){
9287
locale=sLocale;
93-
}
94-
localize.locales=function(){
88+
},
89+
locales:function(){
9590
return locales;
96-
}
97-
localize.setLocales=function(sLocales){
91+
},
92+
setLocales=function(sLocales){
9893
locales=sLocales;
9994
}
100-
95+
}

0 commit comments

Comments
 (0)