我可以在JSF Resource Bundle属性文本文件中执行以下操作:
receptionContact=Reception
reservationContact=Reservation
receptionEmail={receptionContact}
reservationEmail={reservationContact}
答案 0 :(得分:2)
您可以parameterize资源包,但不能通过键反映重复使用值。请看看这个: https://code.google.com/p/reflectiveresourcebundle/
有了这个,你就没有重复自己了!
<强>没有强>
company.service.phone=555-1212
company.service.email=help@company.com
my.error.message=Problem accessing account!\
Please call customer service at 555-1212 \
or email us at help@company.com
。通过强>
company.service.phone=555-1212
company.service.email=help@company.com
my.error.message=Problem accessing account!\
Please call customer service at ${company.service.phone} \
or email us at ${company.service.email}
Here是另一个关于格式化的有趣教程。