You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jukka Välimaa <va...@gmail.com> on 2008/05/07 10:30:32 UTC
Internalization problem: two internalizations for the same key
Hi everyone,
I have the following lines in my jsp file:
<s:select
label="%{getText('workingTeam.team')}" name="teamId" listKey="id"
listValue="name"
list="workingTeams" />
<s:text name="workingTeam.team" />
Of these two, using text tag gives me the internalization that has been
selected as internationalization for the application. Using getText for
select label gives me internalization in Finnish, no matter what is the
selected internationalization. All internationalizations are in their own
global ApplicationResources files. getText method is the standard method
from ActionSupport.
Any idea what is the cause of this, and what might be the solution?
Re: Internalization problem: two internalizations for the same key
Posted by Jukka Välimaa <va...@gmail.com>.
We're using Struts 2.1.1 and i18n interceptor. Resource files are named
ApplicationResources_??.properties . The following values are set for i18n
constants:
<constant name="struts.i18n.encoding" value="UTF-8"/>
<constant name="struts.custom.i18n.resources"
value="ApplicationResources,errors"/>
It seems like using getText in jsp universally fails the way I described in
my original post. However, when getText is used in action classes to get a
string before going to result jsp, it returns the correct
internationalization.
On Thu, May 8, 2008 at 9:38 AM, Toni Lyytikäinen <to...@gmail.com> wrote:
> Which version of Struts 2 are you using? 2.0.11.1 works fine for me in the
> same situation. Are you using the i18n interceptor? Also, how did you name
> your resource files?
>
>
> On Wed, May 7, 2008 at 11:30 AM, Jukka Välimaa <va...@gmail.com>
> wrote:
>
> > Hi everyone,
> >
> > I have the following lines in my jsp file:
> > <s:select
> > label="%{getText('workingTeam.team')}" name="teamId" listKey="id"
> > listValue="name"
> > list="workingTeams" />
> >
> > <s:text name="workingTeam.team" />
> >
> > Of these two, using text tag gives me the internalization that has been
> > selected as internationalization for the application. Using getText for
> > select label gives me internalization in Finnish, no matter what is the
> > selected internationalization. All internationalizations are in their own
> > global ApplicationResources files. getText method is the standard method
> > from ActionSupport.
> >
> > Any idea what is the cause of this, and what might be the solution?
> >
>
Re: Internalization problem: two internalizations for the same key
Posted by Toni Lyytikäinen <to...@gmail.com>.
Which version of Struts 2 are you using? 2.0.11.1 works fine for me in the
same situation. Are you using the i18n interceptor? Also, how did you name
your resource files?
On Wed, May 7, 2008 at 11:30 AM, Jukka Välimaa <va...@gmail.com>
wrote:
> Hi everyone,
>
> I have the following lines in my jsp file:
> <s:select
> label="%{getText('workingTeam.team')}" name="teamId" listKey="id"
> listValue="name"
> list="workingTeams" />
>
> <s:text name="workingTeam.team" />
>
> Of these two, using text tag gives me the internalization that has been
> selected as internationalization for the application. Using getText for
> select label gives me internalization in Finnish, no matter what is the
> selected internationalization. All internationalizations are in their own
> global ApplicationResources files. getText method is the standard method
> from ActionSupport.
>
> Any idea what is the cause of this, and what might be the solution?
>