I am :) ... nice work !
On Feb 27, 8:38 pm, Tim Perrett <[email protected]> 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." <[email protected]> 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 <[email protected]> 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." <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---