Click here to Skip to main content
15,913,221 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I have an application winform and I want to add some resource file to support multi language.
I do not know how to create and how to call the resource file if language is choosen from the list box, and how to intitialize the labels on form_load().

Please Help

regards...
Posted
Updated 4-Jan-11 0:39am
v2
Comments
Dalek Dave 4-Jan-11 6:39am    
Edited for Grammar and Readability.

See here[^].
 
Share this answer
 
v2
The process you are looking for is called "localization" and Google will help lots if you search for that, combined with "C#".
There is info on Codeproject too: .NET - Localization using Resource file[^] is one article on the subject - perhaps a little research will be a quicker way to get results in the future? :laugh:
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 2-Jan-11 16:12pm    
This is a good answer (my 5 anyway), but I think you should have mentioned globalization first.
Tamer Hatoum 3-Jan-11 13:08pm    
thank you all for your support , all was helpful but the documentation is not enough to teach how to apply .. I have done it on web application , I have created index.en.resx and index.ar.resx
and I check if the selecteditem on the check box is arabic I will assgin the cultureinfo for my recourse file .. is the same what will happen in winforms?? I want step by step how for example to asgin for a label a value in both resource files and then how on page load I will call the value from the resource file....
regards...
Dalek Dave 4-Jan-11 6:39am    
Good Call.
Please search not for "localization" along but for "globalization" and than for localization. (Introductions in regular Microsoft help are good enough). Next item would be "satellite assemblies".

You can do globalization first before you worry about localization. Getting a status of globalized development is basically keeping UI-related stuff in resources (with some thinking).

Localization of a globalized project is a trick that allows adding satellite assemblies with extra (culture-based) resources, but not touching existing code -- and this is great.
 
Share this answer
 
dear All;
I have created for the edituser form a recource file I named it edituser.en-us.resx then I add a string name : user and Value: Username.
this string the the same name of the label control .

so the edituser form I have wrote:
CultureInfo ci = new CultureInfo("en-us");
            ResourceManager LocRM = new ResourceManager("Archive.edituser", typeof(edituser).Assembly);


and then I wrote :
user.Text=LocRm.Getstring("user",ci);

but it is giving me object to null reference ...
any thing is missing ???
regards...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900