Translate welcome email.

This commit is contained in:
Paulo Gustavo Veiga 2022-03-27 07:32:53 -03:00
parent 20b2e8f1e8
commit f70f1d89ab
10 changed files with 92 additions and 92 deletions

View File

@ -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 =
"<p> Thank you for your interest in WiseMapping. Click <a href='https://app.wisemapping.com/c/login'>here</a> to start creating and sharing new mind maps. If have any feedback or idea, send us an email to <a href=\"mailto:feedback@wisemapping.com\">feedback@wisemapping.com</a> .We'd love to hear from you.</p>";
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<String, String> 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;
}
}

View File

@ -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);
}
}

View File

@ -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("<topic"));
return topics.length <= 3;
}
}

View File

@ -51,3 +51,7 @@ TRY_WELCOME = Dieser Ausgabebereich zeigt einige der Mindmap-Editor-Funktionen \
UNEXPECTED_ERROR_DETAILS = Unerwarteter Fehler bei der Verarbeitung der Anforderung.
NO_ENOUGH_PERMISSIONS=Diese map ist nicht mehr verfügbar.
NO_ENOUGH_PERMISSIONS_DETAILS=Sie haben nicht die erforderlichen Rechte, um sich diese map anzusehen. Diese map ist entweder privat oder wurde gelöscht.
REGISTRATION.EMAIL_SUBJECT=Willkommen bei WiseMapping!
REGISTRATION.EMAIL_TITLE=Ihr Konto wurde erfolgreich erstellt
REGISTRATION.EMAIL_BODY=<p> Vielen Dank für Ihr Interesse an WiseMapping. Klicken Sie <a href='https://app.wisemapping.com/c/login'>hier</a>, um mit dem Erstellen und Teilen neuer Mindmaps zu beginnen. Wenn Sie Feedback oder Ideen haben, senden Sie uns eine E-Mail an <a href=\"mailto:feedback@wisemapping.com\">feedback@wisemapping.com</a>. Wir würden uns freuen, von Ihnen zu hören.</p >

View File

@ -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=<p> Thank you for your interest in WiseMapping. Click <a href='https://app.wisemapping.com/c/login'>here</a> to start creating and sharing new mind maps. If have any feedback or idea, send us an email to <a href=\"mailto:feedback@wisemapping.com\">feedback@wisemapping.com</a> .We'd love to hear from you.</p>

View File

@ -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=<p> Gracias por tu interest en WiseMapping. Hace click <a href='https://app.wisemapping.com/c/login'>aqui</a> para empezar a crear y compatir tus mapas mentales. Ideas y sugerencias, no dudes en contactarnos a <a href=\"mailto:feedback@wisemapping.com\">feedback@wisemapping.com</a>.</p>

View File

@ -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=<p> Merci de l'intérêt que vous portez à WiseMapping. Cliquez <a href='https://app.wisemapping.com/c/login'>ici</a> pour commencer à créer et partager de nouvelles cartes mentales. Si vous avez des commentaires ou des idées, envoyez-nous un e-mail à <a href=\"mailto:feedback@wisemapping.com\">feedback@wisemapping.com</a>. Nous aimerions avoir de vos nouvelles.</p >

View File

@ -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=<p> Благодарим вас за интерес к WiseMapping. Нажмите <a href='https://app.wisemapping.com/c/login'>здесь</a>, чтобы начать создавать и публиковать новые интеллект-карты. Если у вас есть какие-либо отзывы или идеи, отправьте нам электронное письмо по адресу <a href=\"mailto:feedback@wisemapping.com\">feedback@wisemapping.com</a>. Мы будем рады услышать от вас.</p >

View File

@ -55,4 +55,8 @@ CAPTCHA_TIMEOUT_OUT_DUPLICATE=请刷新页面,然后重试。
CAPTCHA_INVALID_INPUT_RESPONSE=输入无效,刷新页面后重试。
MINDMAP_EMPTY_ERROR=思维导图不能为空。
INVALID_MINDMAP_FORMAT=思维导图格式无效。
TOO_BIG_MINDMAP=你已经达到了一张思维导图中500个主题的限制。
TOO_BIG_MINDMAP=你已经达到了一张思维导图中500个主题的限制。
REGISTRATION.EMAIL_SUBJECT=欢迎来到智慧地图
REGISTRATION.EMAIL_TITLE=您的帐户已成功创建
REGISTRATION.EMAIL_BODY=<p> 感谢您对 WiseMapping 的关注。点击<a href='https://app.wisemapping.com/c/login'>这里</a>开始创建和分享新的思维导图。如果有任何反馈或想法,请给我们发送电子邮件至 <a href=\"mailto:feedback@wisemapping.com\">feedback@wisemapping.com</a>。我们很乐意听取您的意见。</p >

View File

@ -95,7 +95,7 @@
<bean id="notificationService" class="com.wisemapping.mail.NotificationService">
<property name="baseUrl" value="${site.baseurl}"/>
<property name="mailer" ref="mailer"/>
<property name="velocityEngineWrapper" ref="velocityEngineWrapper"/>
<property name="messageSource" ref="messageSource"/>
</bean>
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">