如何本地化百里香输入type = submit对象?

时间:2019-02-17 16:27:32

标签: html localization thymeleaf

是否可以使用Thymeleaf定位Phone Book [1] Add a contact [2] Delete a contact [3] Show contacts [4] Exit program What function would you like to use? 1 You chose to add a contact. First name: test Last name: 1 Phone number (Numbers only): 1234567 Record added to the phone book New contact: First name: test Last name: 1 Phone number: 1234567 Contact number is 0 Phone Book [1] Add a contact [2] Delete a contact [3] Show contacts [4] Exit program What function would you like to use? 1 You chose to add a contact. First name: Test Last name: 2 Phone number (Numbers only): 8901234 Record added to the phone book New contact: First name: Test Last name: 2 Phone number: 8901234 Contact number is 1 Phone Book [1] Add a contact [2] Delete a contact [3] Show contacts [4] Exit program What function would you like to use? 3 You chose to show the contacts. Contact #0 First name: test Last name: 1 Phone number: 1234567 Contact #1 First name: Test Last name: 2 Phone number: 8901234 Phone Book [1] Add a contact [2] Delete a contact [3] Show contacts [4] Exit program What function would you like to use? 2 You chose to delete a contact. Which contact would you like to delete? Specify by contact number. 0 -------------------------------- Process exited with return value 3221225477 对象?

我有这个:input type=submit,但是如果我有这个:<input type="submit" value="Login"/>,那么该消息将打印在“登录”按钮旁边。

如果我这样做:<input type="submit" value="Login" th:text="#{msg.loginButton}"/>消息将显示在登录按钮的旁边,只有这次,“提交查询”才显示在登录按钮上。

我想解决此问题而不更改按钮本身的类,我希望它保持为<input type="submit" th:text="#{msg.loginButton}"/>。有什么建议吗?

1 个答案:

答案 0 :(得分:2)

value属性与any other attribute you can set with ThymeLeaf没什么不同。

<input type="submit" th:value="#{msg.loginButton}" />