mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	re-initialize translator when language is changed in ACP
This commit is contained in:
		
							
								
								
									
										10
									
								
								src/meta.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/meta.js
									
									
									
									
									
								
							| @@ -46,10 +46,18 @@ var fs = require('fs'), | ||||
| 		set: function (field, value, callback) { | ||||
| 			db.setObjectField('config', field, value, function(err, res) { | ||||
| 				if (callback) { | ||||
| 					if(!err && Meta.config) | ||||
| 					if(!err && Meta.config) { | ||||
| 						Meta.config[field] = value; | ||||
| 					} | ||||
|  | ||||
| 					callback(err, res); | ||||
| 				} | ||||
|  | ||||
| 				// this might be a good spot to add a hook | ||||
| 				if (field === 'defaultLang') { | ||||
| 					var translator = require('../public/src/translator'); | ||||
| 					translator.loadServer(); | ||||
| 				} | ||||
| 			}); | ||||
| 		}, | ||||
| 		setOnEmpty: function (field, value, callback) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user