mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 17:44:52 -04:00
Make function callbacks and returns more readable
This commit is contained in:
parent
4a11cdc564
commit
221eadcc20
2 changed files with 6 additions and 3 deletions
|
@ -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, () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue