60000089 Globalization of Resources

Article 60000089
Type HowTo
Product Engine
Version 6
Date Added 3/22/2007
Fixed (3/22/2007)
Submitted by stavros meimaroglou

Summary

Globalization of Resources added in 6005

Solution


Version 6 .NET component can be localized in any language. Basically the words that are being localized are the prompt messages , the grid property names and also the forms.
If a customer wants to localize his VectorDraw component can contact with us and we will provide the following:
1) vdRes.txt
Is a text document in english that contains all prompt messages and also all property names that are being displayed in the property list. There he can translate these messages in any language.
2)vdFormsRes.dll,vdFormsRes project
vdFormsRes is a project that contains all forms of vectordraw, in english too. In this project all labels and buttons can be localised. Also someone can change the appearence of the forms.

For globalization in vdRay
We will provide the vdRayResources project that produces the vdRayResources.dll. The customer can alter the strings in the form and build it (in release not debug). The generated vdRayResources.dll file should be copied in the same folder as vdRay.dll file or in the same folder of your executable (this is reccomended in the Dev. machine as the vdRay.dll in the Dev machine is in GAC). Then in your project that uses the vdRay component you add this line of code in the Form_Load of your application : vdRay.vdRayGlobals.ResourcesDllName = “vdRayResources.dll”;

Limitations:
-The constants in the property grid cannot be changed (e.g. PlFlagOPEN ,PlFlagCLOSE constant of the polyline's flag property cannot be localized).
-You cannot add new buttons,labels at the vdFormsRes.

New method added to get/set resource directory for commands.txt,menu.txt,vdres.txt


VectorDraw.Serialize.Activator.GetResourcesDirectory

You can set the Resources Directory as following

VectorDraw.Serialize.Activator.SetResourcesDirectory(@"C:\Temp\");

VectorDraw.Serialize.GlobalizedDictionary.Dictionary = new VectorDraw.Serialize.GlobalizedDictionary (@"C:\Temp\vdres.txt");

This directory is set by application ( when the application is loaded) and the component searches this directory for the resource files Commands.txt,Menu.txt vdres.txt.

Also in vdres.txt if the first name represent a property name and the second value is '-' then the property is hidden from property grid.

If you want to use the vdFormsRes.dll in order to load your own forms then you should set the directory that this dll is located in the vdres.txt at GlobalizedFormsDirectory whith full path and dll name at the beginning of the text document.Set the directory as following:

GlobalizedFormsDirectory^C:\Temp\vdFormsRes.dll

Send comments on this topic.