February 2003 - Posts

Localizing a form with winres.exe

By the way in my last blog, I discussed on Setting an empty string. I showed it only for declaration, that's why I kept it as setting an embty string and it's not good in using condition operations.
 Also if you did not read, please read Donsmith, Deepak sharma comments for that blog. Quite useful!!

Localizing a form with winres.exe

Before doing anything else, I recommend choosing File->Save As to choose a culture. The culture will be used to form a culture-specific name for the .resx file. For example, LocalizedForm1.resx
will be saved as LocalizedForm1.en-US.resx for the US English culture. After saving the culture-specific .resx file, make the culture-specific changes and save again.

Once you’ve got the set of culture-specific .resx files for an assembly, you can bundle them together into a set of .resources files, and then into a culture-specific resource file. To execute resgen.exe
on more than one .resx file at a time, use the /compile switch:

C:/> resgen.exe /compile Form1.en-US.resx Form2.en-US.resx ...

Running resgen.exe in this manner will produce multiple .resources files, one per .resx file. You bundle the produced .resources file together into a single resource assembly using the assembly linker, al.exe:

C:/> al.exe /out:en-US\App.resources.dll /culture:en-US /embedresource:Form1.en-US.resources,App.Form1.en-US.resources /embedresource:Form2.en-US.resources,App.Form2.en-US.resources ...

The al.exe /out argument determines the name of the resource DLL. Notice that the sample puts the resource assembly into the en-US subfolder, where the resource manager will look for U.S. English-specific resources. The /culture argument determines the culture of the produces resource assembly and must match the culture name for the resources you’re building. The /embedresource arguments provide the .resources files along with the alternate names to match the names that the resource manager will look for (don’t forget the form’s namespace!).

Hope this helps!!!

Posted by SreedharK with 2 comment(s)

Tip on setting an empty string:

Tip on setting an empty string.  

C#:

Old approch:       string StranEmpty = "";  
Better approch   string StranEmpty = String.Empty;

VB.NET

Old approch:    Dim StranEmpty As String = ""
Better approch: Dim StranEmpty As String = String.Empty

Hope this helps :)

Posted by SreedharK with 4 comment(s)

My First Blog!!!

First thanks to Scott Watermasysk, when I asked, he immediately created and given this blog for me!!!.

Hope I will use this Blog well!!
Also I hope this will be useful for .Net floks who are looking for some good .Net Tips.

 

Posted by SreedharK with 1 comment(s)
More Posts