sproctor / php-calendar

PHP-Calendar
http://www.php-calendar.org/
Apache License 2.0
140 stars 67 forks source link

Gettext problem #85

Closed reegoon closed 10 years ago

reegoon commented 10 years ago

Hello. I get this error when when I wont to delate event.

Fatal error: Call to a member function gettext() on a non-object in /home/xxxxx/domains/xxxx.xxx.pl/public_html/kalendarz2/includes/calendar.php on line 33

sabas commented 10 years ago

I suppose it's caused by setup.php which includes calendar.php on line 51 but instantiates the Gettext object on line 202...

reegoon commented 10 years ago

Funny thing. When I change the language I delete an event, but only one, and then error appears again.

sproctor commented 10 years ago

The function is defined when it includes calendar.php on line 51, not called. It isn't called until the delete event happens. It's probably in setup.php line 81, or possibly 122 or 130. I'm not sure how to handle those.

sproctor commented 10 years ago

In calendar.php line 30, make it look something like:

function __($msg) {
        global $phpc_gettext;

        if (empty($phpc_gettext))
                return $msg;

        return $phpc_gettext->gettext($msg);
}

That won't fix your problem, but it will at least let the error message through in English. Post that here and I'll see if I can figure it out.

reegoon commented 10 years ago

Works fine, no problems now