Merge branch 'main' into lang_de, working on further translations

This commit is contained in:
2022-04-19 11:30:41 +02:00
16 changed files with 103 additions and 104 deletions

View File

@@ -213,35 +213,35 @@ public class Rest extends HttpServlet {
return Map.of(SUCCESS,t("Mailing-List '{}' wurde {}!",listEmail,enable ? "aktiviert" : "inaktiviert"));
} catch (SQLException e) {
LOG.error("Aktivieren/Inaktivieren der Mailing-Liste fehlgeschlagen: ",e);
return Map.of("error",t("Failed to update list '{}'",listEmail));
return Map.of(ERROR,t("Aktualisieren der Liste '{}' fehlgeschlagen!",listEmail));
}
}
return Map.of("error",t("You are not allowed to edit '{}'",listEmail));
return Map.of(ERROR,t("Sie haben nicht die Berechtigng, '{}' zu bearbeiten",listEmail));
}
private Map<String, String> hideList(String listEmail, User user, boolean hide) {
if (listEmail == null || listEmail.isBlank()) return Map.of(ERROR,"no list email provided!");
if (listEmail == null || listEmail.isBlank()) return Map.of(ERROR,"Keine Listen-Email übergeben!");
if (user.hashPermission(User.PERMISSION_ADMIN) || ListMember.listsOwnedBy(user).contains(listEmail)){
try {
MailingList.load(listEmail).hide(hide);
return Map.of(SUCCESS,t("Mailing list '{}' was {}!",listEmail,hide ? "hidden" : "made public"));
return Map.of(SUCCESS,t("Mailing-List '{}' wurde {}!",listEmail,hide ? "versteckt" : "veröffentlicht"));
} catch (SQLException e) {
LOG.error("Failed to (un)hide mailing list: ",e);
return Map.of("error",t("Failed to update list '{}'",listEmail));
LOG.error("Verstecken/Veröffentlichen der Mailinglist fehlgeschlagen: ",e);
return Map.of("error",t("Aktualisieren der Liste '{}' fehlgeschlagen",listEmail));
}
}
return Map.of("error",t("You are not allowed to edit '{}'",listEmail));
return Map.of(ERROR,t("Sie haben nicht die Berechtigng, '{}' zu bearbeiten",listEmail));
}
private Map testList(String listEmail, User user) {
if (listEmail == null || listEmail.isBlank()) return Map.of(ERROR,"no list email provided!");
if (listEmail == null || listEmail.isBlank()) return Map.of(ERROR,"Keine Listen-Email übergeben!");
try {
MailingList.load(listEmail).test(user);
return Map.of(SUCCESS,t("Sent test email to {}",user.email()));
return Map.of(SUCCESS,t("Test-Email an {} gesendet",user.email()));
} catch (Exception e) {
LOG.warn("Failed to send test email",e);
return Map.of(ERROR,t("Failed to send test email to {}",user.email()));
LOG.warn("Senden der Test-Email fehlgeschlagen",e);
return Map.of(ERROR,t("Senden der Test-Email an {} fehlgeschlagen",user.email()));
}
}
}