Satinder singh Satinder singh - 2 months ago 6
ASP.NET (C#) Question

Best way to make website for multiple languages

I have made a website using(, c#) and its content in English.
Now i have a requirement to make this website in such a way that is support multiple languages ie (German,French).
Lable/Textbox/ string all values will display respective selected languages
While searching i came to know there are some ways like

  • Using localization

  • Use resource file.

  • Database(every thing is saved in database for different language).

frankly speaking I am not agree with 3rd option.

I want to know which is the best way to go or is there any other better way?

Note:Current Website was built using .NET framework 4.0/ vs 2010.



Sample code i have done using resource file add global.asax

 void Application_BeginRequest(Object sender, EventArgs e)
            // Code that runs on application startup
            HttpCookie cookie = HttpContext.Current.Request.Cookies["CultureInfo"];
            if (cookie != null && cookie.Value != null)
                System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(cookie.Value);
                System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(cookie.Value);
                System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en");
                System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en");

Blog Article : How to create multilanguage website in C#