Update error to use translatable text

This commit is contained in:
rejas
2021-03-16 19:16:07 +01:00
parent a269b5cd93
commit e4f671c898
6 changed files with 7 additions and 5 deletions

View File

@@ -90,7 +90,7 @@ Module.register("newsfeed", {
this.loaded = true;
this.error = null;
} else if (notification === "INCORRECT_URL") {
this.error = "Newsfeed Error. Incorrect url: " + payload.url;
this.error = `Incorrect url: ${payload.url}`;
this.scheduleUpdateInterval();
}
},

View File

@@ -23,7 +23,7 @@
</div>
{% elseif error %}
<div class="small dimmed">
{{ error }}
{{ "MODULE_CONFIG_ERROR" | translate({MODULE_NAME: "Newsfeed", ERROR: error}) | safe }}
</div>
{% else %}
<div class="small dimmed">

View File

@@ -38,7 +38,7 @@ module.exports = NodeHelper.create({
try {
new URL(url);
} catch (error) {
this.sendSocketNotification("INCORRECT_URL", { url });
this.sendSocketNotification("INCORRECT_URL", { url: url });
return;
}