Merge branch 'develop' into feature/add-error-to-callback

# Conflicts:
#	CHANGELOG.md
This commit is contained in:
Felix Wiedenbach
2021-02-13 08:43:23 +01:00
14 changed files with 475 additions and 648 deletions

View File

@@ -443,7 +443,6 @@ var MM = (function () {
* Removes a module instance from the collection.
*
* @param {object} module The module instance to remove from the collection.
*
* @returns {Module[]} Filtered collection of modules.
*/
var exceptModule = function (module) {

View File

@@ -319,14 +319,16 @@ var Module = Class.extend({
const fallbackLanguage = languages[0];
if (languages.length === 0) {
return callback();
callback();
return;
}
const translationFile = translations[language];
const translationsFallbackFile = translations[fallbackLanguage];
if (!translationFile) {
return Translator.load(this, translationsFallbackFile, true, callback);
Translator.load(this, translationsFallbackFile, true, callback);
return;
}
Translator.load(this, translationFile, false, () => {

View File

@@ -14,6 +14,13 @@ const helmet = require("helmet");
const Log = require("./logger.js");
const Utils = require("./utils.js");
/**
* Server
*
* @param {object} config The MM config
* @param {Function} callback Function called when done.
* @class
*/
function Server(config, callback) {
const port = process.env.MM_PORT || config.port;

View File

@@ -107,7 +107,8 @@ var Translator = (function () {
Log.log(`${module.name} - Load translation${isFallback && " fallback"}: ${file}`);
if (this.translationsFallback[module.name]) {
return callback();
callback();
return;
}
loadJSON(module.file(file), (json) => {