locked
Calendar .. Arabic days names RRS feed

  • Question

  • User-1230161102 posted

    Hi

    I am using the calendar control in one page of my web application. I am wondering how can I display the names of the days and months in Arabic language (e.g instead of Saturday, Sunday, ... display the corresponding arabic names)

    Regards

    Abd

    Friday, December 25, 2009 8:48 AM

Answers

  • User187056398 posted

    If you need to do it programmatically, this may be simpler: 

        protected void Button1_Click1(object sender, EventArgs e)
        {
            if (RadioButtonList1.SelectedValue == "English")
                Page.Culture = "en-US";
            if (RadioButtonList1.SelectedValue == "Arab")
                Page.Culture = "ar-SA";        
        }


     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 25, 2009 4:59 PM

All replies

  • User187056398 posted

    You can set the culture of the page the Calendar is on:

    <%@ Page Language="C#" Culture="ar-SA" 

    Friday, December 25, 2009 10:11 AM
  • User1414178881 posted

    You need to override InitializeCulture method in your page like this:

        protected override void InitializeCulture()
        {
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("ar-JO");
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture
              ("ar-JO");
            base.InitializeCulture();
        }

    Friday, December 25, 2009 10:12 AM
  • User187056398 posted

    If you need to do it programmatically, this may be simpler: 

        protected void Button1_Click1(object sender, EventArgs e)
        {
            if (RadioButtonList1.SelectedValue == "English")
                Page.Culture = "en-US";
            if (RadioButtonList1.SelectedValue == "Arab")
                Page.Culture = "ar-SA";        
        }


     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, December 25, 2009 4:59 PM
  • User-319574463 posted

    In the common data project at http://commondata.codeplex.com there is a Calendar.aspx that allows the calender control to be manually switched to different locales, one of which is Arabic simply by switching the page locale as in:

          this.Culture = this.DdlLang.SelectedValue;
          this.UICulture = this.DdlLang.SelectedValue;
          this.InitializeCulture();

    When set to Arabic the pages looks like:

    < ديسمبر 2009 >
    السبت الاحد الاثنين الثلاثاء الاربعاء الخميس الجمعة
    28 29 30 1 2 3 4
    5 6 7 8 9 10 11
    12 13 14 15 16 17 18
    19 20 21 22 23 24 25
    26 27 28 29 30 31 1
    2 3 4 5 6 7 8


    Sunday, December 27, 2009 5:40 PM