Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv304
Modified Files:
serendipity_config.inc.php serendipity_functions.inc.php
Log Message:
Added method of trying more than one locale, to see if one of them fits, if they don't then move back to previous locale
Fixed german locales
Renamed DATE_FORMAT_1 to DATE_FORMAT_ENTRY
Index: serendipity_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- serendipity_config.inc.php 13 Feb 2004 18:23:42 -0000 1.49
+++ serendipity_config.inc.php 14 Feb 2004 18:20:52 -0000 1.50
@@ -85,8 +85,17 @@
/*
* Set current locale, if any has been defined
*/
-if (defined('DATE_LOCALE')) {
- setlocale(LC_TIME, DATE_LOCALE);
+if (defined('DATE_LOCALES')) {
+ $localeOld = setlocale(LC_TIME, NULL);
+ $locales = explode(',', DATE_LOCALES);
+ foreach ( $locales as $locale ) {
+ $locale = trim($locale);
+ if ( setlocale(LC_TIME, $locale) == $locale ) {
+ break;
+ } else {
+ setlocale(LC_TIME, $localeOld);
+ }
+ }
}
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -d -r1.206 -r1.207
--- serendipity_functions.inc.php 13 Feb 2004 18:34:13 -0000 1.206
+++ serendipity_functions.inc.php 14 Feb 2004 18:20:52 -0000 1.207
@@ -737,7 +737,7 @@
$lastDate = '';
for ($x = 0, $num_entries = count($entries); $x < $num_entries; $x++) {
- $d = ucfirst(strftime(DATE_FORMAT_1, $entries[$x]['timestamp']));
+ $d = ucfirst(strftime(DATE_FORMAT_ENTRY, $entries[$x]['timestamp']));
$bydate[$d][] = $entries[$x];
}
|