Last post Jun 20, 2017 04:05 AM by hkholakiya
Apr 09, 2017 12:08 PM|JAYHAWKER|LINK
I can go to settings in the browser, change the default language, exit the browser, and then reload it and the browser default language is then working in the newly selected language. I can then click translate and the page translates the text from one
language to another. How can I do all of this programmably?
Apr 09, 2017 12:30 PM|mgebhard|LINK
You need learn how ASP localization and globalization works.
IN ASP, resource files are populated with the language content to be displayed on page. This is manual process. Basically you need to the language translations ahead of time.
Browsers automatically send the user's culture setting in the HTTP header; it looks like en-US.
If you setup ASP localization and globalization, the ASP framework will see the header and grab the resource file that goes with the requested resource (the web page) and use it to populate the labels (or any control) on the page.
Jun 20, 2017 04:05 AM|hkholakiya|LINK
From your C# set below property in your page load or init event:
Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo("en-US")
Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo("en-US")
Sometimes calender controls not converted as per selected language for that make below changes in your aspx page:
<ajax:ToolkitScriptManager ID="tsm" runat="server" EnableScriptGlobalization="false" EnableScriptLocalization="true" EnablePartialRendering="true"></ajax:ToolkitScriptManager>
Refresh the page.
Hope it will help you.