How can I use SF localised messages in DevExpress control captions?


Author
Message
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi,

I can see how the localised messages work in SF controls but I want to do the same with DevExpress controls (column names etc). I can see in the SF form the property: Me.GradientFormHeader1.DetailTextLocalizationKey = "F001_001" that sets my localised heading however I can't find a similar property within the DevExpress controls.

Where do I go to customise DevExpress controls to extract their caption info from the SF message store?

At the moment we are only using a trial version of both SF and DevExpress - does this make a difference?

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Peter.

I can see how the localised messages work in SF controls but I want to do the same with DevExpress controls (column names etc).

I have localized many DevExpress controls, if this is what you are trying to accomplish, you have to create "satellite assemblies" in order to do so. Here is a link that can give you some information on the subject.

http://www.devexpress.com/Help/?document=xtraeditors/customdocument620.htm

Hope I could help.

Cheers.

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Most of the SF controls, including the GradientFormHeader have the same localization properties as the standard SF controls.  However, column headers do not have a default property for this in DevExpress or our standard controls either.  To localize these controls, you can easily retrieve localized values to set these columns:

MyColumnHeader.Text = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("MyTextKey")

At the moment we are only using a trial version of both SF and DevExpress - does this make a difference?

No, this does not matter.

Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Ivan - thanks for that but I wanted to keep away from the DevExpress approach. One of the things that attracts me to StrataFrame is its approach to localisation. It seems to be very comprehensive and easy to implement.

 Hi Ben - this is exactly what I was looking for but unfortunately I cant get it to work. I use "F001_002" as the key (which is the key used for the SF form header that works ok) but I get the compiler warning/runtime error: The specified key [F001_002] was not found within the localization database.

What else do I need to configure to make this work?

Following are my localisation xml files: Message_Languages.xml, Messages_1033.xml, Messages_3081.xml

<?xml version="1.0" standalone="yes"?>
<NewDataSet>
  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="MessageLanguages" msdata:UseCurrentLocale="true">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="MessageLanguages">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="lng_pk" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" type="xs:int" minOccurs="0" />
                <xs:element name="lng_prj_pk" type="xs:int" minOccurs="0" />
                <xs:element name="lng_codepage" type="xs:int" minOccurs="0" />
                <xs:element name="lng_isolanguage" type="xs:string" minOccurs="0" />
                <xs:element name="lng_yes" type="xs:string" minOccurs="0" />
                <xs:element name="lng_no" type="xs:string" minOccurs="0" />
                <xs:element name="lng_retry" type="xs:string" minOccurs="0" />
                <xs:element name="lng_cancel" type="xs:string" minOccurs="0" />
                <xs:element name="lng_EventId" type="xs:string" minOccurs="0" />
                <xs:element name="lng_baselanguage" type="xs:boolean" minOccurs="0" />
                <xs:element name="lng_created" type="xs:dateTime" minOccurs="0" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
    </xs:element>
  </xs:schema>
  <MessageLanguages>
    <lng_pk>5</lng_pk>
    <lng_prj_pk>3</lng_prj_pk>
    <lng_codepage>1033</lng_codepage>
    <lng_isolanguage>eng</lng_isolanguage>
    <lng_yes>Yes</lng_yes>
    <lng_no>No</lng_no>
    <lng_retry>Retry</lng_retry>
    <lng_cancel>Cancel</lng_cancel>
    <lng_EventId>Event ID</lng_EventId>
    <lng_baselanguage>false</lng_baselanguage>
    <lng_created>2007-01-21T09:53:44.897+10:30</lng_created>
  </MessageLanguages>
  <MessageLanguages>
    <lng_pk>4</lng_pk>
    <lng_prj_pk>3</lng_prj_pk>
    <lng_codepage>3081</lng_codepage>
    <lng_isolanguage>eng</lng_isolanguage>
    <lng_yes>Yes</lng_yes>
    <lng_no>No</lng_no>
    <lng_retry>Retry</lng_retry>
    <lng_cancel>Cancel</lng_cancel>
    <lng_EventId>Event ID</lng_EventId>
    <lng_baselanguage>true</lng_baselanguage>
    <lng_created>2007-01-21T09:53:37.577+10:30</lng_created>
  </MessageLanguages>
</NewDataSet>

<?xml version="1.0" standalone="yes"?>
<NewDataSet>
  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Messages" msdata:Locale="en-AU">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="Messages" msdata:CaseSensitive="False" msdata:Locale="en-AU">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="msg_pk" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" type="xs:int" minOccurs="0" />
                <xs:element name="msg_prj_pk" type="xs:int" minOccurs="0" />
                <xs:element name="msg_type" type="xs:int" minOccurs="0" />
                <xs:element name="msg_key" type="xs:string" minOccurs="0" />
                <xs:element name="msg_language" type="xs:int" minOccurs="0" />
                <xs:element name="msg_text" type="xs:string" minOccurs="0" />
                <xs:element name="msg_event" type="xs:int" minOccurs="0" />
                <xs:element name="msg_title" type="xs:string" minOccurs="0" />
                <xs:element name="msg_function" type="xs:int" minOccurs="0" />
                <xs:element name="msg_icon" type="xs:int" minOccurs="0" />
                <xs:element name="msg_timeout" type="xs:int" minOccurs="0" />
                <xs:element name="msg_sound" type="xs:int" minOccurs="0" />
                <xs:element name="msg_custombuttons" type="xs:string" minOccurs="0" />
                <xs:element name="msg_width" type="xs:int" minOccurs="0" />
                <xs:element name="msg_height" type="xs:int" minOccurs="0" />
                <xs:element name="msg_created" type="xs:dateTime" minOccurs="0" />
                <xs:element name="msg_modified" type="xs:dateTime" minOccurs="0" />
                <xs:element name="msg_Version" type="xs:int" minOccurs="0" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
    </xs:element>
  </xs:schema>
  <Messages>
    <msg_pk>5</msg_pk>
    <msg_prj_pk>3</msg_prj_pk>
    <msg_type>2</msg_type>
    <msg_key>F001_001</msg_key>
    <msg_language>1033</msg_language>
    <msg_text>US Test 1</msg_text>
    <msg_event>0</msg_event>
    <msg_title />
    <msg_function>1</msg_function>
    <msg_icon>1</msg_icon>
    <msg_timeout>0</msg_timeout>
    <msg_sound>1</msg_sound>
    <msg_custombuttons />
    <msg_width>0</msg_width>
    <msg_height>0</msg_height>
    <msg_created>2007-01-21T09:55:03.963+10:30</msg_created>
    <msg_modified>2007-01-21T09:55:03.963+10:30</msg_modified>
    <msg_Version>0</msg_Version>
  </Messages>
  <Messages>
    <msg_pk>6</msg_pk>
    <msg_prj_pk>3</msg_prj_pk>
    <msg_type>2</msg_type>
    <msg_key>F001_002</msg_key>
    <msg_language>1033</msg_language>
    <msg_text>US Test 2</msg_text>
    <msg_event>0</msg_event>
    <msg_title />
    <msg_function>1</msg_function>
    <msg_icon>1</msg_icon>
    <msg_timeout>0</msg_timeout>
    <msg_sound>1</msg_sound>
    <msg_custombuttons />
    <msg_width>0</msg_width>
    <msg_height>0</msg_height>
    <msg_created>2007-01-21T09:55:20.083+10:30</msg_created>
    <msg_modified>2007-01-21T09:55:20.083+10:30</msg_modified>
    <msg_Version>0</msg_Version>
  </Messages>
</NewDataSet>

<?xml version="1.0" standalone="yes"?>
<NewDataSet>
  <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Messages" msdata:Locale="en-AU">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="Messages" msdata:CaseSensitive="False" msdata:Locale="en-AU">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="msg_pk" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" type="xs:int" minOccurs="0" />
                <xs:element name="msg_prj_pk" type="xs:int" minOccurs="0" />
                <xs:element name="msg_type" type="xs:int" minOccurs="0" />
                <xs:element name="msg_key" type="xs:string" minOccurs="0" />
                <xs:element name="msg_language" type="xs:int" minOccurs="0" />
                <xs:element name="msg_text" type="xs:string" minOccurs="0" />
                <xs:element name="msg_event" type="xs:int" minOccurs="0" />
                <xs:element name="msg_title" type="xs:string" minOccurs="0" />
                <xs:element name="msg_function" type="xs:int" minOccurs="0" />
                <xs:element name="msg_icon" type="xs:int" minOccurs="0" />
                <xs:element name="msg_timeout" type="xs:int" minOccurs="0" />
                <xs:element name="msg_sound" type="xs:int" minOccurs="0" />
                <xs:element name="msg_custombuttons" type="xs:string" minOccurs="0" />
                <xs:element name="msg_width" type="xs:int" minOccurs="0" />
                <xs:element name="msg_height" type="xs:int" minOccurs="0" />
                <xs:element name="msg_created" type="xs:dateTime" minOccurs="0" />
                <xs:element name="msg_modified" type="xs:dateTime" minOccurs="0" />
                <xs:element name="msg_Version" type="xs:int" minOccurs="0" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
    </xs:element>
  </xs:schema>
  <Messages>
    <msg_pk>7</msg_pk>
    <msg_prj_pk>3</msg_prj_pk>
    <msg_type>2</msg_type>
    <msg_key>F001_001</msg_key>
    <msg_language>3081</msg_language>
    <msg_text>Aust Test 1</msg_text>
    <msg_event>0</msg_event>
    <msg_title />
    <msg_function>1</msg_function>
    <msg_icon>1</msg_icon>
    <msg_timeout>0</msg_timeout>
    <msg_sound>1</msg_sound>
    <msg_custombuttons />
    <msg_width>0</msg_width>
    <msg_height>0</msg_height>
    <msg_created>2007-01-21T09:55:33.053+10:30</msg_created>
    <msg_modified>2007-01-21T09:55:33.053+10:30</msg_modified>
    <msg_Version>0</msg_Version>
  </Messages>
  <Messages>
    <msg_pk>8</msg_pk>
    <msg_prj_pk>3</msg_prj_pk>
    <msg_type>2</msg_type>
    <msg_key>F001_002</msg_key>
    <msg_language>3081</msg_language>
    <msg_text>Aust Test 2</msg_text>
    <msg_event>0</msg_event>
    <msg_title />
    <msg_function>1</msg_function>
    <msg_icon>1</msg_icon>
    <msg_timeout>0</msg_timeout>
    <msg_sound>1</msg_sound>
    <msg_custombuttons />
    <msg_width>0</msg_width>
    <msg_height>0</msg_height>
    <msg_created>2007-01-21T09:55:48.307+10:30</msg_created>
    <msg_modified>2007-01-21T09:55:48.307+10:30</msg_modified>
    <msg_Version>0</msg_Version>
  </Messages>
</NewDataSet>

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
What else do I need to configure to make this work?

Your XML files look fine (I think...I just glanced throughy them).  But you should not be getting a compiler error.  This is not executed until runtime.  What does your code look like and how are you implementing the XML files.  Are they embedded or external.  If they are external, what does your Appmain.vb (or programcs) file look like in the InitApplication() method?  If you embedding your XML files, then have you set the the XML files to "embedded" on the property sheet? 

Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
What does your code look like

I just added the following to the end of the IntitializeComponent section of MyForm.Designer:

Me.colHIDWght.Caption = MicroFour.StrataFrame.UI.Localization.RetrieveTextValue("F001_001")

Me.colHIDWght is a column in a DevExpress grid.

how are you implementing the XML files. 

Using the standard SF edit tools.

Are they embedded or external.

External

If they are external, what does your Appmain.vb (or programcs) file look like in the InitApplication() method?  If you embedding your XML files, then have you set t the XML files to "embedded" on the property sheet? 

As follows:

        e.Forms.Add(GetType(SF_Test06.frmHID))

        '-- ToDo:  Add any extra application initialization
        MicroFour.StrataFrame.UI.Localization.MessageKeyType = MicroFour.StrataFrame.Messaging.MessageKeyDataType.XML
        MicroFour.StrataFrame.UI.Localization.MessageLocaleID = MicroFour.StrataFrame.UI.Localization.GetActiveLanguage("SF_Test06")

Actually I thought I could see the problem "SF_Test06" is incorrect - I actually created a message file name SF_test (not sure how SF_Test06 got in. However I changed the ActiveLanguage reference to "SF_test" but that didn't make an difference.

The warning (not error) definately displays at build time.

Cheers, Peter

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
You cannot change the names of the XML files.  They MUST be left in tact as StrataFrame looks for the Message_Languages.xml file and the Messages_XXXX.xml files.  The XXXX represents the language code.  For example, 1033 is English, United States.  It looks like this is your problem.
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Trent,

No, I haven't changed the name of any file. I simply changed "SF_Test06" to "SF_test" in the above code to see if it made any difference and it didn't. The xml files exist as created by SF and are named appropriately.

Not to worry - we are only evaluating at the moment and I can see how things will work and, no doubt, it was my own misuse of StrataFrame has caused this problem.

Cheers, Peter

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Peter,

I will go ahead and tell you that we will be releasing the next update within the next several weeks.  This update includes a localization sample that should be exactly what you need.  I would give it to you now, but it is torn up at the moment Ermm

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search