问题
Can i do something like in JSF Resource Bundle property text file:
receptionContact=Reception
reservationContact=Reservation
receptionEmail={receptionContact}
reservationEmail={reservationContact}
回答1:
You can parameterize your resource bundles, but no reflective reuse of values by keys. Please have a look on this: https://code.google.com/p/reflectiveresourcebundle/
With that, you don't have repeat your self!
Without:
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
With:
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 is another interesting tutorial about formatting.
来源:https://stackoverflow.com/questions/8139250/variable-substitution-jsf-resource-bundle-property-file