6

Is there any way to localize the Today text in ajaxToolkit:CalendarExtender?

This control localizes the day and month texts according to the culture but shows, the current date with the text Today like Today:noienbrie 20, 2009, here the month is localized but today is still in English.

Please help me as i tried the internet but haven't found any way so far.

Diogo Cardoso
  • 21,637
  • 26
  • 100
  • 138
Embedd_0913
  • 16,125
  • 37
  • 97
  • 135
  • See this related question for solutions/workarounds if your target language is not included in AjaxControlToolkit's satellite resource assemblies: https://stackoverflow.com/q/7510384/87698 – Heinzi Apr 19 '21 at 12:41

2 Answers2

2

"Today" is definitely localized in the Ajax Control Toolkit - it sounds like you are missing a satellite resource assembly.

If you have downloaded the binary distribution then in the folder where AjaxControlToolkit.dll is found (release or debug, not sure which), you should also see a whole bunch of directories named according to culture code, such as fr, zh-CHT, ja, and so on, each one containing AjaxControlToolkit.resources.dll.

You need to copy the language folders you want to your website's bin directory so that the resources will be loaded and used by the .NET runtime for the matching culture.

If you are just referencing AjaxControlToolkit.dll directly, you won't get the resource assemblies you need automatically, you have to manually include the ones you actually want.

Sam
  • 6,167
  • 30
  • 39
  • Hi Sam, thanx for ur help, i added the language resource folders to my bin directory but still the Today text is not localized. If im changing the culture the month names are getting localized but not the Today text... may be i am missing something , can you pls check it on our own machine, please ?? – Embedd_0913 Nov 20 '09 at 07:10
  • The only other thing I can suggest is to do a test page where you explicitly set Thread.CurrentThread.CurrentCulture and Thread.CurrentThread.CurrentUICulture to match a satellite resource in your bin directory (ie, "de-DE" for the "de" resource folder) - if that doesn't work, get a recent version of the toolkit from the codeplex site and try again with that. – Sam Nov 22 '09 at 22:49
2

In order to translate "Today" you must add the following attributes:

<%@ Page ... Culture="pt-PT" UICulture="pt-PT" %>

<asp:ToolkitScriptManager ... EnableScriptGlobalization="true" EnableScriptLocalization="true"></asp:ToolkitScriptManager>
Diogo Cardoso
  • 21,637
  • 26
  • 100
  • 138