Posted 20 years ago by amadrias
Avatar
I wonder if the Wizard control allows full localisation support?

I suppose it does but I also wonder to know how do we handle it? Using .Resx Files such as the WindowsForms?

Comments (9)

Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Wizard does fully support localization. In the documentation, there is a Localization help topic that describes it.


Actipro Software Support

Posted 20 years ago by ClickSoftware/Hagai - Tel-Aviv, Israel
Avatar
This is only the first step in localization.
The next step is to localize the form.resx or form.resources to a different language.
This is generally done by the application WinRes.
When trying to load a form.resx that contain a wizard control, you see only the first page and you have no way to go to other pages of the wizard.
Furthermore, you can add/remove wizard pages.
Do you have a solution for this?

[ 05-16-2004: Message edited by: ClickSoftware ]
Posted 20 years ago by (Anonymous)
Avatar
The easiest and most efficient way of localizing is the following which we have done:

1) Place all your strings in a XML file. That is have one NLS file (lets for simplicity call this NLS message file). Then place all your strings that need to be localized for different languages, etc., in this NLS message file. So your NLS message file would like something like this:

<MY_LIST_OF_NLS_STRINGS>
<MyTextBox1Name>Name</MYTextBox1Name>
<JobTitle>Software Engineer</JobTitle>
<FileName>File name</FileName>
<SomeTitle>The title of this page is %1</SomeTitle>
</MY_LIST_OF_NLS_STRINGS>

So in above we have 4 strings that are in the pproduct that need to be localized for different languages (i.e. MyTextBox1Name, JobTitle, FileName, and SomeTitle).

2) Develope a singleton class with a static method in it that given a XML tag name would extract its value from your NLS XML message File. So for example the signature of this class would be something like:
public static string GetMyString(string NLSMessageTagName, string[] args)
Where NLSMessageTagName simply is the XML tag in your NLS message file, and args is the list of substitution strings that will be used to replace %1, %2, %3, etc. (if any) in the extract value for the NLSMessageTagName.

3) In your code and when setting the values of any label, text, wizard caption, wizard title, etc., etc., etc., (and in general any text that needs to be localized) call the above API to set it. So for example you would say something like:

string args[] = {"Just a title"};
MyWizard.Page.Caption = GetMyString("SomeTitle", args);

Now the caption of your wizard page would be: "The title of this page is Just a title";

If you follow the above steps you do not need to worry about any .RESX translation or in fact worrying about anything about.RESX. All you would need to do is to tanslate your NLS message file, and have a version of th efile that is for English, one that is for Spanish, etc. The XML tags remain the same only their values are translated. The advantages of this is also that you do not need to re-build the entire product if you change any of the messages. All you have to do is change the message in the XML file.

Your implementation of GetMyMessage static API needs to also consider the local language under which the product is running (use VS .NET's CultureInfo for this purpose). The way you would organize your NLS message file is to place it in its respective languages directory for different languages (e.g. for US English your install will place it under en-US, or Spanish it would place it under es-ES and so forth). And then your GetMyMessage will automatically based on the info it gets from the CultureInfo locates the file, opens it once and then reads from it throughout the session that your product is running.

4) In all your GUIs make sure the Localized property is set.

Both ActiproWizard and Actipro SyntaxEdtior are NLS compliant supporting non-Unicode as well as Unicode characters (including Chinese GB character set).


And if you are worrying about the performance using an XML at runtime to retrieve NLS messages and texts, we did an extensive study of this and suffice to say that with an XML file having 100,000 strings, it takes 0.05 second to retrieve the value associated with a given NLS XML Tag. So nothing to worry about there.

Hope this helps.
Posted 20 years ago by ClickSoftware/Hagai - Tel-Aviv, Israel
Avatar
You are missing a big part of localization when you are not using the .resx files of the forms.
When you set the Localizable property of the form to true, not only captions and other text values are saved in the .resx file, but also many other property of the form and it's controls are saved. This give you the option to change the values of this properties in different language.
For example, you have a form that contains a label that is placed on the right side of a textbox, the label text is 'User:'. When you will translate the form to Bulgarian, the label will have the text ':', and you must change size of the label and the place of the text box. On the other hand, if you want to translate to right-to-left language (like Hebrew or Arabic), you must change the right-to-left property of the form, and you will probably change the location of controls on the form.
You can have all this features when you use .resx files, and edit them with WinRes.
WinRes show you the .resx content in a visual editor and let you change the values that are stored in the .resx.
You can also adopt .resx to store your own values (for example, I will use a class called 'MyClass'):
1. Add a resource file to your project, set the file name to 'MyClass.resx' and set the Build Action to Embedded Resource.
2. In the MyClass code, add a static member:
private static System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MyClass));
3. Add a static function:
internal static string GetResString(string name)
{
return resources.GetString(name);
}
4. Open the .resx and add rows. Each row contain a name ('MyMessage') and value ('This is my message').
5. Then, the code: MyClass.GetResString('MyMessage') will return the localized value of my message.
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I did a test by setting the parent Form's Localizable property to true and changing the Language to French. Then I began changing properties such as WizardPage titles and Labels on various pages. I switched back to English and the English words appeared. Switched back again to French and the French words appeared. I looked at the French resx file and saw entries for all the controls I modified, which were on numerous pages.

Then I tried adding and removing pages and that worked as expected.

I tried opening WinRes and opening the resx files but it game me an error:
Error loading the dialog. Missing the Name for the dialog or user control.

Any idea what that means? I can't open any resx files in WinRes. I have .NET 1.0.

[ 05-17-2004: Message edited by: Actipro Software Support ]


Actipro Software Support

Posted 20 years ago by ClickSoftware/Hagai - Tel-Aviv, Israel
Avatar
Bill,
Thank you for your effort.

We know that you can localize a form using the development environment, but this is not good for us since we must outsource the localization and when working this way, we must send our source code out of the company and the peoples that do the translation must have MS Visual Studio .NET installed.


On the other hand, using WinRes, we can deliver the .resx files to our translators along with our installation of the product. All that they need to install is .NET Framework 1.1 and .NET Framework SDK 1.1.
This is not acceptable for us!

You can open a .resx of a form that contains the latest version of Actipro Wizard when you are using .NET Framework 1.1.

We did not try to open our forms with .NET Framework 1.0, but we know that you must add the ActiproSoftware.Wizard.dll to the global assembly cache (GAC) to allow WinRes to load the control.

Regards,
Hagai.
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ok, I was able to see your issue now after some tweaking. It's very odd because it seems like the WinRes designer is ignoring some of the code in Wizard that displays the different pages. It also seemed like the pages collection isn't getting loaded in WinRes and therefore navigation through the pages doesn't work. Any idea why that might happen?


Actipro Software Support

Posted 20 years ago by ClickSoftware/Hagai - Tel-Aviv, Israel
Avatar
I suggest to ask Microsoft support.
In Microsoft TabControl they use the same technic, the control holds a collection of pages, and display each one of them when the tab is clicked.
Please try to solve this, we are depending on this fix for releasing our product.

Regards,
Hagai.
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I am going to write you an email. I have spent several hours today on this.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.