Update of /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_comments
In directory sc8-pr-cvs1:/tmp/cvs-serv14314
Modified Files:
serendipity_plugin_comments.php
Log Message:
Changed LOCALE-configuration to fallback with different locales. Tuned
language inclusion.
Index: serendipity_plugin_comments.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_plugin_comments/serendipity_plugin_comments.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- serendipity_plugin_comments.php 6 Nov 2003 15:52:29 -0000 1.9
+++ serendipity_plugin_comments.php 20 Jan 2004 09:12:58 -0000 1.10
@@ -7,7 +7,7 @@
global $serendipity;
$propbag->add('name', COMMENTS);
- $propbag->add('description', 'Displays the last comments to your entries');
+ $propbag->add('description', COMMENTS_PLUGIN_BLAHBLAH);
$propbag->add('configuration', array(
'wordwrap',
@@ -22,32 +22,32 @@
switch($name) {
case 'wordwrap':
$propbag->add('type', 'string');
- $propbag->add('name', 'Wordwrap');
- $propbag->add('description', 'How many words until a wordwrap will occur? (Default: 30)');
+ $propbag->add('name', COMMENTS_PLUGIN_WORDWRAP);
+ $propbag->add('description', COMMENTS_PLUGIN_WORDWRAP_BLAHBLAH);
break;
case 'max_chars':
$propbag->add('type', 'string');
- $propbag->add('name', 'Maximum chars per comment');
- $propbag->add('description', 'How many chars will be displayed for each comment? (Default: 120)');
+ $propbag->add('name', COMMENTS_PLUGIN_MAXCHARS);
+ $propbag->add('description', COMMENTS_PLUGIN_MAXCHARS_BLAHBLAH);
break;
case 'max_entries':
$propbag->add('type', 'string');
- $propbag->add('name', 'Maximum number of comments');
- $propbag->add('description', 'How many comments will be shown? (Default: 15)');
+ $propbag->add('name', COMMENTS_PLUGIN_MAXENTRIES);
+ $propbag->add('description', COMMENTS_PLUGIN_MAXENTRIES_BLAHBLAH);
break;
case 'language':
$propbag->add('type', 'string');
- $propbag->add('name', 'Output language');
- $propbag->add('description', 'What is your output language? ("en|de", default "en")');
+ $propbag->add('name', GENERAL_PLUGIN_LANGUAGE);
+ $propbag->add('description', GENERAL_PLUGIN_LANGUAGE_BLAHBLAH);
break;
case 'dateformat':
$propbag->add('type', 'string');
- $propbag->add('name', 'Dateformatting');
- $propbag->add('description', 'The format of the actual Date, using PHPs strftime() variables. (Default: "%a, %m.%m.%Y %H:%M")');
+ $propbag->add('name', GENERAL_PLUGIN_DATEFORMAT);
+ $propbag->add('description', sprintf(GENERAL_PLUGIN_DATEFORMAT_BLAHBLAH, '%a, %m.%m.%Y %H:%M'));
break;
default:
@@ -64,7 +64,7 @@
$max_entries = $this->get_config('max_entries');
$max_chars = $this->get_config('max_chars');
$wordwrap = $this->get_config('wordwrap');
- $dateformat = $this->get_config('dateformat');
+ $dateformat = $this->get_config('dateformat');
if (!$max_entries || !is_numeric($max_entries) || $max_entries < 1) {
$max_entries = 15;
@@ -88,12 +88,14 @@
switch($lang) {
case 'de':
- $loc = setlocale(LC_ALL, 'de');
+ $loc = setlocale(LC_ALL, 'de_DE');
+ if (!$loc) $loc = setlocale(LC_ALL, 'de');
$out = '%s zu%s';
break;
case 'en':
- $loc = setlocale(LC_ALL, 'en');
+ $loc = setlocale(LC_ALL, 'en_US');
+ if (!$loc) $loc = setlocale(LC_ALL, 'en');
$out = '%s about%s';
break;
}
|