.NET (295) administrative (41) Ajax (42) AngularJS (2) ASP.NET (144) bicycle (2) books (180) browser (8) C# (133) cars (1) chess (28) CodePlex (10) Coma (8) database (47) deployment (3) Entity Framework (2) essay (110) flash/shockwave (2) flex (1) food (3) friend (2) game (20) idea (5) IIS (8) javascript (82) LInQ (2) Linux (6) management (4) manga (42) misc (669) mobile (1) movies (90) MsAccess (1) murder (2) music (64) mysql (1) news (99) permanent (1) personal (68) PHP (1) physics (2) picture (307) places (12) politics (13) programming (501) rant (120) religion (3) science (43) Sharepoint (3) software (58) space (1) T4 (2) technology (11) Test Driven Development (4) translation (2) VB (2) video (97) Visual Studio (44) web design (45) Windows API (8) Windows Forms (3) Windows Server (4) WPF/Silverlight (63) XML (11)

Friday, October 24, 2008

Globalization and Localization for AjaxControlToolkit controls

I had this calendar extender thingie in my site and the client was Italian so I had to translate it into Italian. Nothing easier. Just enable EnableScriptGlobalization and EnableScriptLocalization and set either the Web.config or Page culture settings.

However, the footer of the calendar kept showing "Today" instead of "Oggi". I checked the source and I noticed that it used a AjaxControlToolkit.Resources.Calendar_Today javascript variable to create the footer. Step by step I narrowed it down to the AjaxControlToolkit resources! Funny thing is that they didn't work. I tried just about everything, including Googling, only to find people having the opposite problem: they would have all these resource dlls created in their Bin directory and couldn't get rid of them. I had none! I copied the directories from the ACTK and nothing happened.

After some research I realized that the Ajax Control Toolkit does NOT include the option for multi language UNLESS in Release mode. I was using everything in the solution, including the ACTK, in Debug mode. Changing the build to Release in the solution made this work.

8 comments:

sombody said...

hy,

one question. Did you manage to translate "Today"?
In my case the localization works but today in fotter is always in eng.

Siderite said...

Yes I could, read the post. Use the Release version of Ajax Control Toolkit. It should have all the language DLLs in the bin directory.

sombody said...

I'm using 30512 release and the today is today :(( in all lang. Sould I use another release?20820....

One another thing,is it posebel to show 2 months ?

Siderite said...

I don't know. It worked for me. Are you using the source for ACT or just the binaries? Do you have the language dlls in the proper directories?

And I don't think you can show two months unless you do some js work. But I wouldn't know, I haven't tried it.

Henrik said...

Setting both EnableScriptLocalization="true" EnableScriptGlobalization="true" in the ScriptManager worked for me.

Anonymous said...

Setting both EnableScriptLocalization="true" EnableScriptGlobalization="true" didnt work for me..it is working in asp.net environment but not on sharepoint..i m able to translate today with localiation files but month and days are not getting localized

Anonymous said...

Hi everybody,

I have managed this, Today is Hoy in my Calendar. At last. Release mode must be selected in VS 2005.
In Debug mode .dll only for de is generated (???)
I have managed... But...
But my biscuits are burned totally!!!
Gosh! I like programming!
Never mind...

Siderite said...

See, kids? That's what happends when you use drugs while you code! :D