date localization using the ajax calendarextender

  • Thread starter Thread starter Carlos
  • Start date Start date
C

Carlos

Hi all,

I would like to create a web app available in English, and Spanish.
I started out by trying to get the correct format of the date in case that the language
settings in the browser are set to Spanish, and for that I am capturing it
inside the InitializeCulture(), i.e.:

protected override void InitializeCulture()

{

languages = Request.UserLanguages;

if (languages != null)

{

Thread.CurrentThread.CurrentCulture =

CultureInfo.CreateSpecificCulture(languages[0]);

Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(languages[0]);


}

base.InitializeCulture();

}

However, when I use the AJAX calendar extender control, it renders the calendar in

English, and places the picked date into the designated textbox in US-EN default

format. Is there any way to make it render, and display in the captured culture?

Thanks!



Carlos.
 
Hi all,

 I would like to create a  web app available in English, and Spanish.
I started out by trying to get the correct format of the date in case that the language
settings in the browser are set to Spanish, and for that I am capturing it
inside the InitializeCulture(), i.e.:

protected override void InitializeCulture()

{

languages = Request.UserLanguages;

if (languages != null)

{

Thread.CurrentThread.CurrentCulture =

CultureInfo.CreateSpecificCulture(languages[0]);

Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(languages[0]);

}

base.InitializeCulture();

}

However, when I use the AJAX calendar extender control, it renders the calendar in

English, and places the picked date into the designated textbox in US-EN default

format. Is there any way to make it render, and display in the captured culture?

Thanks!

   Carlos.

Try to set the ScriptManager.EnableScriptGlobalization to True. Plus
take a look at the following article, where you can see more
information on this

http://lancezhang.wordpress.com/2009/01/09/change-culture-calendarextender/

Hope this helps
 
That did it. Thanks Alexey.

Hi all,

I would like to create a web app available in English, and Spanish.
I started out by trying to get the correct format of the date in case that
the language
settings in the browser are set to Spanish, and for that I am capturing it
inside the InitializeCulture(), i.e.:

protected override void InitializeCulture()

{

languages = Request.UserLanguages;

if (languages != null)

{

Thread.CurrentThread.CurrentCulture =

CultureInfo.CreateSpecificCulture(languages[0]);

Thread.CurrentThread.CurrentUICulture =
CultureInfo.CreateSpecificCulture(languages[0]);

}

base.InitializeCulture();

}

However, when I use the AJAX calendar extender control, it renders the
calendar in

English, and places the picked date into the designated textbox in US-EN
default

format. Is there any way to make it render, and display in the captured
culture?

Thanks!

Carlos.

Try to set the ScriptManager.EnableScriptGlobalization to True. Plus
take a look at the following article, where you can see more
information on this

http://lancezhang.wordpress.com/2009/01/09/change-culture-calendarextender/

Hope this helps
 
Back
Top