From 19e389ec1cfc7046cd0ba9250fb708cc1ffab643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Mart=C3=ADnez=20Fern=C3=A1ndez?= Date: Tue, 22 Jan 2019 16:33:02 +0100 Subject: [PATCH] SAK-41225: Changes for internationalitation (#6488) --- .../poll/templates/notifyDeletedOption.xml | 16 +++++++--------- polls/impl/pom.xml | 4 ++++ .../src/bundle/notifyDeletedOption.properties | 6 ++++++ .../src/bundle/notifyDeletedOption_es.properties | 6 ++++++ .../poll/logic/impl/ExternalLogicImpl.java | 11 +++++++++++ 5 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 polls/impl/src/bundle/notifyDeletedOption.properties create mode 100644 polls/impl/src/bundle/notifyDeletedOption_es.properties diff --git a/polls/api/src/java/org/sakaiproject/poll/templates/notifyDeletedOption.xml b/polls/api/src/java/org/sakaiproject/poll/templates/notifyDeletedOption.xml index d68ad8826636..71a7b124357d 100644 --- a/polls/api/src/java/org/sakaiproject/poll/templates/notifyDeletedOption.xml +++ b/polls/api/src/java/org/sakaiproject/poll/templates/notifyDeletedOption.xml @@ -1,30 +1,28 @@ - [${localSakaiName}] A poll option you voted for has been deleted + [${localSakaiName}] ${subject} polls.notifyDeletedOption admin 2 - Dear ${recipientFirstName}, + ${message1} ${recipientFirstName}, - The poll option you voted for in the site '${siteTitle}' has been deleted - by a poll maintainer. The poll question is: + ${message2} '${siteTitle}' ${message3} ${pollQuestion} - Please log in to ${localSakaiName} and place a new vote for the poll. + ${message4} ${localSakaiName} ${message5} - Dear ${recipientFirstName}, + ${message1} ${recipientFirstName}, <br /> <br /> - The poll option you voted for in the site '${siteTitle}' has been deleted - by a poll maintainer. The poll question is: + ${message2} '${siteTitle}' ${message3} <br /> <br /> ${pollQuestion} <br /> <br /> - Please log in to ${localSakaiName} and place a new vote for the poll. + ${message4} ${localSakaiName} ${message5} <br /> diff --git a/polls/impl/pom.xml b/polls/impl/pom.xml index 3543c182be9c..45740b367fe9 100644 --- a/polls/impl/pom.xml +++ b/polls/impl/pom.xml @@ -33,6 +33,10 @@ org.sakaiproject.kernel sakai-component-manager + + org.sakaiproject.kernel + sakai-kernel-storage-util + org.sakaiproject.entitybroker entitybroker-api diff --git a/polls/impl/src/bundle/notifyDeletedOption.properties b/polls/impl/src/bundle/notifyDeletedOption.properties new file mode 100644 index 000000000000..6ca0aa4888d6 --- /dev/null +++ b/polls/impl/src/bundle/notifyDeletedOption.properties @@ -0,0 +1,6 @@ +subject=A poll option you voted for has been deleted +message1=Dear +message2=The poll option you voted for in the site +message3=has been deleted by a poll maintainer. The poll question is: +message4=Please log in to +message5=and place a new vote for the poll. \ No newline at end of file diff --git a/polls/impl/src/bundle/notifyDeletedOption_es.properties b/polls/impl/src/bundle/notifyDeletedOption_es.properties new file mode 100644 index 000000000000..c8e0e5b3b442 --- /dev/null +++ b/polls/impl/src/bundle/notifyDeletedOption_es.properties @@ -0,0 +1,6 @@ +subject=Se ha eliminado una opci\u00f3n de encuesta por la que has votado. +message1=Estimado/a +message2=La opci\u00f3n de encuesta por la que vot\u00f3 en el sitio +message3=ha sido eliminada por un administrador. La pregunta de la encuesta es: +message4=Por favor inicie sesi\u00f3n en +message5=y vote de nuevo. \ No newline at end of file diff --git a/polls/impl/src/java/org/sakaiproject/poll/logic/impl/ExternalLogicImpl.java b/polls/impl/src/java/org/sakaiproject/poll/logic/impl/ExternalLogicImpl.java index e6dc5a254b4c..5d05b09046e9 100644 --- a/polls/impl/src/java/org/sakaiproject/poll/logic/impl/ExternalLogicImpl.java +++ b/polls/impl/src/java/org/sakaiproject/poll/logic/impl/ExternalLogicImpl.java @@ -72,10 +72,13 @@ import org.sakaiproject.user.api.User; import org.sakaiproject.user.api.UserDirectoryService; import org.sakaiproject.user.api.UserNotDefinedException; +import org.sakaiproject.util.ResourceLoader; @Slf4j @Setter public class ExternalLogicImpl implements ExternalLogic { + + private static final ResourceLoader RB = new ResourceLoader("notifyDeletedOption"); private static final String /* Email template constants */ @@ -390,6 +393,14 @@ else if (pollQuestion == null) replacementValues.put("recipientDisplayName", user.getDisplayName()); replacementValues.put("pollQuestion", pollQuestion); replacementValues.put("siteTitle", siteTitle); + + // Values of "src/bundle/notifyDeletedOption.properties" + replacementValues.put("subject", RB.getString("subject")); + replacementValues.put("message1", RB.getString("message1")); + replacementValues.put("message2", RB.getString("message2")); + replacementValues.put("message3", RB.getString("message3")); + replacementValues.put("message4", RB.getString("message4")); + replacementValues.put("message5", RB.getString("message5")); RenderedTemplate template = emailTemplateService.getRenderedTemplateForUser(EMAIL_TEMPLATE_NOTIFY_DELETED_OPTION, user.getReference(), replacementValues);