Home » Internationalization » I18Nv2 » Bug #5332
Russian time-/dateformats are wrong
Details
| Submitted | 2005-09-08 09:46 UTC |
|---|---|
| From | stefan dot doeppert at synapsy dot com |
| Status | No Feedback |
| Package | I18Nv2 |
| PHP Version | 5.0.3 |
| OS | Suse Linux 9.3 |
| Roadmaps | (Not assigned) |
Comments
[2005-09-08 09:46 UTC] stefan dot doeppert at synapsy dot com
Description:
------------
The old russian formats didn't work correctly.
That is why I changed the file /I18Nv2/Locale/ru.php:
Code:
$this->dateFormats = array(
I18Nv2_DATETIME_SHORT => '%d/%m/%y',
I18Nv2_DATETIME_DEFAULT => '%d-%m-%Y',
I18Nv2_DATETIME_MEDIUM => '%d-%m-%Y',
I18Nv2_DATETIME_LONG => '%d %B %Y',
I18Nv2_DATETIME_FULL => '%A, %d %B %Y'
);
$this->timeFormats = array(
I18Nv2_DATETIME_SHORT => '%H:%M',
I18Nv2_DATETIME_DEFAULT => '%H:%M:%S',
I18Nv2_DATETIME_MEDIUM => '%H:%M:%S',
I18Nv2_DATETIME_LONG => '%H:%M:%S %Z',
I18Nv2_DATETIME_FULL => '%H:%M ???%Z'
);
[2005-09-08 09:48 UTC] stefan dot doeppert at synapsy dot com
subject was wrong
[2005-09-08 11:30 UTC] stefan dot doeppert at synapsy dot com
I used it to display a timestamp in the specific format that is used to display it in the different countries, e.g. german(de) or russian (ru):
Code:
$negotiator = new I18Nv2_Negotiator;
$language = $negotiator->getLanguageMatch();
$locale = I18Nv2::setLocale($language);
$formats = new I18Nv2_Locale();
$dateformat = $formats->dateFormats['default'];
$timeformat = $formats->timeFormats['default'];
$CONFIG['locale']['date'] = $dateformat;
$CONFIG['locale']['time'] = $dateformat . " " . $timeformat;
$CONFIG['locale']['time']:
- german: (de)
'%Y-%m-%d %H:%M:%S'
example:
07.09.2005 08:25:43
- russian: (ru)
%d-%b-$Y %H:%M:%S
example:
07-???-Y 08:25:43