Skip to content

Commit

Permalink
SAK-41225: Changes for internationalitation (sakaiproject#6488)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandromf authored and bjones86 committed Jan 22, 2019
1 parent ace405b commit 19e389e
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<emailTemplate>
<locale></locale>
<subject>[${localSakaiName}] A poll option you voted for has been deleted</subject>
<subject>[${localSakaiName}] ${subject}</subject>
<key>polls.notifyDeletedOption</key>
<owner>admin</owner>
<version>2</version>
<message>Dear ${recipientFirstName},
<message>${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}
</message>
<htmlMessage>Dear ${recipientFirstName},
<htmlMessage>${message1} ${recipientFirstName},
&lt;br /&gt;
&lt;br /&gt;
The poll option you voted for in the site '${siteTitle}' has been deleted
by a poll maintainer. The poll question is:
${message2} '${siteTitle}' ${message3}
&lt;br /&gt;
&lt;br /&gt;
${pollQuestion}
&lt;br /&gt;
&lt;br /&gt;
Please log in to ${localSakaiName} and place a new vote for the poll.
${message4} ${localSakaiName} ${message5}
&lt;br /&gt;
</htmlMessage>
</emailTemplate>
4 changes: 4 additions & 0 deletions polls/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-component-manager</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.kernel</groupId>
<artifactId>sakai-kernel-storage-util</artifactId>
</dependency>
<dependency>
<groupId>org.sakaiproject.entitybroker</groupId>
<artifactId>entitybroker-api</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions polls/impl/src/bundle/notifyDeletedOption.properties
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions polls/impl/src/bundle/notifyDeletedOption_es.properties
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 19e389e

Please sign in to comment.