Its now committed into 1.1-SNAPSHOT Cheers, Tim
On Feb 27, 6:56 pm, "marius d." <marius.dan...@gmail.com> wrote: > I am :) ... nice work ! > > On Feb 27, 8:38 pm, Tim Perrett <timo...@getintheloop.eu> 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[ResourceBundle] = { > > _resBundle.value match { > > case Nil => { > > _resBundle.set(LiftRules.resourceNames.flatMap(name => tryo( > > List(ResourceBundle.getBundle(name, locale)) > > ).openOr( > > //LiftRules.resourceBundleFactories.toList.find > > (_.isDefinedAt(locale)).toList.map(_.apply(locale)) > > NamedPF.applyBox((name, locale), > > LiftRules.resourceBundleFactories.toList).map(List(_)) openOr Nil > > ))) > > _resBundle.value > > } > > case bundles => bundles > > } > > } > > > Everyone happy with this? > > > Cheers, Tim > > > On Feb 27, 6:10 pm, "marius d." <marius.dan...@gmail.com> wrote: > > > > 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.find(_.isDefinedAt > > > (locale)).map(_.apply(locale)) > > > openOr Nil > > > > })) > > > > ... and you are looking intothe factories if not found in the > > > "traditional" bundles. WHich I guess is fine ... but I don't see the > > > "name" from resurceNames passed to the factory. > > > > SO the name has a meaning in the curent approach but not anymore when > > > using the new factories? > > > > On Feb 27, 8:00 pm, Timothy Perrett <timo...@getintheloop.eu> wrote: > > > > > 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." <marius.dan...@gmail.com> wrote: > > > > > > How would LiftRule.resourceNames work with > > > > > > type ResourceBundleFactoryPF = PartialFunction[Locale,Box > > > > > [ResourceBundle]] > > > > > var resourceBundleFactories : RulesSeq[ResourceBundleFactory] > > > > > > ... from usability perspective ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---