Gauthier,

Your patch looks good.

I think AbstractValidationAttribute.GetLocalizedMessageByKey() should throw
if the resources cannot be found though, currently it kind of 'silently'
fails by falling back to default messages which is probably not what you
want when localizing messages.

-- Roelof

On Wed, Jun 17, 2009 at 12:21 AM, Gauthier Segay
<[email protected]>wrote:

>
> Thanks Roelof,
>
> after some exploratory, I'm back to the simplest solution to support
> ressource enabled error messages, here is a patch for review:
>
> http://support.castleproject.org/projects/COMP/issues/view/COMP-ISSUE-91
>
> I think the solution fits well for the purpose of resource
> localization support and as a first native support
>
> However, it may need additional work to extend for other localization
> schemes (not resources)
>
> On Jun 16, 11:41 am, Roelof Blom <[email protected]> wrote:
> > @IRessourceEnabledFoo: I like the idea and think the interface could live
> in
> > Castle.Core as i18n is a pretty fundamental thing, at least here in
> Europe
> > ;-). Patch, or points to Gildas' localization stuff?
> >
> > @po file support feels like a pretty alien thing on Windows. You'd
> probably
> > also have to port Mono.Unix.Catalog (
> http://anonsvn.mono-project.com/viewvc/trunk/mcs/class/Mono.Posix/Mon...),
> > as this is extensively used for Mono i18n.
> >
> > -- Roelof
> >
> > On Fri, Jun 12, 2009 at 9:26 PM, Gauthier Segay <
> [email protected]>wrote:
> >
> >
> >
> >
> >
> > > well, I'm unsure it would fit, but a solution could be to implement
> > > something like this:
> >
> > > interface IRessourceEnabledFoo #ValidationAttribute in our case?
> > >  pro staticResourceType as Type?
> > >  pro resourceKey as String?
> > >  pro ressourceName as String? #fallback if hard dependencies to
> > > generated static resources stubs should be avoid
> >
> > > if both of theses properties are set (type descriptor and, the message
> > > would be retrieved from the static class provided as
> > > staticResourceType parameter instead of the default Message (could be
> > > fallback for non localized labels)
> >
> > > anyone find this idea plausible?
> >
> > > the interface may live in Castle.Core or
> > > Castle.Components.Localization (AFAIR Gildas has contributed some
> > > localization helpness some time ago)
> >
> > > I would be glad if some knowledgable people (or project leader) about
> > > validator component could get in touch with me to share some hints.
> >
> > > I think it's a must have feature for the validator framework and
> > > potentially for other bits of the framework.
> >
> > > Aside, anyone did have experience with other storage for localization
> > > rather than ressource assemblies, I'm asking because I preffer to
> > > separe them from the usage place and could rather stand static stubs
> > > generated, but suffer from vs solution build issues,
> >
> > > I gave a quick glance about po file support under monodevelop and was
> > > surprised of the simpleness of the solution, wondering if this is
> > > supported under vanilla .net?
> >
> > > On Jun 12, 9:32 am, Roelof Blom <[email protected]> wrote:
> > > > You are right, and unfortunately you cannot set a resource key on a
> > > > validation attribute.
> > > > -- Roelof
> >
> > > > On Thu, Jun 11, 2009 at 5:35 PM, Gauthier Segay <
> > > [email protected]>wrote:
> >
> > > > > If I'm right, this is for the default messages.
> >
> > > > > Is there a way to set resource key for customized messages ?
> >
> > > > > On Jun 10, 9:57 pm, Roelof Blom <[email protected]> wrote:
> > > > > > Out of the box we have support for messages in the following
> > > languages:
> >
> > > > > >    - English
> > > > > >    - Spanish
> > > > > >    - French
> > > > > >    - Italian
> > > > > >    - Lithuanian
> > > > > >    - Latvian
> > > > > >    - Dutch
> > > > > >    - Polish
> > > > > >    - Portuguese
> > > > > >    - Russian
> > > > > >    - Swedish
> >
> > > > > > -- Roelof.
> >
> > > > > > On Wed, Jun 10, 2009 at 9:14 PM, Thi <[email protected]>
> wrote:
> >
> > > > > > > Is there any way to implement multi-language support while
> using
> > > the
> > > > > > > built-in validators available? I'm relatively new to
> ActiveRecord /
> > > > > > > Validator, so any help would be appreciated.
> >
> > > > > > > Cheers,
> > > > > > > Thiago.
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to