--- Paranoid_Fabio <[EMAIL PROTECTED]> wrote:
> Hello. I've a problem with i18n resource bundles.
> 
> I've a page "home.jsp" that uses a resoruce bundle "res1" 
> for internationalization.
>
> home.jsp, like all the pages of my web app, includes "bar.jsp" which is a
> bar with some links. The links are also internationalized and this bar uses
> the resource bundle "res2".
> 
> The problem is that, when I include the bar in the page, all the text
> messages from res1 are not showed. If I do not include the bar, everything
> is ok. It's like the first resource bundle overrides the second.
> I use resource bundles in this way:
> 
> 
>  <s:i18n name="text/res1">
>       <s:text name="message"/>
>  </s:i18n>
> 
> Any help? Thanks!

Is the JSP included within an outer <s:i18n...> tag?

Caveat for following hypothesis: I haven't looked at this code for quite some
time now; a second opinion would be a really good idea.

I ask because the <s:i18n...> tag pushes the resources onto the stack. IIRC
things that look up messages stop looking when the first TextProvider is
found, meaning that if a resource isn't found in the first TextProvider it
will fail to find resources contained in underlying (further down the stack)
TextProviders.

The <s:i18n...> tag also pops blindly [1] on its closing tag, which can lead
to issues if there are any nested, unbalanced pushes.

It might be helpful to provide a skeleton outline of how things are being
done on your page.

Dave

[1] It now throws an exception or logs (I forget which) when it pops
something "unexpected".

I haven't seen the code for this fix yet; does <s:i18n...> to keep a key of
some sort (hashCode?) of the object pushed for determining "unexpected"?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to