[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread Tim Perrett
Its now committed into 1.1-SNAPSHOT Cheers, Tim On Feb 27, 6:56 pm, "marius d." wrote: > I am :) ... nice work ! > > On Feb 27, 8:38 pm, Tim Perrett wrote: > > > Marius and I have just chatted this over on IM - I've altered the code > > to use NamedPF... > > > The code now reads: > > >   /** >

[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread marius d.
I am :) ... nice work ! On Feb 27, 8:38 pm, Tim Perrett wrote: > Marius and I have just chatted this over on IM - I've altered the code > to use NamedPF... > > The code now reads: > >   /** >    * Get the resource bundle for the current locale >    */ >    def resourceBundles: List[ResourceBundl

[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread Derek Chen-Becker
Is "ignorance" an acceptable answer? ;) Fixing it up now. On Fri, Feb 27, 2009 at 12:02 PM, marius d. wrote: > > Any reason why not use NamedPF.applyBox ? > > On Feb 27, 7:12 pm, Derek Chen-Becker wrote: > > Take 3. Change the factory application to: > > > > > LiftRules.resourceBundleFactorie

[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread Tim Perrett
Marius and I have just chatted this over on IM - I've altered the code to use NamedPF... The code now reads: /** * Get the resource bundle for the current locale */ def resourceBundles: List[ResourceBundle] = { _resBundle.value match { case Nil => { _resBundle.set

[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread marius d.
Well yeah but I only havethis code from you: def resourceBundles : List[ResourceBundle] = ... case Nil => _resBundle.set(LiftRules.resourceNames.flatMap(name => tryo { List(ResourceBundle.getBundle(name, locale)) } openOr { // I think this is right... LiftRules.resourceBundleFactories.toList.

[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread marius d.
Any reason why not use NamedPF.applyBox ? On Feb 27, 7:12 pm, Derek Chen-Becker wrote: > Take 3. Change the factory application to: > > LiftRules.resourceBundleFactories.toList.find(_.isDefinedAt(locale)).toList.map(_.apply(locale)) > > Derek > > On Fri, Feb 27, 2009 at 11:05 AM, Derek Chen-Bec

[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread Timothy Perrett
Don't they achieve different things? resourceNames just defines the base name for which the default java system starts looking for localizations right? Cheers, Tim On 27/02/2009 17:54, "marius d." wrote: > > How would LiftRule.resourceNames work with > > type ResourceBundleFactoryPF = Parti

[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread marius d.
How would LiftRule.resourceNames work with type ResourceBundleFactoryPF = PartialFunction[Locale,Box [ResourceBundle]] var resourceBundleFactories : RulesSeq[ResourceBundleFactory] ... from usability perspective ? On Feb 27, 7:38 pm, Tim Perrett wrote: > Ok, excellent. I know have a working

[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread Tim Perrett
Ok, excellent. I know have a working implementation! Rock. Any objections to submitting this into master? Im guessing the code freeze is now off. Cheers, Tim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" gr

[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread Derek Chen-Becker
OK, since we're using a PF, the Box[ResourceBundle] really isn't necessary, either. On Fri, Feb 27, 2009 at 11:12 AM, Derek Chen-Becker wrote: > Take 3. Change the factory application to: > > > LiftRules.resourceBundleFactories.toList.find(_.isDefinedAt(locale)).toList.map(_.apply(locale)) > > De

[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread Derek Chen-Becker
Take 3. Change the factory application to: LiftRules.resourceBundleFactories.toList.find(_.isDefinedAt(locale)).toList.map(_.apply(locale)) Derek On Fri, Feb 27, 2009 at 11:05 AM, Derek Chen-Becker wrote: > Tim, I just noticed that the PF type should be: > > type ResourceBundleFactoryPF = > Par

[Lift] Re: Adding bundle factory to LiftRules

2009-02-27 Thread Derek Chen-Becker
Tim, I just noticed that the PF type should be: type ResourceBundleFactoryPF = PartialFunction[(String,Locale),Box[ResourceBundle]] The reason we wanted to use PFs was to allow specialization for a specific language. I'm wondering whether the string parameter is really necessary, since really tha