【发布时间】:2019-01-11 11:54:18
【问题描述】:
我的 messages.properties 文件中有一个键文本,其中包含变量:
some.key=You'll need to pay {0} {1} in order to continue.
我的应用程序支持的两种语言环境都有它:messages.properties 用于英语,messages_tr.properties 用于土耳其语(默认 Locale)。
所以当我使用土耳其语言环境渲染页面时,这可以工作:
我得到:
Some Turkish words 10 USD some other Turkish words.
因此,{0} {1} 被替换为金额和货币。但是当我用英文呈现页面时它不会:
You'll need to pay {0} {1} in order to continue.
我做错了什么?谢谢。
【问题讨论】:
标签: spring spring-boot thymeleaf locale