You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mague <je...@gmail.com> on 2008/07/25 13:00:48 UTC

something I don't get with i18n in Struts2

Hello all,

Here is my understanding of internationalization in struts 1 & 2 :

In Struts 1.x, it's possible to use something like <bean:message
bundle="myBundle" key="some.key"/> to specify in which resource bundle
"some.key" is to be found.

As the Walking Tour of the Struts 2 MailReader Application explains, "In
Struts 2, message resources are associated with the Action class being
processed". Therefore, when one uses something like <s:text
name="index.login"/> there is no way (as far as I know) to specify the
bundle. It has to be the bundle associated with the action.

Now, here is my problem: I use Tiles in my application and, for example, I
have a tile for a navigation bar. This navigation bar is present on any page
sent to the brother which means that it is generated after every action. In
Strut1, I have a single resource bundle for the navigation bar, and I can
specify it in the jsp file that define the bar. In Struts2 I can see no
other way than duplicating all the keys related to the menu bar in the
resource bundle of every single action. 

Such a duplication cannot the normal way of using a modern framework such as
Struts2. So where am I wrong ? What are the best practices in such a case ?

Jean-Philippe
-- 
View this message in context: http://www.nabble.com/something-I-don%27t-get-with-i18n-in-Struts2-tp18649502p18649502.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: something I don't get with i18n in Struts2

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Jean-Philippe

try this:
http://cwiki.apache.org/WW/internationalization.html

Best greetings,
Paweł Wielgus.


On 25/07/2008, mague <je...@gmail.com> wrote:
>
>  Hello all,
>
>  Here is my understanding of internationalization in struts 1 & 2 :
>
>  In Struts 1.x, it's possible to use something like <bean:message
>  bundle="myBundle" key="some.key"/> to specify in which resource bundle
>  "some.key" is to be found.
>
>  As the Walking Tour of the Struts 2 MailReader Application explains, "In
>  Struts 2, message resources are associated with the Action class being
>  processed". Therefore, when one uses something like <s:text
>  name="index.login"/> there is no way (as far as I know) to specify the
>  bundle. It has to be the bundle associated with the action.
>
>  Now, here is my problem: I use Tiles in my application and, for example, I
>  have a tile for a navigation bar. This navigation bar is present on any page
>  sent to the brother which means that it is generated after every action. In
>  Strut1, I have a single resource bundle for the navigation bar, and I can
>  specify it in the jsp file that define the bar. In Struts2 I can see no
>  other way than duplicating all the keys related to the menu bar in the
>  resource bundle of every single action.
>
>  Such a duplication cannot the normal way of using a modern framework such as
>  Struts2. So where am I wrong ? What are the best practices in such a case ?
>
>  Jean-Philippe
>
> --
>  View this message in context: http://www.nabble.com/something-I-don%27t-get-with-i18n-in-Struts2-tp18649502p18649502.html
>  Sent from the Struts - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>  For additional commands, e-mail: user-help@struts.apache.org
>
>