StrataFrame Forum

Translating into a different language

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

By Ivan George Borges - 1/25/2006

Hi there.

I'm going through the tutorials. Having fun.

One question. I would like to translate all framework messages into portuguese. Would you guys, please, show me the best practise to accomplish this ?

Thanks in advance.

By StrataFrame Team - 1/26/2006

Howdy Ivan George,



Yes, you will need to open the Messaging & Localization from the StrataFrame menu within Visual Studio. Then, within the Common Repository, create a localization key for each message you want to translate and associate that key with the messages from the different languages. Then, you can export those messages to XML. Within the AppMain.vb file (or program.cs) configure the application to use XML for localization information and provide the path to the folder containing the XML files.



Any text that is "embedded" within the framework can be configured to use a localization key. For instance, the "This field is required" message is set on the form by the ErrorProviderRequiredFieldDesc property, but if you specify the ErrorProviderRequiredFieldDescKey property, StrataFrame will pull the text from that localized XML file.
By Ivan George Borges - 1/26/2006

Hi Ben.

Thanks for your reply.

I had already opened the Common Repository. I thought I would get a list of all framework messages and then I would be able to create a localized message for each of them. Then, somewhere in the framework I could tell which language i would be using, and StrataFrame would manage to show the localized messages for that language.

As I open the Common Repository, I see a blank form. How do I know which messages there are to be translated ?  And I mean all tool tips, buttons, etc.

I probably didn't understand it well, but will I have to build a list of messages in a different language and them, in each form, specify that the localized message should be used ?

Thanks for your patience.

By Ricardo Quartier - 1/26/2006

Yes, i little step by step, will be nice.
By StrataFrame Team - 1/26/2006

The Common Repository is common between all Localization projects... it doesn't contain the messages used within StrataFrame. Now that you mention it, however, it would certainly be nice to provide a list of the keys used within StrataFrame so that you can translate them. I'll try to get them done asap.



Now, anything you want to localize (be it a Button, or Label) is going to have a LocalizationKey property. You set the localization key to key that you configured within the Messaging & Localization Editor. Then at runtime, StrataFrame pulls the information out of that XML store and puts it in the localized property.
By StrataFrame Team - 1/26/2006

Ricardo Quartier (01/26/2006)
Yes, i little step by step, will be nice.




Yes, the last portion of the "First Application" tutorial goes over adding messaging & localization to a project.
By Ivan George Borges - 1/26/2006

Hi Ben.

Great, got it.

Thanks for making our lives easier. I will wait for the list them, meanwhile, I will carry on with the tutorials.

Best.

By Ricardo Quartier - 1/26/2006

Great.. thanks !!!
By Ivan George Borges - 1/26/2006

By the way ...

Are we getting the last part of the tutorial soon ?

By StrataFrame Team - 1/27/2006

Yes, I'm cranking away on it... shouldn't be much longer.
By Ricardo Quartier - 1/31/2006

Yo, Ben

Can u give a little bit more details about how to do that?

Within the AppMain.vb file (or program.cs) configure the application to use XML for localization information and provide the path to the folder containing the XML files. ( I dont know where in the file, or in that screen) PS - I use VB

Thanks in advance.... I done my 2 test keys (english and portuguese), then exported to the application directory, and now i have 3 files:

Message_Languages.xml
Messages_1033.XML
Messages_1046.XML

The key is "MyKey1" and the message is "This is a text message" in portuguese the key is "MyKey1" and the message is "Esta mensagem é de teste" on the localization editor i set Portuguese as defaulf.

What do I do now? Create a label and put in the text? "This is a text message" and after run it shows "Esta mensagem é de teste"?

Any help will be nice...

Thanks.

By StrataFrame Team - 2/1/2006

No, you add a label and set the LocalizationKey property to "MyKey1". If the MicroFour.StrataFrame.UI.Localization.LocaleID property is set to 1033, the label's Text will be set to "This is a text message". If the MicroFour.StrataFrame.UI.Localization.LocaleID property is set to 1046, then the Label's text will be set to "Esta mensagem é de teste". The localization does not go off of the text, but rather the LocalizationKey property. Anywhere in a StrataFrame UI component where you see "Key" on the end of anything (other than "DataSourceKey"), you're giving it the key from your localization information, such as "MyKey1".