File tree 1 file changed +13
-18
lines changed
1 file changed +13
-18
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- // var mongoose = require('mongoose');
3
+ var mongoose = require ( 'mongoose' ) ;
4
4
5
5
var locales = [ 'en' , 'ru' ] ;
6
6
var locale = 'en' ;
7
7
8
- var prototype_mongoose = function ( mongoose ) {
8
+ var prototype_mongoose = function ( ) {
9
9
var ma = mongoose . Schema . prototype . add ;
10
10
var addI18n = function ( schema , obj ) {
11
11
var keys = Object . keys ( obj ) ;
@@ -77,24 +77,19 @@ var prototype_mongoose=function(mongoose){
77
77
} ;
78
78
} ;
79
79
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 ( ) {
89
84
return locale ;
90
- }
91
- localize . setLocale = function ( sLocale ) {
85
+ } ,
86
+ setLocale : function ( sLocale ) {
92
87
locale = sLocale ;
93
- }
94
- localize . locales = function ( ) {
88
+ } ,
89
+ locales : function ( ) {
95
90
return locales ;
96
- }
97
- localize . setLocales = function ( sLocales ) {
91
+ } ,
92
+ setLocales = function ( sLocales ) {
98
93
locales = sLocales ;
99
94
}
100
-
95
+ }
You can’t perform that action at this time.
0 commit comments