Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

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

Event Calendar – Fully localised


Go to End
Reply

12 Posts   2338 Views

Avatar
Juanitou

24 October 2009 at 3:34am (Last edited: 24 October 2009 4:03am), Community Member, 323 Posts

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
Avatar
Juanitou

24 October 2009 at 4:27am Community Member, 323 Posts

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

Avatar
UncleCheese

24 October 2009 at 4:59am 4085 Posts

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. :)

Avatar
Juanitou

24 October 2009 at 10:08am (Last edited: 24 October 2009 10:34am), Community Member, 323 Posts

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

Avatar
Juanitou

24 October 2009 at 10:56am Community Member, 323 Posts

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?

Avatar
Juanitou

24 October 2009 at 12:00pm (Last edited: 24 October 2009 12:03pm), Community Member, 323 Posts

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
Avatar
ataxel

30 October 2009 at 5:17am (Last edited: 30 October 2009 5:27am), Community Member, 3 Posts

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

Avatar
Juanitou

3 November 2009 at 5:23am (Last edited: 3 November 2009 6:03am), Community Member, 323 Posts

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 ([url]http://www.silverstripe.org/widgets-2/show/272318#post272318[/url]).
– I can’t fully use LiveCalendarWidget for specific events ([url]http://www.silverstripe.org/all-other-modules/show/272427#post272427[/url]).

Any ideas?

Regards,
Juan

Go to Top