StrataFrame Forum

Problem With Localization

http://forum.strataframe.net/Topic10975.aspx

By Luiz Carneiro Lima - 8/21/2007

I created a project in the Localization & Messaging Editor. I generated the xml archive, I created the folder Localization Files in the Visual Studio and added generated archives in XML. In the guide properties I modified the Build Action for "Embedded Resource".

In the InnitApplication I configured the code:
MicroFour.StrataFrame.UI.Localization.MessageLocaleID = MicroFour.StrataFrame.UI.Localization.GetActiveLanguage (“Customer”);

When I select label and I give a click in key in the properties appears the following message of error:

Implicit conversion from data type text to nvarchar is not allowed. Use the CONVERT function to run this query.

They can help me?

Thanks.

Angela

By Luiz Carneiro Lima - 8/22/2007

Hi,

I saw in a part of the Help that it has to configure in the "Solution Preferences" the fields of the 'Localization Preferences', but when I select in the menu Strataframe/Solution Preferences does not open the window of preferences. Nothing does happen.

I until already restarted the system, I initiated a new project… But still thus it does not appear the window “Solution Preferences”...

You can Help me?

Thanks!

By Luiz Carneiro Lima - 8/22/2007

I resolved the problem. The problem that I was having was that I was not placing the correct MessageLocaleID.

Localization.MessageLocaleID = Localization.GetActiveLanguage();

Now its works, thanks.

By StrataFrame Team - 8/22/2007

There is a more efficient option to choosing the language as well:

System.Globalization.CultureInfo.CurrentCulture.LCID

The GetActiveLanguage() can sometimes take a while to return since it uses the DataTable XML serialization for the encrypted XML file that is stored in the application data.  We use the LCID property of the CurrentCulture within our applications so that the language is chosen by the region setting the user has set up in the Control Panel within Windows.

You'll also want to put a Select Case right after getting the locale ID just in case your application is not localized in the language that is chosen (or you might get an exception thrown).  This is what we do within the security editor:

        '-- Configure the localization information
        Select Case System.Globalization.CultureInfo.CurrentCulture.LCID
            Case 1031, 3079
                '-- German (Germany)
                Localization.MessageLocaleID = 1031

            Case 1036, 3084
                '-- French (France)
                Localization.MessageLocaleID = 1036

            Case 1040
                '-- Italian (Italy)
                Localization.MessageLocaleID = 1040

            Case 1046, 2070
                '-- Portuguese Brazil
                Localization.MessageLocaleID = 1046

            Case 1049
                '-- Russian (Russia)
                Localization.MessageLocaleID = 1049

            Case 2058, 11274
                '-- Spanish (Mexico)
                Localization.MessageLocaleID = 2058

            Case Else
                '-- English (USA)
                Localization.MessageLocaleID = 1033
        End Select

By Luiz Carneiro Lima - 8/24/2007

Ok, thanks for the hint!