From f70f1d89ab1883945e86ec77488a1473e3bf71ca Mon Sep 17 00:00:00 2001
From: Paulo Gustavo Veiga
Date: Sun, 27 Mar 2022 07:32:53 -0300
Subject: [PATCH] Translate welcome email.
---
.../wisemapping/mail/NotificationService.java | 30 ++---
.../wisemapping/rest/AccountController.java | 11 --
.../com/wisemapping/rest/AdminController.java | 13 ---
.../src/main/resources/messages_de.properties | 4 +
.../src/main/resources/messages_en.properties | 106 +++++++++---------
.../src/main/resources/messages_es.properties | 4 +
.../src/main/resources/messages_fr.properties | 4 +
.../src/main/resources/messages_ru.properties | 4 +
.../src/main/resources/messages_zh.properties | 6 +-
.../webapp/WEB-INF/wisemapping-service.xml | 2 +-
10 files changed, 92 insertions(+), 92 deletions(-)
diff --git a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java
index 06b981bb..6425bd65 100644
--- a/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java
+++ b/wise-webapp/src/main/java/com/wisemapping/mail/NotificationService.java
@@ -23,37 +23,35 @@ import com.wisemapping.model.Collaboration;
import com.wisemapping.model.Mindmap;
import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestLogItem;
-import com.wisemapping.util.VelocityEngineUtils;
-import com.wisemapping.util.VelocityEngineWrapper;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.i18n.LocaleContextHolder;
+import org.springframework.context.support.ResourceBundleMessageSource;
import javax.servlet.http.HttpServletRequest;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
final public class NotificationService {
final private static Logger logger = Logger.getLogger(Mailer.class);
final private static String DEFAULT_WISE_URL = "http://localhost:8080/wisemapping";
- private VelocityEngineWrapper velocityEngineWrapper;
+
+ private ResourceBundleMessageSource messageSource;
@Autowired
private Mailer mailer;
private String baseUrl;
- public NotificationService() {
- NotifierFilter notificationFilter = new NotifierFilter();
- }
-
public void newCollaboration(@NotNull Collaboration collaboration, @NotNull Mindmap mindmap, @NotNull User user, @Nullable String message) {
try {
@@ -106,10 +104,11 @@ final public class NotificationService {
}
public void newAccountCreated(@NotNull User user) {
- final String mailSubject = "Welcome to WiseMapping !";
- final String messageTitle = "Your account has been created successfully";
- final String messageBody =
- " Thank you for your interest in WiseMapping. Click here to start creating and sharing new mind maps. If have any feedback or idea, send us an email to feedback@wisemapping.com .We'd love to hear from you.
";
+ final Locale locale = LocaleContextHolder.getLocale();
+
+ final String mailSubject = messageSource.getMessage("REGISTRATION.EMAIL_SUBJECT", null, locale);
+ final String messageTitle = messageSource.getMessage("REGISTRATION.EMAIL_TITLE", null, locale);
+ final String messageBody = messageSource.getMessage("REGISTRATION.EMAIL_BODY", null, locale);
sendTemplateMail(user, mailSubject, messageTitle, messageBody);
}
@@ -160,10 +159,6 @@ final public class NotificationService {
// }
}
- public void setVelocityEngineWrapper(VelocityEngineWrapper engine) {
- this.velocityEngineWrapper = engine;
- }
-
public void reportJavascriptException(@Nullable Mindmap mindmap, @Nullable User user, @NotNull RestLogItem errorItem, @NotNull HttpServletRequest request) {
final Map summary = new HashMap<>();
@@ -236,6 +231,11 @@ final public class NotificationService {
public void setBaseUrl(String baseUrl) {
this.baseUrl = baseUrl;
}
+
+ public void setMessageSource(ResourceBundleMessageSource messageSource) {
+ this.messageSource = messageSource;
+ }
+
}
diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java
index 8a23a646..b56605b4 100644
--- a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java
+++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java
@@ -124,15 +124,4 @@ public class AccountController extends BaseController {
}
userService.removeUser(user);
}
-
-
- @RequestMapping(method = RequestMethod.POST, value = "/logger/editor", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"})
- @ResponseStatus(value = HttpStatus.NO_CONTENT)
- public void logError(@RequestBody RestLogItem item, @NotNull HttpServletRequest request) {
- final Mindmap mindmap = mindmapService.findMindmapById(item.getMapId());
- final User user = Utils.getUser();
-
- notificationService.reportJavascriptException(mindmap, user, item, request);
- }
-
}
diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java
index 3043fc28..c8e8deb2 100644
--- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java
+++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java
@@ -138,17 +138,4 @@ public class AdminController extends BaseController {
userService.removeUser(user);
}
-
- private boolean isWelcomeMap(@NotNull Mindmap mindmap) throws UnsupportedEncodingException {
- // Is welcome map ?
- final String xmlStr = mindmap.getXmlStr();
- boolean oldWelcomeMap = xmlStr.contains("Welcome to WiseMapping") && xmlStr.contains("My Wisemaps");
- return oldWelcomeMap;
- }
-
- public boolean isSimpleMap(@NotNull Mindmap mindmap) throws UnsupportedEncodingException {
- String xmlStr = mindmap.getXmlStr();
- String[] topics = xmlStr.split(Pattern.quote(" Vielen Dank für Ihr Interesse an WiseMapping. Klicken Sie hier, um mit dem Erstellen und Teilen neuer Mindmaps zu beginnen. Wenn Sie Feedback oder Ideen haben, senden Sie uns eine E-Mail an feedback@wisemapping.com. Wir würden uns freuen, von Ihnen zu hören.
\ No newline at end of file
diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties
index 163f0a66..d012be30 100644
--- a/wise-webapp/src/main/resources/messages_en.properties
+++ b/wise-webapp/src/main/resources/messages_en.properties
@@ -1,59 +1,63 @@
# Default English Support.
-DESCRIPTION = Description
-SITE.TITLE = WiseMapping
-FIELD_REQUIRED = Required field cannot be left blank
-EMAIL_ALREADY_EXIST = There is an account already with this email.
-NO_VALID_EMAIL_ADDRESS = Invalid email address
-INVALID_EMAIL_ADDRESS = Invalid email address. Please, verify that your entered valid email address.
-PASSWORD_MISMATCH = Your password entries did not match
-CREATOR = Creator
-WELCOME = Welcome
-SHARE = Share
-UNEXPECTED_ERROR = An unexpected error has occurred.
-MAP_TITLE_ALREADY_EXISTS = You have already a map with the same name
-LABEL_TITLE_ALREADY_EXISTS = You have already a label with the same name
-TUTORIAL.MULTIPLE_TEXT_STYLES = Multiple Text Styles
-TUTORIAL.DIFFERENT_SHAPES = Different Shapes
-TUTORIAL.FANCY_ICONS = Fancy Icons
-TUTORIAL.MOVE_WITH_ARROWS = Move Between Topics With The Arrows
-TUTORIAL.START_TYPING_TO_EDIT_TEXT = Start Typing to Edit Text
-TUTORIAL.CTRL_TO_ADD_CHILD = Press Ctrl/Meta+Enter to Add Child Topic
-TUTORIAL.ENTER_TO_ADD_SIBLING = Press Enter to Add a Sibling Topic
-TUTORIAL.MORE_KEY_TIPS = More ?. Click on shortcuts above
-TUTORIAL.DOUBLE_CLICK_TO_ADD = Double Click on the Canvas to Create Topics
-TUTORIAL.DRAG_AND_DROP_TO_POSITION = Drag and Drop Topics Position
-TUTORIAL.DOUBLE_CLICK_TO_EDIT_TEXT = Double Click on a Topic to Edit the Text
-TUTORIAL.ADD_NOTES = Add Notes
-TUTORIAL.USER_THE_TOOLBAR = Use the Toolbar
-TUTORIAL.PUBLISH_YOUR_MAPS = Publish your Mindmap
-TUTORIAL.EMBED_IN_BLOGS = Embed in Blogs
-TUTORIAL.INVITE_FRIEND = Invite Friends to Collaborate
-TUTORIAL.SHARING = Sharing
-TUTORIAL.EDITION_USING_MOUSE = Edition Using Mouse
-TUTORIAL.EDITION_USING_KEYBOARD = Edition Using Keyboard
-TUTORIAL.ADD_LINKS_WEBPAGES = Add Links to Web Pages
-TUTORIAL.TOPIC_PROPERTIES = Topics Properties
-TUTORIAL.HOW_TO_START = How to Start ?
-TUTORIAL.FONT_COLOR = Color
-TUTORIAL.FONT_STYLE = Styles
-TUTORIAL.FONT_TYPE = Type
-TUTORIAL.SAMPLE_NOTE = This is a simple note \!.
-CAPTCHA_LOADING_ERROR = ReCaptcha could not be loaded. You must have access to Google ReCaptcha service.
-ACCESS_HAS_BEEN_REVOKED = Your access permissions to this map has been revoked. Contact map owner.
-MAP_CAN_NOT_BE_FOUND = The map can not be found. It must have been deleted.
-LABEL_CAN_NOT_BE_FOUND = The label can not be found. It must have been deleted.
-MINDMAP_TIMESTAMP_OUTDATED = It's not possible to save your changes because your mindmap has been modified by ''{0}''. Refresh the page and try again.
-MINDMAP_OUTDATED_BY_YOU = It's not possible to save your changes because map is out of date. Do you have multiple tabs opened ?. Refresh the page and try again.
-MINDMAP_LOCKED = Map is being edited by {0} <{1}>. Map is opened in read only mode.
-MINDMAP_IS_LOCKED = Min map is locked for edition.
+DESCRIPTION=Description
+SITE.TITLE=WiseMapping
+FIELD_REQUIRED=Required field cannot be left blank
+EMAIL_ALREADY_EXIST=There is an account already with this email.
+NO_VALID_EMAIL_ADDRESS=Invalid email address
+INVALID_EMAIL_ADDRESS=Invalid email address. Please, verify that your entered valid email address.
+PASSWORD_MISMATCH=Your password entries did not match
+CREATOR=Creator
+WELCOME=Welcome
+SHARE=Share
+UNEXPECTED_ERROR=An unexpected error has occurred.
+MAP_TITLE_ALREADY_EXISTS=You have already a map with the same name
+LABEL_TITLE_ALREADY_EXISTS=You have already a label with the same name
+TUTORIAL.MULTIPLE_TEXT_STYLES=Multiple Text Styles
+TUTORIAL.DIFFERENT_SHAPES=Different Shapes
+TUTORIAL.FANCY_ICONS=Fancy Icons
+TUTORIAL.MOVE_WITH_ARROWS=Move Between Topics With The Arrows
+TUTORIAL.START_TYPING_TO_EDIT_TEXT=Start Typing to Edit Text
+TUTORIAL.CTRL_TO_ADD_CHILD=Press Ctrl/Meta+Enter to Add Child Topic
+TUTORIAL.ENTER_TO_ADD_SIBLING=Press Enter to Add a Sibling Topic
+TUTORIAL.MORE_KEY_TIPS=More ?. Click on shortcuts above
+TUTORIAL.DOUBLE_CLICK_TO_ADD=Double Click on the Canvas to Create Topics
+TUTORIAL.DRAG_AND_DROP_TO_POSITION=Drag and Drop Topics Position
+TUTORIAL.DOUBLE_CLICK_TO_EDIT_TEXT=Double Click on a Topic to Edit the Text
+TUTORIAL.ADD_NOTES=Add Notes
+TUTORIAL.USER_THE_TOOLBAR=Use the Toolbar
+TUTORIAL.PUBLISH_YOUR_MAPS=Publish your Mindmap
+TUTORIAL.EMBED_IN_BLOGS=Embed in Blogs
+TUTORIAL.INVITE_FRIEND=Invite Friends to Collaborate
+TUTORIAL.SHARING=Sharing
+TUTORIAL.EDITION_USING_MOUSE=Edition Using Mouse
+TUTORIAL.EDITION_USING_KEYBOARD=Edition Using Keyboard
+TUTORIAL.ADD_LINKS_WEBPAGES=Add Links to Web Pages
+TUTORIAL.TOPIC_PROPERTIES=Topics Properties
+TUTORIAL.HOW_TO_START=How to Start ?
+TUTORIAL.FONT_COLOR=Color
+TUTORIAL.FONT_STYLE=Styles
+TUTORIAL.FONT_TYPE=Type
+TUTORIAL.SAMPLE_NOTE=This is a simple note \!.
+CAPTCHA_LOADING_ERROR=ReCaptcha could not be loaded. You must have access to Google ReCaptcha service.
+ACCESS_HAS_BEEN_REVOKED=Your access permissions to this map has been revoked. Contact map owner.
+MAP_CAN_NOT_BE_FOUND=The map can not be found. It must have been deleted.
+LABEL_CAN_NOT_BE_FOUND=The label can not be found. It must have been deleted.
+MINDMAP_TIMESTAMP_OUTDATED=It's not possible to save your changes because your mindmap has been modified by ''{0}''. Refresh the page and try again.
+MINDMAP_OUTDATED_BY_YOU=It's not possible to save your changes because map is out of date. Do you have multiple tabs opened ?. Refresh the page and try again.
+MINDMAP_LOCKED=Map is being edited by {0} <{1}>. Map is opened in read only mode.
+MINDMAP_IS_LOCKED=Min map is locked for edition.
# Confirmed
-RESET_PASSWORD_INVALID_EMAIL = The email provided is not a valid user account. Please, try again with a valid email.
-TRY_WELCOME = This edition space showcases some of the mindmap editor capabilities \!.
-UNEXPECTED_ERROR_DETAILS = Unexpected error processing request.
+RESET_PASSWORD_INVALID_EMAIL=The email provided is not a valid user account. Please, try again with a valid email.
+TRY_WELCOME=This edition space showcases some of the mindmap editor capabilities \!.
+UNEXPECTED_ERROR_DETAILS=Unexpected error processing request.
NO_ENOUGH_PERMISSIONS=This mind map cannot be opened.
NO_ENOUGH_PERMISSIONS_DETAILS=You do not have enough right access to see this map. This map has been changed to private or deleted.
CAPTCHA_TIMEOUT_OUT_DUPLICATE=Please, refresh the page and try again.
CAPTCHA_INVALID_INPUT_RESPONSE="Invalid input response, refresh the page and try again.
MINDMAP_EMPTY_ERROR=Mind map can not be empty.
INVALID_MINDMAP_FORMAT=Invalid mind map format.
-TOO_BIG_MINDMAP=You have reached the limit of 500 topics in a mindmap.
+TOO_BIG_MINDMAP=You have reached the limit of 500 topics in a mindmap.
+
+REGISTRATION.EMAIL_SUBJECT=Welcome to WiseMapping !
+REGISTRATION.EMAIL_TITLE=Your account has been created successfully
+REGISTRATION.EMAIL_BODY= Thank you for your interest in WiseMapping. Click here to start creating and sharing new mind maps. If have any feedback or idea, send us an email to feedback@wisemapping.com .We'd love to hear from you.
\ No newline at end of file
diff --git a/wise-webapp/src/main/resources/messages_es.properties b/wise-webapp/src/main/resources/messages_es.properties
index bc69547d..f97a9c81 100644
--- a/wise-webapp/src/main/resources/messages_es.properties
+++ b/wise-webapp/src/main/resources/messages_es.properties
@@ -52,3 +52,7 @@ UNEXPECTED_ERROR_DETAILS = Error inesperado procesando tu pedido.
NO_ENOUGH_PERMISSIONS=El mapa buscado no se encuentra disponible.
NO_ENOUGH_PERMISSIONS_DETAILS=No tiene suficiente permisos de acceso para ver este mapa. El mapa no es mas publico o ha sido borrado.
+REGISTRATION.EMAIL_SUBJECT=Bienvenido/a a WiseMapping !
+REGISTRATION.EMAIL_TITLE=Tu cuenta ha sido creada exitosamente
+REGISTRATION.EMAIL_BODY= Gracias por tu interest en WiseMapping. Hace click aqui para empezar a crear y compatir tus mapas mentales. Ideas y sugerencias, no dudes en contactarnos a feedback@wisemapping.com.
+
diff --git a/wise-webapp/src/main/resources/messages_fr.properties b/wise-webapp/src/main/resources/messages_fr.properties
index 9882ffea..f3b8d659 100644
--- a/wise-webapp/src/main/resources/messages_fr.properties
+++ b/wise-webapp/src/main/resources/messages_fr.properties
@@ -51,3 +51,7 @@ TRY_WELCOME = Cet espace d'édition présente certaines des fonctionnalités de
UNEXPECTED_ERROR_DETAILS = Erreur inattendue lors du traitement de la demande.
NO_ENOUGH_PERMISSIONS=Cette carte n'est plus accessible.
NO_ENOUGH_PERMISSIONS_DETAILS=Vous n'avez pas les droits d'accès suffisants pour voir cette carte. Cette carte est devenue privée, ou a été détruite.
+
+REGISTRATION.EMAIL_SUBJECT=Bienvenue sur WiseMapping !
+REGISTRATION.EMAIL_TITLE=Votre compte a été créé avec succès
+REGISTRATION.EMAIL_BODY= Merci de l'intérêt que vous portez à WiseMapping. Cliquez ici pour commencer à créer et partager de nouvelles cartes mentales. Si vous avez des commentaires ou des idées, envoyez-nous un e-mail à feedback@wisemapping.com. Nous aimerions avoir de vos nouvelles.
\ No newline at end of file
diff --git a/wise-webapp/src/main/resources/messages_ru.properties b/wise-webapp/src/main/resources/messages_ru.properties
index 0c122588..e9a80baf 100644
--- a/wise-webapp/src/main/resources/messages_ru.properties
+++ b/wise-webapp/src/main/resources/messages_ru.properties
@@ -56,3 +56,7 @@ CAPTCHA_INVALID_INPUT_RESPONSE="Неверная CAPTCHA, обновите ст
MINDMAP_EMPTY_ERROR=Карта не может быть пустой.
INVALID_MINDMAP_FORMAT=Недопустимый формат карты.
TOO_BIG_MINDMAP= Слишком большая карта - вы достигли лимита в 500 тем.
+
+REGISTRATION.EMAIL_SUBJECT=Добро пожаловать в WiseMapping!
+REGISTRATION.EMAIL_TITLE=Ваша учетная запись успешно создана
+REGISTRATION.EMAIL_BODY= Благодарим вас за интерес к WiseMapping. Нажмите здесь, чтобы начать создавать и публиковать новые интеллект-карты. Если у вас есть какие-либо отзывы или идеи, отправьте нам электронное письмо по адресу feedback@wisemapping.com. Мы будем рады услышать от вас.
\ No newline at end of file
diff --git a/wise-webapp/src/main/resources/messages_zh.properties b/wise-webapp/src/main/resources/messages_zh.properties
index 4c3d54d7..73c64316 100644
--- a/wise-webapp/src/main/resources/messages_zh.properties
+++ b/wise-webapp/src/main/resources/messages_zh.properties
@@ -55,4 +55,8 @@ CAPTCHA_TIMEOUT_OUT_DUPLICATE=请刷新页面,然后重试。
CAPTCHA_INVALID_INPUT_RESPONSE=输入无效,刷新页面后重试。
MINDMAP_EMPTY_ERROR=思维导图不能为空。
INVALID_MINDMAP_FORMAT=思维导图格式无效。
-TOO_BIG_MINDMAP=你已经达到了一张思维导图中500个主题的限制。
\ No newline at end of file
+TOO_BIG_MINDMAP=你已经达到了一张思维导图中500个主题的限制。
+
+REGISTRATION.EMAIL_SUBJECT=欢迎来到智慧地图
+REGISTRATION.EMAIL_TITLE=您的帐户已成功创建
+REGISTRATION.EMAIL_BODY= 感谢您对 WiseMapping 的关注。点击这里开始创建和分享新的思维导图。如果有任何反馈或想法,请给我们发送电子邮件至 feedback@wisemapping.com。我们很乐意听取您的意见。
\ No newline at end of file
diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml
index dc4eaba7..591b9bd3 100755
--- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml
+++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-service.xml
@@ -95,7 +95,7 @@
-
+