Closed spring-projects-issues closed 20 years ago
Juergen Hoeller commented
Indeed, this is a bug: The MessageSource implementations should use a MessageFormat for the given Locale, and also cache MessageFormats per Locale. Thanks for the report! Juergen
olorin opened SPR-152 and commented
Locale setting is not applied to type formatting in ResourceBundleMessageSource.getMessage()
message templates messages_nl: payroll.init=Toepassing geinitialiseerd door {0} op {1,date,long} messages_fr: payroll.init=Application initialisée par {0} le {1,date,long}
code snippet: log.log(Level.WARNING, ctx.getMessage("payroll.init",new Object[]{"Guy",new Date()},new Locale("nl","BE"))); log.log(Level.WARNING, ctx.getMessage("payroll.init",new Object[]{"Elio",new Date()},new Locale("fr","FR")));
output: WARNING: Toepassing geinitialiseerd door Guy op 1 juni 2004 WARNING: Application initialisée par Elio le 1 juni 2004
-> french message is selected correctly but date is dutch formatted.
Doing messages manually:
output OK: WARNING: Application initialisée par Louis le 1 juin 2004
bug or am i missing something?
tnx,
jan
Affects: 1.0.1