Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
I have combobox on main form with two items in it, ENGLISH and SERBIAN, basically if I choose SERBIAN my labels on main form change some english words to serbian words

this is the code

C#
private void cmbLanguage_SelectedIndexChanged(object sender, EventArgs e)
        {            
            if (cmbLanguage.SelectedIndex.Equals(1))
            {
                label1.Text = "INFO ALARM";
                label2.Text = "INFO ALARM";
                label3.Text = txtdatahistory.Text + "\n" + "OTVORENO\n" + Activity2BS.Count;
                label4.Text = txtstoragehistory.Text + "\n" + "OTVORENO\n" + Activity3BS.Count;
            }
            else
            {
                
            }
                
        }


now as you can see when I get back to english I want to return to english words

like this

C#
label1.Text = "INFO WARNING";
                label2.Text = "INFO WARNING";
                label3.Text = txtdatahistory.Text + "\n" + "OPEN\n" + Activity2BS.Count;
                label4.Text = txtstoragehistory.Text + "\n" + "OPEN\n" + Activity3BS.Count;



but it doesnt, point is this is small part of the code and I really dont want to type aaaallll of that code to return ti english, how to make it on else statement to return back to previous state of language because on form load is english by default
Posted
Updated 16-Sep-12 22:02pm
v2

1 solution

Well this is not the right way of managing the localization and globalization. Try setting up the localisation as described here and then you will not need to manually take care about this things anymore.

Allow users to select the user interface language in your ASP.NET Web application[^]

also this text is a good reading:

Delivering Software to a Global Audience[^]

Cheers
 
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