I18N - bug ?
| From: | Tommy Ipsen | Date: | Wed, 06 Aug 2003 15:49:08 +0000 |
| Subject: | I18N - bug ? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-7058@lists.php.net to get a copy of this message | ||
Hi everybody
First of all I've made a version of the danish locale for use in I18N (Have yet to send it to Wolfram!):
<?php
// +----------------------------------------------------------------------+
// | PHP version 4.0 |// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. |// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. |// +----------------------------------------------------------------------+
// | Authors: Wolfram Kriesing <wk@visionp.de> | // | |// +----------------------------------------------------------------------+ // $Id: en.php,v 1.3 2003/01/07 11:03:32 cain Exp $ class I18N_Common_da_DK {
var $days = array('søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag');
var $daysAbbreviated = array('søn', 'man', 'tir','ons','tor','fre','lør');
var $monthsAbbreviated = array( 'Jan' , 'Feb' , 'Mar' , 'Apr' , 'Maj' , 'Jun' ,'Jul' , 'Aug' , 'Sep' , 'Okt' , 'Nov' , 'Dec' );
var $months = array(
'januar',
'februar',
'marts',
'april',
'maj',
'juni',
'juli',
'august',
'september',
'oktober',
'november',
'december'
);
var $dateFormats = array(
I18N_DATETIME_SHORT => 'j/n-y',
I18N_DATETIME_DEFAULT => 'd-M-Y',
I18N_DATETIME_MEDIUM => 'd-M-Y',
I18N_DATETIME_LONG => 'j. F Y',
I18N_DATETIME_FULL => 'l, \d. j. F Y'
);
var $timeFormats = array(
I18N_DATETIME_SHORT => 'H:i',
I18N_DATETIME_DEFAULT => 'H:i:s',
I18N_DATETIME_MEDIUM => 'H:i:s',
I18N_DATETIME_LONG => 'H:i:s T O',
I18N_DATETIME_FULL => '\k\l. H:i'
);
/**
* the NUMBER stuff
* @var array the same parameters as they have to be passed to the number_format-funciton
*/
var $numberFormat = array(
I18N_NUMBER_FLOAT => array('3',',','.'),
I18N_NUMBER_INTEGER => array('0',',','.'),
);
}
?>
The strange thing is that one of the months doesn't translate properly:
With the following code:
$dateTime = new I18N_DateTime('da_DK');
$TI_Format = $dateTime->setFormat(I18N_DATETIME_FULL);
for ($i=1; $i<=12;$i++) {
echo $dateTime->format(mktime(0,0,0,$i,1,2003), $TI_Format) . '<br>';} I get the following output: onsdag, d. 1. januar 2003 kl. 00:00 lørdag, d. 1. februar 2003 kl. 00:00 lørdag, d. 1. marts 2003 kl. 00:00 tirsdag, d. 1. april 2003 kl. 00:00 torsdag, d. 1. maj 2003 kl. 00:00 søndag, d. 1. juni 2003 kl. 00:00 tirsdag, d. 1. July 2003 kl. 00:00 fredag, d. 1. august 2003 kl. 00:00 mandag, d. 1. september 2003 kl. 00:00 onsdag, d. 1. oktober 2003 kl. 00:00 lørdag, d. 1. november 2003 kl. 00:00 mandag, d. 1. december 2003 kl. 00:00 notice the date with "July" which should have been "juli"! Does anybody have a nice explanation for this? Regards, Tommy Ipsen, Denmark