Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax change language

I saw in a lot of AjaxControlToolkit.resources.dll for different languages, even mine (Russian) in my bin folder so I guess that's real to change the language of my Ajax Calendar Extender.

<asp:TextBox ID="TextBox4" runat="server" oninit="TextBox4_Init" />
<ajaxToolkit:CalendarExtender ID="TextBox4_CalendarExtender" runat="server" 
  Enabled="True" FirstDayOfWeek="Monday" Format="dd.MM.yyyy" 
  TargetControlID="TextBox4" />
<br />

It's English by default

But how can I change it to my Language ? (or to the current culture language)

I've tried

<%@ Page Title="gfregrhtrhr" Language="Nemerle" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" 
CodeBehind="Report.aspx.n" Inherits="Flow_WEB_Nemerle.Report" Culture="ru-RU" UICulture="ru-RU" %>

but it made no sense for calendar :-/

by the way I have some fun in comparing my page and http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Calendar/Calendar.aspx

there I can see month names etc on Russian BUT "Today" an english >_< instead on my page month names are English and "Today" is Russian "Сегодня" ... is it phenomenon

Finally fixed by adding

<asp:ScriptManager ID="ScriptManager1" runat="server" 
EnableScriptGlobalization="true" EnableScriptLocalization="true"/>
like image 819
cnd Avatar asked Mar 24 '10 05:03

cnd


1 Answers

The components are going to work by default in the language defined in the page culture property in your page directive. This directive also fix the date format and all the culture relative parameters and preferences.

This is an example to set them work for English-United Kingdom:

<%@ Page Language="C#"  Culture="en-UK" UICulture="en-UK" %>
like image 198
backslash17 Avatar answered Nov 09 '22 08:11

backslash17