C#: Language not supported in Ajax Control Toolkit? No problem, do localization by yourself
In my projects I often have to implement user interface in two languages: English and Polish. Although localization in .NET is quite easy, one thing was annoying to me: AjaxControlToolkit doesn’t support Polish language.
When my user choose Polish language on the webpage then he still see in Calendar control ‘Today’ word instead Polish version (‘Dzisiaj’). Same thing for several other controls, for example PasswordStrength control. So one day I decide to correct this once and for all. Below I will show you how to localize Ajax Control Toolkit.
To localize AjaxControlToolkit to our langauge (Culture) we will have to do few simple steps. In below examples I use library version for .NET 2.0 but the same steps are in case of Ajax Control Toolkit for .NET 3.5
First step, download library source from http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27326
Unzip, and open in Visual Studio AjaxControlToolkit project which is located in directory AjaxControlToolkit in zip file.

Make a copy of ScriptResources.resx resource file (this is a English culture). Rename it to your culture. For example, Polish culture is pl-PL so the filename will be ScriptResources.pl.resx (I will use this name in all examples)

Open ScriptResources.pl.resx file and translate everything or just particular sentences.

When you finish, choose from menu Unload Project

and edit project file

Find the line:
<EmbeddedResource Include="ScriptResources\ScriptResources.pl.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
Change to:
<EmbeddedResource Include="ScriptResources\ScriptResources.pl.resx" Condition=" '$(Configuration)'=='Release' ">
<SubType>Designer</SubType>
</EmbeddedResource>

If you don’t use other languages then you can safely delete all other resource references (except English and your Culture) like Portugal for example:
<EmbeddedResource Include="ScriptResources\ScriptResources.pt.resx" Condition=" '$(Configuration)'=='Release' "> <SubType>Designer</SubType> </EmbeddedResource>

You can always add them in the future. Save changes and Reload project:

Now a little bit of cosmetic (you don’t have to do that but I recommend it for better organization). Go to Project Properties, choose from left menu, Build and change Confguration to Release. Change Output Path for some new folder. Save changes.

Ok, we almost finished. Now, compile project in Release mode. 
As a result you will find in output directory our localized AjaxControlToolkit library.


We can add it to our Visual Studio toolbox:

If we drag any control to our page then AjaxControlToolkit library will be copied to our bin project directory. For existing projects we have to delete old reference and add our localized version.

That’s all, we have Polish language in Ajax Control Toolkit. No more exceptions like ‘Today’ word in Calendar control and other english words in our well localized ASP.NET application :)

(647)


wow! that’s realy cool story!!! thanks