【发布时间】:2018-01-27 04:05:38
【问题描述】:
我无法在 Spring Boot Thymeleaf 中实现自定义属性(例如 HTML5 数据属性、数据工具提示)的国际化。这是示例代码。
<a class="active" th:text="#{label.management}"></a>
...
<input type="text" th:field="*{username}" th:placeholder="#{label.username}" />
...
<div class="fixed-action-btn tooltipped" data-position="left" data-delay="50" th:data-tooltip="#{label.quicklinks}">
<a class="btn-floating btn-large orange">
<i class="large icons ion-edit"></i>
</a>
....
</div>
他们 th:text 和 th:placeholder 没问题。但是 th:data-tooltip 会打印一个空字符串。
我想了解如何在自定义 HTML 元素上实现 Spring Boot thymeleaf 翻译。谢谢。
【问题讨论】:
标签: spring spring-mvc thymeleaf spring-bean