Thursday, August 13, 2009

Ajax Culture Sys.CultureInfo (Ajax em Português)

 

How to change the ajax culture to a new one?

1. Save a copy of MicrosoftAjax.js ( you can find it on System.Web.Extensions thru Reflector tool)

2. Put it in the web server, in my case “/scripts”

3. Duplicate the file and rename it to MicrosoftAjax.PT-pt.js

4. Edit the file MicrosoftAjax.PT-pt.js and do some replace of strings (ex: month names)

5. Edit the ScriptManager (The value “PT-pt” from the ResourcesUICultures attribute is used to get the MicrosoftAjax.PT-pt.js)

<asp:ScriptManager ID="ScriptManager" runat="server" EnableScriptLocalization="true" EnableScriptGlobalization="true">
<Scripts>
    <asp:ScriptReference Name="MicrosoftAjax.js" Path="~/Scripts/MicrosoftAjax.js" ResourceUICultures="PT-pt" />
</Scripts>
</asp:ScriptManager>

 

Ref: http://msdn.microsoft.com/en-us/magazine/cc135974.aspx

and http://msdn.microsoft.com/pt-br/magazine/cc135974.aspx

You are done.

No comments: