Commit 045dc0f7 authored by Dennis Schönhof's avatar Dennis Schönhof

Change Newsletter language to german

parent 15de3742
......@@ -785,21 +785,29 @@
"subjectSingular3": " ist.\n\n",
"subjectPlural3": " sind.\n\n",
"subjectCardset": "aus dem Kartensatz ",
"subjectEnd": " gelernt werden müssen.",
"subjectEnd": " zu lernen.",
"textEnd": " zu lernen sind.",
"newCards2Singular": " Karte erwartet dich in dem Kartensatz ",
"newCards2Plural": " Karten erwarten dich in dem Kartensatz ",
"textIntro": "Hallo ",
"textIntro1": ",\n\n es wird mal wieder Zeit, einen Blick in deine Lernkarten zu werfen!\n\n",
"textDate1": "Du hast noch bis zum ",
"textDate2": "Zeit, um die derzeitig aktiven Karten zu bearbeiten, ansonsten wird dein gesamter Lernfortschritt zurückgesetzt!",
"textDate2": " Zeit, um die derzeitig aktiven Karten zu bearbeiten, ansonsten wird dein gesamter Lernfortschritt zurückgesetzt!",
"newCards1": "Nach einer Prüfung deiner aktuellen Lernphase konnte festgestellt werden, dass ",
"newCards2Singular": " Karte aus dem Kartensatz ",
"newCards2Plural": " Karten aus dem Kartensatz ",
"mailCard" : "Der Kartensatz ",
"mailCard1" : "benötigt deine Aufmerksamkeit!\n\n",
"mailCard1" : " benötigt deine Aufmerksamkeit!\n\n",
"greetings": "\n\nIhr THMCards-Team",
"subjectEnding": "endet die Lernphase des Kartensatzes ",
"textIntroEnding": "Sehr geehrter Teilnehmer,\n\n",
"textEnding": "Heute endet die Lernphase des Kartensatzes ",
"subjectReset": "THMcards: Ihr Lernfortschritt hat sich zurückgesetzt für den Kartensatz ",
"textReset": "durch inaktivität wurde dein Lernfortschritt zurückgesetzt. "
"textReset": "durch inaktivität wurde dein Lernfortschritt zurückgesetzt. ",
"newCards1": "Nach dem Überprüfen deiner aktuellen Lernphasen haben wir festgestellt, dass ",
"service": "Dieser Newsletter ist ein Service von THMcards. Du erhälst diese Mail, weil du dich angemeldet hast, von ",
"unsubscribe": "Nicht mehr interessiert? Beende die aktuelle Lernphase, um diesen Newsletter zu deabonnieren.",
"copyright": "© 2017 THMcards",
"my-cardset": "Mein Kartensatz"
}
}
......@@ -787,6 +787,7 @@
"subjectPlural2": " cards ",
"subjectCardset": "of the cardset ",
"subjectEnd": " for learning.",
"textEnd": " for learning.",
"newCards2Singular": " card awaits you in the cardset ",
"newCards2Plural": " cards await you in the cardset ",
"greetings": "\n\nyour THMCards-Team",
......@@ -806,6 +807,7 @@
"subjectPlural3": " are.\n\n",
"service": "This newsletter is a Service from THMcards. You are receiving this email, because you signed up at ",
"unsubscribe": "Not interested anymore? To unsubscribe stop the current learning phase.",
"copyright": "© 2017 THMcards"
"copyright": "© 2017 THMcards",
"my-cardset": "My Cardset"
}
}
......@@ -65,7 +65,7 @@
<tbody>
<tr>
<td>
<a href="{{url}}/cardset/{{id}}" style="color: #ffffff; font-size: 16px; text-decoration: none">My Cardset</a>
<a href="{{url}}/cardset/{{id}}" style="color: #ffffff; font-size: 16px; text-decoration: none">{{cardset}}</a>
</td>
</tr>
</tbody>
......
......@@ -20,9 +20,9 @@ export class MailNotifier {
var active = Learned.findOne({cardset_id: cardset._id, user_id: user_id, active: true});
var deadline = new Date(active.currentDate.getTime() + cardset.daysBeforeReset * 86400000);
if (deadline.getTime() > cardset.learningEnd.getTime()) {
return (TAPi18n.__('deadlinePrologue') + cardset.learningEnd.toLocaleDateString() + TAPi18n.__('deadlineEpilogue1'));
return (TAPi18n.__('deadlinePrologue', null, Meteor.settings.newsletterLanguage) + cardset.learningEnd.toLocaleDateString() + TAPi18n.__('deadlineEpilogue1', null, Meteor.settings.newsletterLanguage));
} else {
return (TAPi18n.__('mailNotification.textDate1') + deadline.toLocaleDateString() + TAPi18n.__('mailNotification.textDate2'));
return (TAPi18n.__('mailNotification.textDate1', null, Meteor.settings.newsletterLanguage) + deadline.toLocaleDateString() + TAPi18n.__('mailNotification.textDate2', null, Meteor.settings.newsletterLanguage));
}
}
}
......@@ -33,18 +33,18 @@ export class MailNotifier {
} else {
var notifier = new Notifications();
var cards = notifier.getActiveCardsCount(cardset._id, user_id);
var subject = TAPi18n.__('mailNotification.subjectTitle');
var text = TAPi18n.__('mailNotification.textIntro') + notifier.getName(user_id) + TAPi18n.__('mailNotification.textIntro1') + TAPi18n.__('mailNotification.newCards1');
var subject = TAPi18n.__('mailNotification.subjectTitle', null, Meteor.settings.newsletterLanguage);
var text = TAPi18n.__('mailNotification.textIntro', null, Meteor.settings.newsletterLanguage) + notifier.getName(user_id) + TAPi18n.__('mailNotification.textIntro1', null, Meteor.settings.newsletterLanguage) + TAPi18n.__('mailNotification.newCards1', null, Meteor.settings.newsletterLanguage);
if (cards === 1) {
subject += TAPi18n.__('mailNotification.subjectSingular1') + cards + TAPi18n.__('mailNotification.subjectSingular2');
text += cards + TAPi18n.__('mailNotification.newCards2Singular');
subject += TAPi18n.__('mailNotification.subjectSingular1', null, Meteor.settings.newsletterLanguage) + cards + TAPi18n.__('mailNotification.subjectSingular2', null, Meteor.settings.newsletterLanguage);
text += cards + TAPi18n.__('mailNotification.newCards2Singular', null, Meteor.settings.newsletterLanguage);
} else {
subject += TAPi18n.__('mailNotification.subjectPlural1') + cards + TAPi18n.__('mailNotification.subjectPlural2');
text += cards + TAPi18n.__('mailNotification.newCards2Plural');
subject += TAPi18n.__('mailNotification.subjectPlural1', null, Meteor.settings.newsletterLanguage) + cards + TAPi18n.__('mailNotification.subjectPlural2', null, Meteor.settings.newsletterLanguage);
text += cards + TAPi18n.__('mailNotification.newCards2Plural', null, Meteor.settings.newsletterLanguage);
}
subject += TAPi18n.__('mailNotification.subjectCardset') + cardset.name + TAPi18n.__('mailNotification.subjectEnd');
text += cardset.name + TAPi18n.__('mailNotification.subjectEnd');
subject += TAPi18n.__('mailNotification.subjectCardset', null, Meteor.settings.newsletterLanguage) + cardset.name + TAPi18n.__('mailNotification.subjectEnd', null, Meteor.settings.newsletterLanguage);
text += cardset.name + TAPi18n.__('mailNotification.textEnd', null, Meteor.settings.newsletterLanguage);
this.sendMail(this.getMail(user_id), subject, text, cardset._id, "#3d9c19", "#328114");
}
}
......@@ -54,25 +54,26 @@ export class MailNotifier {
throw new Meteor.Error("not-authorized");
} else {
var notifier = new Notifications();
var subject = TAPi18n.__('mailNotification.subjectReset') + cardset.name;
var text = TAPi18n.__('mailNotification.textIntro') + notifier.getName(user_id) + "\n\n" + TAPi18n.__('mailNotification.mailCard') + cardset.name + TAPi18n.__('mailNotification.mailCard1') + "\n\n";
var subject = TAPi18n.__('mailNotification.subjectReset', null, Meteor.settings.newsletterLanguage) + cardset.name;
var text = TAPi18n.__('mailNotification.textIntro', null, Meteor.settings.newsletterLanguage) + notifier.getName(user_id) + "\n\n" + TAPi18n.__('mailNotification.mailCard', null, Meteor.settings.newsletterLanguage) + cardset.name + TAPi18n.__('mailNotification.mailCard1', null, Meteor.settings.newsletterLanguage) + "\n\n";
text += this.getDeadline(cardset, user_id);
this.sendMail(this.getMail(user_id), subject, text, cardset._id, "#d70000", "#a40000");
}
}
sendMail (mail, subject, text, cardsetId, titleColor, buttonColor) {
var datenschutz = TAPi18n.__('footer.datenschutz');
var agb = TAPi18n.__('footer.agb');
var impressum = TAPi18n.__('footer.impressum');
var service = TAPi18n.__('mailNotification.service');
var unsubscribe = TAPi18n.__('mailNotification.unsubscribe');
var copyright = TAPi18n.__('mailNotification.copyright');
var datenschutz = TAPi18n.__('footer.datenschutz', null, Meteor.settings.newsletterLanguage);
var agb = TAPi18n.__('footer.agb', null, Meteor.settings.newsletterLanguage);
var impressum = TAPi18n.__('footer.impressum', null, Meteor.settings.newsletterLanguage);
var service = TAPi18n.__('mailNotification.service', null, Meteor.settings.newsletterLanguage);
var unsubscribe = TAPi18n.__('mailNotification.unsubscribe', null, Meteor.settings.newsletterLanguage);
var copyright = TAPi18n.__('mailNotification.copyright', null, Meteor.settings.newsletterLanguage);
var myCardset = TAPi18n.__('mailNotification.my-cardset', null, Meteor.settings.newsletterLanguage);
if (!Meteor.isServer) {
throw new Meteor.Error("not-authorized");
} else {
if (mail) {
var html = SSR.render("newsletter", {message: text, title: subject, id: cardsetId, url: Meteor.settings.public.rooturl, titlecolor: titleColor, btncol: buttonColor, datenschutz: datenschutz, impressum: impressum, agb: agb, service: service, unsubscribe: unsubscribe, copyright: copyright});
var html = SSR.render("newsletter", {message: text, title: subject, id: cardsetId, url: Meteor.settings.public.rooturl, titlecolor: titleColor, btncol: buttonColor, datenschutz: datenschutz, impressum: impressum, agb: agb, service: service, unsubscribe: unsubscribe, copyright: copyright, cardset: myCardset});
Email.send({
from: '',
to: mail,
......
......@@ -40,5 +40,6 @@
"baseUrl": "https://cas.thm.de/cas",
"autoClose": true
},
"MAIL_URL": "smtp://postmaster%40sandboxcc4938befa8447ca8c857cdf4b968653.mailgun.org:d07ea9c40ccbb21d268bbda17e9aad9d@smtp.mailgun.org:587"
"MAIL_URL": "smtp://postmaster%40sandboxcc4938befa8447ca8c857cdf4b968653.mailgun.org:d07ea9c40ccbb21d268bbda17e9aad9d@smtp.mailgun.org:587",
"newsletterLanguage": "de"
}
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