Hi,
I am not very good at PHP and am trying to install a script but I have this problem that I just can't figure out...
Code snippet:
<?php
// UTF-8 helper functions
require(dirname (__FILE__) .'/includes/utf8.php');
include('Mail.p hp');
// Translation
require(dirname (__FILE__) .'/includes/php-gettext/streams.php');
require(dirname (__FILE__) .'/includes/php-gettext/gettext.php');
$input = new FileReader(dirn ame(__FILE__) .'/locales/'. $locale .'.mo');
$l10n = new gettext_reader( $input);
// Standard wrappers for xgettext
function T_($text) {
global $l10n;
return $l10n->translate($tex t);
}
function T_ngettext($sin gle, $plural, $number) {
global $l10n;
return $l10n->ngettext($sing le, $plural, $number);
}
PHP throws 'Fatal error: Call to a member function on a non-object ..
functions.inc.p hp on line 16' at me whenever I request this page.
Code at line 16: return $l10n->translate($tex t);
What am I doing wrong?
Thanks!
I am not very good at PHP and am trying to install a script but I have this problem that I just can't figure out...
Code snippet:
<?php
// UTF-8 helper functions
require(dirname (__FILE__) .'/includes/utf8.php');
include('Mail.p hp');
// Translation
require(dirname (__FILE__) .'/includes/php-gettext/streams.php');
require(dirname (__FILE__) .'/includes/php-gettext/gettext.php');
$input = new FileReader(dirn ame(__FILE__) .'/locales/'. $locale .'.mo');
$l10n = new gettext_reader( $input);
// Standard wrappers for xgettext
function T_($text) {
global $l10n;
return $l10n->translate($tex t);
}
function T_ngettext($sin gle, $plural, $number) {
global $l10n;
return $l10n->ngettext($sing le, $plural, $number);
}
PHP throws 'Fatal error: Call to a member function on a non-object ..
functions.inc.p hp on line 16' at me whenever I request this page.
Code at line 16: return $l10n->translate($tex t);
What am I doing wrong?
Thanks!
Comment