Jump to:

10928 Posts in 2612 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » Event Calendar and locale

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 4959 Views
  • alexanm
    Avatar
    Community Member
    38 Posts

    Event Calendar and locale Link to this post

    Hello,

    I am using the Event Calendar module, and I really like it. The only problem I have, is that it uses the english day and month names and also the am/pm time format. Is there anything I can do, so that I have the german versions of these items?

    TIA
    Markus Alexander

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar and locale Link to this post

    Is your locale set to de_DE? The module should include a /lang/de_DE.php

    There's a lot you can do to customize your date display. By default, the calendar will fall back on your lang file to get the date display format for your locale. If you want to customize it, you can specify an override in the $customDateDisplay array that comes with event_calendar/_config.php.

    I know it's a huge thread, but we developed this recently in the Preview: Event Calendar Module thread. You may have to go back several pages. I worked with a German user, Banal, to develop the localization. That's the best source of documentation we have for it right now, unfortunately. I hope to get it into the wiki soon. If you're having trouble with it, just paste your code and I can help you out.

  • baba-papa
    Avatar
    Community Member
    279 Posts

    Re: Event Calendar and locale Link to this post

    Hello Alexanm,

    I use the latest release of UncleCheese´s module and I had the same problems as you. I tweeked the two files that he metioned and now the calendar is perfectly in german text and date format. I suggest you just override your existing files with my appended files and your done.

    hf gl

    Attached Files
  • alexanm
    Avatar
    Community Member
    38 Posts

    Re: Event Calendar and locale Link to this post

    Hello Uncle Cheese,

    yes my locale is set to de_DE, and yes I have added the language file for the de_DE locale. The dates and times themself are shown in the german format eg.: dd.mm.yyyy. The Problem I have is, that the month names are in english. It says May instead of Mai. And it says 08:00pm instead of 20:00. This are the things I'd like to get rid of.

    I have just downloaded the latest trunk version and replaced the files as suggested by baba-bapa. Ok his file changes the date display form showing the month names to only showing the number (01.5.2009 instead of 01. May 2009), but that not a solution for the time display or the month names showed in the filters.

    I have reead somewhere, that you also have to change the locale of php itself by using the setlang function. I did it, but there was no change in the date display.

    Any other ideas?

    When you go to http://www.government-first.at/appointments you can see what I mean.

    TIA
    Markus Alexander

  • alexanm
    Avatar
    Community Member
    38 Posts

    Re: Event Calendar and locale Link to this post

    Hello baba-bapa,

    are you sure that with your configuration, the dates are shown with the german names? I have checked out the latest version of the event calendar and put in your files. But the month names remained for example May instead of Mai. And the time says 08:00pm instead of 20:00. Are there any other things to do (As I already asked in my previous answer to UncleCheese' post)?

    Tanks
    Markus Alexander

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar and locale Link to this post

    Hi, guys,

    My apologies.. It looks like the de_DE.php lang file was never checked into SVN. Run an update and see if that helps you out. My understanding is that if you have your locale set to de_DE, you shouldn't have to do any overrides to get German date formatting and language. I'm going to test it in a moment to be sure.

    As for times, by default, the $_Times function runs the .Nice() format. You can change that by using your own

    $StartTime.Format(h:i:s) $EndTime.Format(h:i:s) or whatever you want to use.

    Just be sure that you're making the changes in your mysite/templates directory and not in event_calendar, so that you can upgrade the module without overwriting any of your changes.

  • baba-papa
    Avatar
    Community Member
    279 Posts

    Re: Event Calendar and locale Link to this post

    Hello Alexamn,

    sorry, I realized that I did a lot more changes to the source code. Some changes have to be done in the template files as well. It took me a long time to search. Maybe you try my hole module. It might be, that I changed some objects of sapphire.

    @UncleCheese

    Thanks for all your work. Your module is great and always getting better. I will download your latest de_DE.php.

    Attached Files
  • FnC/odontodactylus
    Avatar
    Community Member
    7 Posts

    Re: Event Calendar and locale Link to this post

    Hi folks,

    dont know whether I should have started a new thread for this...

    It seems to me that Event Calendar currently does not check whether Translatable is being used, but uses the default locale instead. I came across this on a site with German as default language, where I added an supposedly English translation. So on my English calendar, phrases like the RSS subscription link and "There are no upcoming events" are still in German.

    Cheers!

    Attached Files
    4959 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.