]> git.basschouten.com Git - openhab-addons.git/commitdiff
[mail] Added translations for ThingActions (#9121)
authorChristoph Weitkamp <github@christophweitkamp.de>
Wed, 25 Nov 2020 06:52:56 +0000 (07:52 +0100)
committerGitHub <noreply@github.com>
Wed, 25 Nov 2020 06:52:56 +0000 (07:52 +0100)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/action/SendMailActions.java
bundles/org.openhab.binding.mail/src/main/resources/OH-INF/i18n/mail.properties [new file with mode: 0644]
bundles/org.openhab.binding.mail/src/main/resources/OH-INF/i18n/mail_de.properties

index bc7ada427976bd0c3dc02429120d73dfd8a547c0..66f42f0cdd395f58f0041fd78b6c02526cf55bbe 100644 (file)
@@ -45,16 +45,16 @@ public class SendMailActions implements ThingActions {
 
     private @Nullable SMTPHandler handler;
 
-    @RuleAction(label = "send a text mail", description = "Sends a text mail.")
+    @RuleAction(label = "@text/sendMessageActionLabel", description = "@text/sendMessageActionDescription")
     public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean sendMail(
             @ActionInput(name = "recipient") @Nullable String recipient,
             @ActionInput(name = "subject") @Nullable String subject,
             @ActionInput(name = "text") @Nullable String text) {
-        return sendMail(recipient, subject, text, new ArrayList<>());
+        return sendMailWithAttachments(recipient, subject, text, List.of());
     }
 
-    @RuleAction(label = "send a text mail", description = "Sends a text mail with URL attachment.")
-    public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean sendMail(
+    @RuleAction(label = "@text/sendAttachmentMessageActionLabel", description = "@text/sendAttachmentMessageActionDescription")
+    public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean sendMailWithAttachment(
             @ActionInput(name = "recipient") @Nullable String recipient,
             @ActionInput(name = "subject") @Nullable String subject, @ActionInput(name = "text") @Nullable String text,
             @ActionInput(name = "url") @Nullable String urlString) {
@@ -62,11 +62,11 @@ public class SendMailActions implements ThingActions {
         if (urlString != null) {
             urlList.add(urlString);
         }
-        return sendMail(recipient, subject, text, urlList);
+        return sendMailWithAttachments(recipient, subject, text, urlList);
     }
 
-    @RuleAction(label = "send a text mail", description = "Sends a text mail with several URL attachments.")
-    public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean sendMail(
+    @RuleAction(label = "@text/sendAttachmentsMessageActionLabel", description = "@text/sendAttachmentsMessageActionDescription")
+    public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean sendMailWithAttachments(
             @ActionInput(name = "recipient") @Nullable String recipient,
             @ActionInput(name = "subject") @Nullable String subject, @ActionInput(name = "text") @Nullable String text,
             @ActionInput(name = "urlList") @Nullable List<String> urlStringList) {
@@ -105,7 +105,7 @@ public class SendMailActions implements ThingActions {
 
     public static boolean sendMail(ThingActions actions, @Nullable String recipient, @Nullable String subject,
             @Nullable String text) {
-        return SendMailActions.sendMail(actions, recipient, subject, text, new ArrayList<>());
+        return SendMailActions.sendMail(actions, recipient, subject, text, List.of());
     }
 
     public static boolean sendMail(ThingActions actions, @Nullable String recipient, @Nullable String subject,
@@ -119,19 +119,19 @@ public class SendMailActions implements ThingActions {
 
     public static boolean sendMail(ThingActions actions, @Nullable String recipient, @Nullable String subject,
             @Nullable String text, @Nullable List<String> urlStringList) {
-        return ((SendMailActions) actions).sendMail(recipient, subject, text, urlStringList);
+        return ((SendMailActions) actions).sendMailWithAttachments(recipient, subject, text, urlStringList);
     }
 
-    @RuleAction(label = "send a HTML mail", description = "Sends a HTML mail.")
+    @RuleAction(label = "@text/sendHTMLMessageActionLabel", description = "@text/sendHTMLMessageActionDescription")
     public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean sendHtmlMail(
             @ActionInput(name = "recipient") @Nullable String recipient,
             @ActionInput(name = "subject") @Nullable String subject,
             @ActionInput(name = "html") @Nullable String html) {
-        return sendHtmlMail(recipient, subject, html, new ArrayList<>());
+        return sendHtmlMailWithAttachments(recipient, subject, html, List.of());
     }
 
-    @RuleAction(label = "send a HTML mail", description = "Sends a HTML mail with URL attachment.")
-    public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean sendHtmlMail(
+    @RuleAction(label = "@text/sendHTMLAttachmentMessageActionLabel", description = "@text/sendHTMLAttachmentMessageActionDescription")
+    public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean sendHtmlMailWithAttachment(
             @ActionInput(name = "recipient") @Nullable String recipient,
             @ActionInput(name = "subject") @Nullable String subject, @ActionInput(name = "html") @Nullable String html,
             @ActionInput(name = "url") @Nullable String urlString) {
@@ -139,11 +139,11 @@ public class SendMailActions implements ThingActions {
         if (urlString != null) {
             urlList.add(urlString);
         }
-        return sendHtmlMail(recipient, subject, html, urlList);
+        return sendHtmlMailWithAttachments(recipient, subject, html, urlList);
     }
 
-    @RuleAction(label = "send a HTML mail", description = "Sends a HTML mail with several URL attachments.")
-    public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean sendHtmlMail(
+    @RuleAction(label = "@text/sendHTMLAttachmentsMessageActionLabel", description = "@text/sendHTMLAttachmentsMessageActionDescription")
+    public @ActionOutput(name = "success", type = "java.lang.Boolean") Boolean sendHtmlMailWithAttachments(
             @ActionInput(name = "recipient") @Nullable String recipient,
             @ActionInput(name = "subject") @Nullable String subject, @ActionInput(name = "html") @Nullable String html,
             @ActionInput(name = "urlList") @Nullable List<String> urlStringList) {
@@ -182,7 +182,7 @@ public class SendMailActions implements ThingActions {
 
     public static boolean sendHtmlMail(ThingActions actions, @Nullable String recipient, @Nullable String subject,
             @Nullable String html) {
-        return SendMailActions.sendHtmlMail(actions, recipient, subject, html, new ArrayList<>());
+        return SendMailActions.sendHtmlMail(actions, recipient, subject, html, List.of());
     }
 
     public static boolean sendHtmlMail(ThingActions actions, @Nullable String recipient, @Nullable String subject,
@@ -196,7 +196,7 @@ public class SendMailActions implements ThingActions {
 
     public static boolean sendHtmlMail(ThingActions actions, @Nullable String recipient, @Nullable String subject,
             @Nullable String html, @Nullable List<String> urlStringList) {
-        return ((SendMailActions) actions).sendHtmlMail(recipient, subject, html, urlStringList);
+        return ((SendMailActions) actions).sendHtmlMailWithAttachments(recipient, subject, html, urlStringList);
     }
 
     @Override
diff --git a/bundles/org.openhab.binding.mail/src/main/resources/OH-INF/i18n/mail.properties b/bundles/org.openhab.binding.mail/src/main/resources/OH-INF/i18n/mail.properties
new file mode 100644 (file)
index 0000000..eb66ef5
--- /dev/null
@@ -0,0 +1,18 @@
+# actions
+sendMessageActionLabel = send a text mail
+sendMessageActionDescription = Sends a text mail.
+
+sendAttachmentMessageActionLabel = send a text mail with attachment
+sendAttachmentMessageActionDescription = Sends a text mail with an URL attachment.
+
+sendAttachmentsMessageActionLabel = send a text mail with several attachments
+sendAttachmentsMessageActionDescription = Sends a text mail with several URL attachments.
+
+sendHTMLMessageActionLabel = send a HTML mail
+sendHTMLMessageActionDescription = Sends a HTML mail.
+
+sendHTMLAttachmentMessageActionLabel = send a HTML mail with attachment
+sendHTMLAttachmentMessageActionDescription = Sends a HTML mail with an URL attachment.
+
+sendHTMLAttachmentsMessageActionLabel = send a HTML mail with several attachments
+sendHTMLAttachmentsMessageActionDescription = Sends a HTML mail with several URL attachments.
index f759af413adcc252c6c1634d0d0c285666d23809..9931182c24b8dc5e86dafd617a3b23abd52aaf5e 100644 (file)
@@ -55,3 +55,22 @@ channel-type.config.mail.mailcount.folder.description = Name des Postfachs auf d
 channel-type.config.mail.mailcount.type.label = Typ
 channel-type.config.mail.mailcount.type.option.TOTAL = Gesamt
 channel-type.config.mail.mailcount.type.option.UNREAD = Ungelesen
+
+# actions
+sendMessageActionLabel = eine E-Mail senden
+sendMessageActionDescription = Sendet eine E-Mail.
+
+sendAttachmentMessageActionLabel = eine E-Mail mit Anhang senden
+sendAttachmentMessageActionDescription = Sendet eine E-Mail mit Anhang.
+
+sendAttachmentsMessageActionLabel = eine E-Mail mit mehreren Anhängen senden
+sendAttachmentsMessageActionDescription = Sendet eine E-Mail mit mehreren Anhängen.
+
+sendHTMLMessageActionLabel = eine HTML E-Mail senden
+sendHTMLMessageActionDescription = Sendet eine HTML E-Mail.
+
+sendHTMLAttachmentMessageActionLabel = eine HTML E-Mail mit Anhang senden
+sendHTMLAttachmentMessageActionDescription = Sendet eine HTML E-Mail mit Anhang.
+
+sendHTMLAttachmentsMessageActionLabel = eine HTML E-Mail mit mehreren Anhängen senden
+sendHTMLAttachmentsMessageActionDescription = Sendet eine HTML E-Mail mit mehreren Anhängen.