That's what I call a precise reply. Thank you! Now I've written a filter that refreshes the menu item after the localization filter.
On 19 Mai, 16:59, Colin Ramsay <[email protected]> wrote: > Why not just do everything in the filter then? > > On Tue, May 19, 2009 at 3:56 PM, Flominator <[email protected]> wrote: > > > Hi there, > > > my aim: Localized navigation. > > > I tried it the following way: > > - wrote an object ViewMenuItem that basically consists of strings > > representing links and label for the links > > - get the label texts from a resource manager > > - display the ViewMenuItem and it's siblings in the view > > > Everything works fine, except localisation ;) > > > I tried to translate the labels within Initialize from BaseController > > which is derived from SmartDispatcherController. Initialize first > > calls base.Initialize() then tries to get the menu_item from the > > session or creates a new one based on the current locale. When I try > > to initialize a new version of the ViewMenuItem within Initialize() my > > log file tells me, that the filter is executed afterwards. > > > The action BaseController.SetLanguage (which basically sets a language > > cookie) sets the ViewMenuItem , but with the "old language" because > > the filter [LocalizationFilter(RequestStore.Session, "locale")] wasn't > > called, yet. This again leads to the wrong language picked. > > > When I call SetLanguage for the next time, the language is changed > > correctly. > > > So I thought that there might be some other hook or action of > > SmartDispatcherController which is called after executing the filter. > > I might override it in BaseController to solve my problem. > > > Thanks in advance, > > > Flo > > > PS: I also thought that I might use the messages object from [Resource > > ("messages", "Messweb.Resources.Global")] within the NVelocity view. > > But how should I pass "attribute names" like .close of $messages.close > > to the view when they're strings? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
