01-13-2006, 12:06 PM
If you're running PHP in English and you want month names to show up in your local language, you can use this hack to do so.
Files Edited: functions.inc.php
Open functions.inc.php and find:
Files Edited: functions.inc.php
Open functions.inc.php and find:
PHP Code:
$date = date($format, $timestamp - $timediff);
Add this after it:
PHP Code:
// Localized Months Hack
$monthsConversion = array(
'January' => 'LOCALJANUARY',
'February' => 'LOCALFEBRUARY',
'March' => 'LOCALMARCH',
'April' => 'LOCALAPRIL',
'May' => 'LOCALMAY',
'June' => 'LOCALJUNE',
'July' => 'LOCALJULY',
'August' => 'LOCALAUGUST',
'September' => 'LOCALSEPTEMBER',
'October' => 'LOCALOCTOBER',
'November' => 'LOCALNOVEMBER',
'December' => 'LOCALDECEMBER'
);
$date= str_replace(array_keys($monthsConversion), array_values($monthsConversion), $date);
// Localized Months Hack
Of course, replace all of the LOCALX months with the corresponding months in whatever language.
The following is the replacement array that can be used for Dutch translations.
PHP Code:
// Dutch
$monthsConversion = array(
'January' => 'januari',
'February' => 'februari',
'March' => 'maart',
'April' => 'april',
'May' => 'mei',
'June' => 'juni',
'July' => 'juli',
'August' => 'augustus',
'September' => 'september',
'October' => 'oktober',
'November' => 'november',
'December' => 'december'
);
The following is the replacement array that can be used for French translations.
PHP Code:
// French
$monthsConversion = array(
'January' => 'Janvier',
'February' => 'Février',
'March' => 'Mars',
'April' => 'Avril',
'May' => 'Mai',
'June' => 'Juin',
'July' => 'Juillet',
'August' => 'Août',
'September' => 'Septembre',
'October' => 'Octobre',
'November' => 'Novembre',
'December' => 'Décembre'
);