It works fine, when using a struts resource, e.g.

struts-config.xml:

  <message-resources parameter="webapps.base.properties.menu" null="false"
key="webapps.base.properties.menu"/>

Without this definition, the menu key are found (for default locale/language
= request ?), but switching between locales has not effect or how to tell
MenuDisplayer that the locale has changed ?


-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Auftrag von Matt
Raible
Gesendet: Montag, 24. April 2006 17:28
An: [email protected]
Betreff: Re: [struts-menu] struts-menu & i18n - switching locale on user
login


The only thing I can think of is Velocity is caching the menu's output
and therefore not switching the locale's for you.

Matt

On 4/24/06, Norbert Rieger <[EMAIL PROTECTED]> wrote:
> Hi,
>
> due to a little mistake this question was also posted under item "Multiple
> Menus", Ryan Keeling, 2006-04-21, sorry for that.
>
>
>
> I want to switch the "locale" based on user settings.
>
> I'm using struts and JSTL 1.2, switching locale works fine with:
>
>   // change struts' locale
>   session.setAttribute(org.apache.struts.Globals.LOCALE_KEY, newLocale);
>   // change JSTL's locale
>   Config.set(session, Config.FMT_LOCALE, newLocale) ;
>
> But menu titles won't switch, they appear always in the same language.
> What do I have to set / change ?
>
> Google found a "solution", using MenuDisplayer's locale attribute, but it
> won't work for me. Maybe I'm setting the attribute wrong.
> How do I have to set this attribute to read the JSTL/Struts locale ?
>
> Thanxs a lot for your help.
> Norbert
>
>
> Here's my menu-config.xml
>
> <MenuConfig>
>   <Displayers>
>     <Displayer   name="Velocity"
> type="net.sf.navigator.displayer.VelocityMenuDisplayer"/>
>   </Displayers>
>
>   <Menus>
>     <Menu name="Logout" title="menu.Logout.title" action="/Logout"/>
>     <Menu name="Admin" title="menu.Admin.title">
>         <Item name="T1" title="Admin 1"/>
>         <Item name="T2" title="Admin 2"/>
>         <Item name="T3" title="Admin 3"/>
>     </Menu>
>     <Menu name="Test" title="Test">
>         <Item name="T1" title="Item 1"/>
>         <Item name="T2" title="Item 2"/>
>         <Item name="T3" title="Item 3"/>
>     </Menu>
>   </Menus>
> </MenuConfig>
>
> and the menu.jsp, which is included via struts tiles:
>
> <%@ taglib uri="http://struts-menu.sf.net/tag"; prefix="menu" %>
>
> <div id="menuDiv">
> <menu:useMenuDisplayer name="Velocity" config="/templates/tabs.html"
>      bundle="webapps.base.properties.menu">
>      <ul id="menuList">
>        <menu:displayMenu name="Test"/>
>        <menu:displayMenu name="Admin"/>
>        <menu:displayMenu name="Logout"/>
>      </ul>
> </menu:useMenuDisplayer>
> </div>
>
>
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> struts-menu-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/struts-menu-user
>


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=k&kid0709&bid&3057&dat1642
_______________________________________________
struts-menu-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
struts-menu-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user

Reply via email to