Calendar language

Last post 10-13-2008 4:37 AM by ammie. 14 replies.

Sort Posts:

  • Calendar language

    01-26-2007, 7:33 AM
    • Member
      point Member
    • dabuna
    • Member since 01-26-2007, 12:21 PM
    • Germany
    • Posts 1

    Hi,

    i'm using the CalendarExtender from AjaxToolkit. My Application is only viewed in Intranet and only in Germany. But when i open the Calendar it always shows the english Names for Month.

    So how can I change to german language? I tried <globalization culture="auto" /> in web.config and EnableScriptGlobalization="true" in ScriptManager but nothing changed.

    Hope someone can help!

  • Re: Calendar language

    01-29-2007, 9:52 AM
    • Member
      6 point Member
    • MaritimeGirl
    • Member since 01-29-2007, 1:03 PM
    • Posts 5
    The only text that changes languages for me is the day name row.  The month name, the day tooltips and the "Today" footer are all displayed in English regardless of my culture setting.  I'm trying to create my own custom version of the CalendarExtender to fix those bugs, using the sourcecode from the toolkit.
  • Re: Calendar language

    01-29-2007, 10:12 AM
    • Member
      2 point Member
    • topo13
    • Member since 12-14-2006, 10:14 AM
    • Posts 9

    Hi,

    to solve this problem you must modify the source code.

    In particular, you must substitute this line in file CalendarBehavior.js:

    1) this._title.innerHTML = visibleDate.format("MMMM, yyyy"); with

    this._title.innerHTML = visibleDate.localeFormat("MMMM, yyyy");

    2) dayCell.title = currentDate.format("D"); with

    dayCell.title = currentDate.localeFormat("D");

    3) this._today.innerHTML = "Today: " + todaysDate.format("MMMM d, yyyy"); with

    this._today.innerHTML = "Today: " + todaysDate.localeFormat("MMMM d, yyyy");

    Unfortunately, the string "Today" is mapped into the js file and it not parametrized.

    Bye

  • Re: Calendar language

    01-29-2007, 11:48 AM
    • Member
      22 point Member
    • VTP
    • Member since 01-29-2007, 4:44 PM
    • Posts 11

    Hi,

    I am also using the control for my application which is based on localisation. But Even if changeing the code above in .js file the months and weekdays name are not converting according to culture.

     Please guide .

    thanks in advance.

     

  • Re: Calendar language

    01-29-2007, 12:42 PM
    • Member
      22 point Member
    • VTP
    • Member since 01-29-2007, 4:44 PM
    • Posts 11

    Thanks mate

    I set Scriptmanger1.EnableGlobalisation = true

    and changed the code above in calenderbehaior.js file

    all text is converted now.

     

     

  • Re: Calendar language

    01-29-2007, 1:00 PM
    • Member
      547 point Member
    • rbuckton
    • Member since 10-28-2002, 7:56 AM
    • Washington, DC
    • Posts 124
    We should have the changes for the localization into the dev branch today.  As far as localizing the text, we haven't gotten far enough with the Toolkit that we've begun localizing text strings just yet but we're working on it.
    Ron A. Buckton
    Senior Consultant
    Microsoft
  • Re: Calendar language

    01-30-2007, 9:50 AM
    • Member
      40 point Member
    • cruentus
    • Member since 06-02-2006, 2:25 PM
    • Sao Paulo, SP, Brazil
    • Posts 21
    VTP:

    Thanks mate

    I set Scriptmanger1.EnableGlobalisation = true

    and changed the code above in calenderbehaior.js file

    all text is converted now.

    Any way of set this in web.config or somewhere else? I really don't want to set it in all ScriptManagers on my website...

    Thanks a lot. 

    Rafael Soares
    Web Developer
    ASP.NET / C# / (X)HTML / CSS / JavaScript
    http://rafasoares.wordpress.com
    (sorry, blog is just in portuguese... english site coming soon! ;] )
  • Re: Calendar language

    01-30-2007, 10:02 AM
    • Member
      16 point Member
    • Paulo Correia
    • Member since 11-21-2005, 3:27 PM
    • Barreiro, Portugal, Europe
    • Posts 11

    Hi,

    I have created my own ScriptManager, that inherits from the System.Web.UI.ScriptManager and in the constructor i setup the default options that i read from the Web.Config.

     Hope it helps

    Paulo Correia
     

  • Re: Calendar language

    01-30-2007, 10:10 AM
    • Member
      40 point Member
    • cruentus
    • Member since 06-02-2006, 2:25 PM
    • Sao Paulo, SP, Brazil
    • Posts 21

    Another question:

    I need to escape de "d" character (the output must be "30 de <month>"). I tried "dd \de MMMM" but it still showing "30 30e  <month>"...

    Thanks again...
     

    Rafael Soares
    Web Developer
    ASP.NET / C# / (X)HTML / CSS / JavaScript
    http://rafasoares.wordpress.com
    (sorry, blog is just in portuguese... english site coming soon! ;] )
  • Re: Calendar language

    01-30-2007, 11:26 AM
    • Member
      40 point Member
    • cruentus
    • Member since 06-02-2006, 2:25 PM
    • Sao Paulo, SP, Brazil
    • Posts 21

    Hey, I've just put the "de" between single quotes, like this: "dd 'de' MMMM" and worked fine.

    Rafael Soares
    Web Developer
    ASP.NET / C# / (X)HTML / CSS / JavaScript
    http://rafasoares.wordpress.com
    (sorry, blog is just in portuguese... english site coming soon! ;] )
  • Re: Calendar language

    01-30-2007, 12:03 PM
    • Member
      44 point Member
    • nvivo
    • Member since 04-14-2006, 9:01 PM
    • Posts 14
    We should have the changes for the localization into the dev branch today.  As far as localizing the text, we haven't gotten far enough with the Toolkit that we've begun localizing text strings just yet but we're working on it.

    Great. But couldn`t this be made a property, pretty much like asp:Login control works?

    Create a "CurrentDateLabel" or something like it with default value of "Today: ", and after localization, it will use the default text for the current culture, so we can change it now and it is pretty much the way asp.net works.

     

     
     

  • Re: Calendar language

    01-31-2007, 2:17 PM
    • Member
      66 point Member
    • lambi_uk
    • Member since 09-22-2005, 12:12 PM
    • London
    • Posts 22

    Mate, you're an absolute star ! Big Smile

    I was looking for a solution as I need to localise the calendar to French and thanks to your code and don't forget to set EnableScriptGlobalization="true" in the ScriptManager, everything works like a charm. Just got rid of "Today: " all together, it still makes sense.

    This new ajax control toolkit is going to be everywhere on my future websites...

    Glad to see some amazing work being done to make the web a better place. I really like this new ajax stuff, it's brilliant!!! 

    I've been spending days coming up with good calendar controls in the past being a web developer since 1999... no more of this! 

    THANK YOU 

    Etienne
  • Re: Calendar language

    02-01-2007, 7:42 AM
    • Member
      5 point Member
    • leosoft
    • Member since 01-25-2007, 1:21 PM
    • Posts 6

    To solve the problem of "Today" is to add a property :

     in cs file, add

    [

    DefaultValue("Today")]
    [
    ExtenderControlProperty]
    [
    ClientPropertyName("todayCaption")]
    public virtual string TodayCaption
    {
    get { return GetPropertyValue("TodayCaption", "Today"); }
    set { SetPropertyValue("TodayCaption", value); }
    }


    in js file, after the initializeBase() call, add

    this._todayCaption = "Today";

     

    in js file, after the set_cssClass function, add

    get_todayCaption :

    function() {
    /// <value type="String">
    /// The caption for Today's date
    /// </value>
    return this._todayCaption;
    },

    set_todayCaption :

    function(value) {
    if (this._todayCaption != value) {
    this._todayCaption = value;
    }
    },

     

    and replace

    this._today.innerHTML = "Today: " + todaysDate.localeFormat("MMMM d, yyyy");

    with

    this._today.innerHTML = this._todayCaption + ": " + todaysDate.localeFormat("MMMM d, yyyy");

     

    That's all and you can change the TodayCaption propety in VS.

    You can do the same with the date format of today "MMMM d, yyyy");

    Lionel

  • Re: Calendar language

    02-01-2007, 1:17 PM
    • Member
      66 point Member
    • lambi_uk
    • Member since 09-22-2005, 12:12 PM
    • London
    • Posts 22
    Now, that's just the cherry on the cake, thanks for the code Lionel! Party!!!
    Etienne
  • Re: Calendar language

    10-13-2008, 4:37 AM
    • Member
      3 point Member
    • ammie
    • Member since 10-10-2008, 9:02 AM
    • Posts 9

    this._today.innerHTML = "Today: " + todaysDate.localeFormat("MMMM d, yyyy");

    with

    this._today.innerHTML = this._todayCaption + ": " + todaysDate.localeFormat("MMMM d, yyyy");

     

    what file?

Page 1 of 1 (15 items)