|
From: Peter De B. <pet...@gm...> - 2007-12-21 15:42:10
|
Lieven,
This is more an issue for the core springframework project, as
StaticMessageSource is in the core project.
Also note that the Locale.ROOT constant was introduced in JDK 1.6, so it's
possible the StaticMessageSource doesn't work correctly with it.
regards,
Peter
On Dec 21, 2007 11:10 AM, Lieven Doclo <ld...@sc...> wrote:
> Static message source does not fall back to ROOT locale when no message
> is found:
>
> public class StaticMessageSourceTest extends TestCase
> {
> private StaticMessageSource source;
> private MessageSourceAccessor accessor;
>
> protected void setUp() throws Exception
> {
> source = new StaticMessageSource();
> source.addMessage("key", Locale.ROOT, "root key");
> accessor = new MessageSourceAccessor(source);
> }
>
> public void testKeys()
> {
> assertEquals("root key", accessor.getMessage("key"));
> }
> }
>
> MessageSourceAccessor will try to find key_nl_BE in my case, and throws
> a NoSuchMessageException. It should try and find key_nl and key if not
> found.
>
> Something else I discovered:
>
> source.addMessage("key", Locale.ROOT, "root key") does not add "key" as
> a code, but "key_"... Shouldn't it omit the "_" sign when the locale is
> the ROOT locale ("")?
>
> Greetz,
>
> Lieven
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Springframework-rcp-dev mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev
>
|