Jump to:

10851 Posts in 2517 Topics by 1793 members

All other Modules

SilverStripe Forums » All other Modules » Event Calendar – Fully localised

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 2157 Views
  • Juanitou
    Avatar
    Community Member
    322 Posts

    Event Calendar – Fully localised Link to this post

    Hi!

    Now that it is known that UncleCheese likes the French language, I think we could try and get a fully localised event_calendar module. My little contribution is the attached fr_FR.php file (not fully tested).

    Hélas, this file does not contain all translatable and localisable information: for example, jquery.datePicker.js contains some text in an array called dpText (where the texts Show entire month and Show week were forgotten).

    I can translate those strings for a monolingual site, but can we modify those JS files and add _t() functions for multilingual sites? If somebody explains me how to properly do it I’ll be happy to complete the task.

    Also, the CalendarWidget shows dates in the 'yyyy-mm-dd' format in the hover tooltip (associated to the title attribute) and I’ve not been able to change it. It’d be nice if it followed the _config.php parameters.
    EDIT: I’ve found it, I’m attaching the JS file for French users, while waiting for some assistance before providing it fully localised.
    NOTE: Please discard the first php and js files, replacing files in this SS forum does not work.

    Cordialement,
    Juan

    Attached Files
  • Juanitou
    Avatar
    Community Member
    322 Posts

    Re: Event Calendar – Fully localised Link to this post

    Well, I think I did not research enough on the matter… since there is a LiveCalendarWidget that seems more adapted to localisation…

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar – Fully localised Link to this post

    Yeah, that was one of the major goals with the LiveCalendarWidget was to get more control over i18n and give users a template they can customize. Thanks for your efforts, here. EventCalendar is in dire need of some i18n work. You can never have too much localization with something like date display.

  • Juanitou
    Avatar
    Community Member
    322 Posts

    Re: Event Calendar – Fully localised Link to this post

    Talking about localization of LiveCalendarWidget, after much trial and error, I’ve been able to change the first day of the week from Sunday to Monday, as Europeans prefer.

    Also, I’ve changed the format of week days from 3 letters to 1 and removed the trailing zero in numbers, as in CalendarWidget.

    These are ugly hacks, but if someone needs it…

    Now, if I only managed to find in the forum the solution to:

    uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: http://localhost/iac/event_calendar/javascript/jquery-1.2.6.min.js?m=1237479890 :: anonymous :: line 22" data: no]


    …when changing months in a LiveCalendarWidget located in my home page…

    EDIT: This error only appears in Firefox!!! In IE7 I can cycle through the months… Any ideas?

    Best regards,
    Juan

  • Juanitou
    Avatar
    Community Member
    322 Posts

    Re: Event Calendar – Fully localised Link to this post

    Removing <?xml version="1.0" encoding="UTF-8"?> at the top of my Page.ss solves the problem. Somebody knows why and how to solve in a better way?

  • Juanitou
    Avatar
    Community Member
    322 Posts

    Re: Event Calendar – Fully localised Link to this post

    My hack for getting weeks starting on Mondays works… as long as the month does not start on Sunday!, for example next November. In this cases, the rendered month starts in the following day: Monday the 2nd.

    I’ve been playing around these lines (182-192) of CalendarUI.class.php:

    private function getWeeks()
    {
    $weeks = new DataObjectSet();
    $today = new sfDate();
    $today->clearTime();
    $this->date_counter->firstDayOfMonth()->firstDayOfWeek();
    // addDay() in following line for starting weeks on Monday, but it does not show the first day of the month if it’s Sunday. There are other places to do it.
       $view_start = new sfDate($this->date_counter->addDay()->get());
    $view_end = new sfDate($view_start->addDay($this->rows*7)->subtractDay()->get());
    $view_start->reset();
    $this->start_date->reset();

    And tried also changing the constants in sfTime.class.php, with no avail. Could some European good soul help me, please?

    Thanks in advance,
    Juan

    Attached Files
  • ataxel
    Avatar
    Community Member
    3 Posts

    Re: Event Calendar – Fully localised Link to this post

    Thank you for this contribution of translation and help.
    I fully appreciate this work that i needed.

  • Juanitou
    Avatar
    Community Member
    322 Posts

    Re: Event Calendar – Fully localised Link to this post

    Hi ataxel!

    Thanks, but don’t expect too much of my work: ugly hacks and ugly results:
    – I’ve not been able to resolve the problem with months starting on sundays.
    – I can’t use LiveCalendarWidget in Firefox without changing the main template (the xml declaration).
    – I can’t customise Content with LiveCalendarWidget (http://www.silverstripe.org/widgets-2/show/272318#post272318).
    – I can’t fully use LiveCalendarWidget for specific events (http://www.silverstripe.org/all-other-modules/show/272427#post272427).

    Any ideas?

    Regards,
    Juan

    2157 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.