in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Localization and Attributes

Last post 9/19/2007 5:01 AM by John Botibol. 2 replies.
Page 1 of 1 (3 items)
Sort Posts:
Previous Next
  • 9/18/2007 12:16 PM

    Localization and Attributes

    If you implement rules as attributes then how do you set about localizing any text embedded in the attribute? For example:-

    <Size(100)> _

    <RuleRequiredField("RuleRequiredField for Company.Name", DefaultContexts.Save, _

    "Name must not be empty")> _

    Public Property Name() As String

    Get

    Return Me.GetPropertyValue("Name").ToString

    End Get

    Set(ByVal value As String)

    Me.SetPropertyValue("Name", value)

    End Set

    End Property

    The rule does not seem to appear in the Model and thus the Localization feature of the model editor (which is great) wont work.

    Anyone else hit this issue yet?

    Filed under: , , ,
  • 9/19/2007 4:23 AM In reply to

    Re: Localization and Attributes

    Hi John
     
    I have tried this and it appears the model editor lets you change the caption (usually indicated by the globe icon to the left hand side of the property window line) it seems to work for both rules created in the model editor and for those in code. I haven't seen the behaviour you describe - does the rule get applied at runtime?
     
    I have tried it in a version of the dev ex MDI demo and have changed the message for the rule in the model. selecting the prefered culture to French changes the rule error message (unfortunatley I'dont speak french ... so the message is in english - but it is different!)
     
    Regards
     
    Alastair
    "JOHN BOTIBOL" wrote in message news:195029@community.devexpress.com...

    If you implement rules as attributes then how do you set about localizing any text embedded in the attribute? For example:-

    <Size(100)> _

    <RuleRequiredField("RuleRequiredField for Company.Name", DefaultContexts.Save, _

    "Name must not be empty")> _

    Public Property Name() As String

    Get

    Return Me.GetPropertyValue("Name").ToString

    End Get

    Set(ByVal value As String)

    Me.SetPropertyValue("Name", value)

    End Set

    End Property

    The rule does not seem to appear in the Model and thus the Localization feature of the model editor (which is great) wont work.

    Anyone else hit this issue yet?



    http://community.devexpress.com//forums/p/57787/195029.aspx#195029

  • 9/19/2007 5:01 AM In reply to

    Re: Localization and Attributes

    Alastair

     How right you are (dumb question to start with...) I should spend more time in the model editor! Thanks for your response.

    John

Page 1 of 1 (3 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED