File tree Expand file tree Collapse file tree 1 file changed +13
-18
lines changed
Expand file tree Collapse file tree 1 file changed +13
-18
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22
3- // var mongoose = require('mongoose');
3+ var mongoose = require ( 'mongoose' ) ;
44
55var locales = [ 'en' , 'ru' ] ;
66var 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+ }
You can’t perform that action at this time.
0 commit comments