“ jhipster中的邮件国际化”

时间:2019-06-19 08:47:12

标签: jhipster

“我正在为我的应用程序使用jhipster,我尝试将电子邮件国际化添加到i18n文件夹下的messages_en.properties和message.properties和message_en.properties文件中,然后在模板/ mail / activationEmail下的html文件中添加.html,我做了以下操作,但是通过更改语言无法正常工作。

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title th:text="#{email.activation.title}">JHipster activation</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="shortcut icon" th:href="@{|${baseUrl}/favicon.ico|}" />
</head>
<body>
    <p th:text="#{email.activation.greeting(${user.login})}">
        Dear
    </p>
    <p th:text="#{email.activation.text1}">
        Your JHipster account has been created, please click on the URL below to activate it:
    </p>
    <p>
        <a th:with="url=(@{|${baseUrl}/#/activate?key=${user.activationKey}|})" th:href="${url}"
        th:text="${url}">Activation link</a>
    </p>
    <p>
        <span th:text="#{email.activation.text2}">Regards, </span>
        <br/>
        <em th:text="#{email.signature}">Jhipster.</em>
    </p>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

使用JHipster生成应用程序时,可以选择希望应用程序使用的语言。要修改注册电子邮件的文本,您只需像完成操作一样在文件messages_languageYouWantToEdit.properties中编辑模板。

您可能必须再次编译应用程序才能正确查看更改。

  

如果您使用的是Maven

     

./ mvnw(在Mac OS X / Linux上)// mvnw(在Windows上):

     

或Gradle

     

./ gradlew(在Mac OS X / Linux上)// gradlew(在Windows上)

您可以在其网站上了解有关Jhipster国际化的更多信息: https://www.jhipster.tech/installing-new-languages/