Commit 70c8ad0d authored by Curtis Adam's avatar Curtis Adam

Use a single i18n string for the notification message

parent 93f03d5b
......@@ -269,6 +269,9 @@
"help": {
"resetFilter": "Zeige die Hilfe für alle Seiten…"
},
"webPushNotifications": {
"content": "Kartei: __cardsetName__\nKarten: __cardCount__\nFrist: __deadline__"
},
"notifications": {
"title": "Nachrichten",
"clearAll": "Leeren",
......@@ -283,11 +286,7 @@
"reporteduseradmin": "Adminbenachrichtigung (Gemeldete/r Benutzer/in)",
"reportedcardsetadmin": "Adminbenachrichtigung (Gemeldete Kartei)",
"lecturer": "Dozenten-Anfrage",
"heading": "Aufgaben warten!",
"content": "Kartei: ",
"deadline": "\nFrist: ",
"admin": "Du bist angemeldet als Admin!",
"cards": "\nKarten: "
"admin": "Du bist angemeldet als Admin!"
},
"input-group": {
"newcarddeck": "Neue Kartei"
......
......@@ -33,9 +33,9 @@ export class WebNotifier {
deadline = new Date(active.currentDate.getTime() + cardset.daysBeforeReset * 86400000);
}
if (deadline.getTime() > cardset.learningEnd.getTime()) {
return (TAPi18n.__('notifications.deadline', null, Meteor.settings.mail.language) + getDateString(cardset.learningEnd));
return getDateString(cardset.learningEnd);
} else {
return (TAPi18n.__('notifications.deadline', null, Meteor.settings.mail.language) + getDateString(deadline));
return getDateString(deadline);
}
}
}
......@@ -50,7 +50,7 @@ export class WebNotifier {
throw new Meteor.Error("not-authorized");
} else {
let notifier = new Notifications();
let message = TAPi18n.__('notifications.content', null, Meteor.settings.mail.language) + cardset.name + TAPi18n.__('notifications.cards', null, Meteor.settings.mail.language) + notifier.getActiveCardsCount(cardset._id, user_id, testUser) + this.getDeadline(cardset, user_id, testUser);
let message = TAPi18n.__('webPushNotifications.content', {cardsetName: cardset.name, cardCount: notifier.getActiveCardsCount(cardset._id, user_id, testUser), deadline: this.getDeadline(cardset, user_id, testUser)}, Meteor.settings.mail.language);
Meteor.call("sendPushNotificationsToUser", user_id, message);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment