diff --git a/modules/default/alert/alert.js b/modules/default/alert/alert.js index 58e5214f64..bff91504e5 100644 --- a/modules/default/alert/alert.js +++ b/modules/default/alert/alert.js @@ -18,7 +18,7 @@ Module.register("alert",{ //Position position: "center", //shown at startup - welcome_message: "Welcome, start was successful!" + welcome_message: true, }, getScripts: function() { return ["classie.js", "modernizr.custom.js", "notificationFx.js"]; @@ -26,6 +26,13 @@ Module.register("alert",{ getStyles: function() { return ["ns-default.css"]; }, + // Define required translations. + getTranslations: function() { + return { + en: "translations/en.json", + de: "translations/de.json" + }; + }, show_notification: function(message) { if (this.config.effect == "slide") {this.config.effect = this.config.effect + "-" + this.config.position;} message = "" + message.title + "
" + message.message + ""; @@ -111,7 +118,12 @@ Module.register("alert",{ this.alerts = {}; this.setPosition(this.config.position); if (this.config.welcome_message) { - this.show_notification({title: "MagicMirror Notification", message: this.config.welcome_message}); + if (this.config.welcome_message == true){ + this.show_notification({title: this.translate("sysTitle"), message: this.translate("welcome")}); + } + else{ + this.show_notification({title: this.translate("sysTitle"), message: this.config.welcome_message}); + } } Log.info("Starting module: " + this.name); } diff --git a/modules/default/alert/translations/de.json b/modules/default/alert/translations/de.json new file mode 100644 index 0000000000..4ab7edbb18 --- /dev/null +++ b/modules/default/alert/translations/de.json @@ -0,0 +1,4 @@ +{ + "sysTitle": "MagicMirror Benachrichtigung", + "welcome": "Willkommen, Start war erfolgreich!" +} diff --git a/modules/default/alert/translations/en.json b/modules/default/alert/translations/en.json new file mode 100644 index 0000000000..a8589a6791 --- /dev/null +++ b/modules/default/alert/translations/en.json @@ -0,0 +1,4 @@ +{ + "sysTitle": "MagicMirror Notification", + "welcome": "Welcome, start was successful!" +}