]> git.mjollnir.org Git - s9y.git/commitdiff
o split message catalog to lang_en.inc.php.
authorelf2000 <elf2000>
Sun, 13 Nov 2005 06:58:40 +0000 (06:58 +0000)
committerelf2000 <elf2000>
Sun, 13 Nov 2005 06:58:40 +0000 (06:58 +0000)
plugins/serendipity_event_emoticate/lang_en.inc.php [new file with mode: 0644]
plugins/serendipity_event_emoticate/serendipity_event_emoticate.php
plugins/serendipity_event_entryproperties/lang_en.inc.php [new file with mode: 0644]
plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php
plugins/serendipity_plugin_comments/lang_en.inc.php [new file with mode: 0644]
plugins/serendipity_plugin_comments/serendipity_plugin_comments.php

diff --git a/plugins/serendipity_event_emoticate/lang_en.inc.php b/plugins/serendipity_event_emoticate/lang_en.inc.php
new file mode 100644 (file)
index 0000000..228be63
--- /dev/null
@@ -0,0 +1,13 @@
+<?php # $Id$
+
+/**
+ *  @version $Revision$
+ *  @author Translator Name <yourmail@example.com>
+ *  EN-Revision: Revision of lang_en.inc.php
+ */
+
+@define('PLUGIN_EVENT_EMOTICATE_NAME', 'Markup: Emoticate');
+@define('PLUGIN_EVENT_EMOTICATE_DESC', 'Convert standard emoticons into graphic images');
+@define('PLUGIN_EVENT_EMOTICATE_TRANSFORM', 'Standard emoticons like :-) and ;-) are converted to images.');
+
+?>
index 80d50fcd7bb3e1be5abdb92138f49d3066317c55..40f577899323c4f2b0667098903c8ac03719a057 100644 (file)
@@ -6,9 +6,7 @@ if (file_exists($probelang)) {
     include $probelang;
 }
 
-@define('PLUGIN_EVENT_EMOTICATE_NAME', 'Markup: Emoticate');
-@define('PLUGIN_EVENT_EMOTICATE_DESC', 'Convert standard emoticons into graphic images');
-@define('PLUGIN_EVENT_EMOTICATE_TRANSFORM', 'Standard emoticons like :-) and ;-) are converted to images.');
+include dirname(__FILE__) . '/lang_en.inc.php';
 
 class serendipity_event_emoticate extends serendipity_event
 {
diff --git a/plugins/serendipity_event_entryproperties/lang_en.inc.php b/plugins/serendipity_event_entryproperties/lang_en.inc.php
new file mode 100644 (file)
index 0000000..100afff
--- /dev/null
@@ -0,0 +1,40 @@
+<?php # $Id$
+
+/**
+ *  @version $Revision$
+ *  @author Translator Name <yourmail@example.com>
+ *  EN-Revision: Revision of lang_en.inc.php
+ */
+
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_TITLE', 'Extended properties for entries');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_DESC', '(cache, non-public articles, sticky posts)');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_STICKYPOSTS', 'Mark this entry as a Sticky Post');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS', 'Entries can be read by');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_PRIVATE', 'Myself');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_MEMBERS', 'Co-authors');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_PUBLIC', 'Everyone');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE', 'Allow to cache entries?');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_DESC', 'If enabled, a cached version will be generated on every saving. Caching will increase performance, but maybe decrease flexibility for other plugins.');
+@define('PLUGIN_EVENT_ENTRYPROPERTY_BUILDCACHE', 'Build cached entries');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_FETCHNEXT', 'Fetching next batch of entries...');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_FETCHNO', 'Fetching entries %d to %d');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_BUILDING', 'Building cache for entry #%d, <em>%s</em>...');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHED', 'Entry cached.');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_DONE', 'Entry caching completed.');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_ABORTED', 'Entry caching ABORTED.');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_TOTAL', ' (totalling %d entries)...');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_NL2BR', 'Disable nl2br');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_NO_FRONTPAGE', 'Hide from article overview / frontpage');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_GROUPS', 'Use group-based restrictions');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_GROUPS_DESC', 'If enabled, you can define which users of a usergroup may be able to read entries. This option has a large impact on the performance of your article overview. Only enable this if you are really going to use this feature.');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_USERS', 'Use user-based restrictions');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_USERS_DESC', 'If enabled, you can define which specific users may be able to read entries. This option has a large impact on the performance of your article overview. Only enable this if you are really going to use this feature.');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_HIDERSS', 'Hide content in RSS');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_HIDERSS_DESC', 'If enabled, the content of this entry will not be shown inside the RSS feed(s).');
+
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS', 'Custom Fields');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC1', 'Additional custom fields can be used in your template at places where you want them to show up. For that, edit your entries.tpl template file and place Smarty tags like {$entry.properties.ep_MyCustomField} in the HTML where you like. Note the prefix ep_ for each field. ');
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC2', 'Here you can enter a list of commaseparated field names that you can use to enter for every entry - do not use special characters or spaces for those fieldnames. Example: "Customfield1, Customfield2". ' . PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC1);
+@define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC3', 'The list of available custom fields can be changed in the <a href="%s" target="_blank" title="' . PLUGIN_EVENT_ENTRYPROPERTIES_TITLE . '">plugin configuration</a>.');
+
+?>
index f9fbcfca0f86f5a50ef53eeb180eabc957ff7363..8ecb37b442d4e2dad1d27948c059d85bd3d9d971 100644 (file)
@@ -6,36 +6,7 @@ if (file_exists($probelang)) {
     include $probelang;
 }
 
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_TITLE', 'Extended properties for entries');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_DESC', '(cache, non-public articles, sticky posts)');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_STICKYPOSTS', 'Mark this entry as a Sticky Post');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS', 'Entries can be read by');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_PRIVATE', 'Myself');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_MEMBERS', 'Co-authors');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_ACCESS_PUBLIC', 'Everyone');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE', 'Allow to cache entries?');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_DESC', 'If enabled, a cached version will be generated on every saving. Caching will increase performance, but maybe decrease flexibility for other plugins.');
-@define('PLUGIN_EVENT_ENTRYPROPERTY_BUILDCACHE', 'Build cached entries');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_FETCHNEXT', 'Fetching next batch of entries...');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_FETCHNO', 'Fetching entries %d to %d');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_BUILDING', 'Building cache for entry #%d, <em>%s</em>...');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHED', 'Entry cached.');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_DONE', 'Entry caching completed.');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_ABORTED', 'Entry caching ABORTED.');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CACHE_TOTAL', ' (totalling %d entries)...');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_NL2BR', 'Disable nl2br');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_NO_FRONTPAGE', 'Hide from article overview / frontpage');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_GROUPS', 'Use group-based restrictions');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_GROUPS_DESC', 'If enabled, you can define which users of a usergroup may be able to read entries. This option has a large impact on the performance of your article overview. Only enable this if you are really going to use this feature.');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_USERS', 'Use user-based restrictions');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_USERS_DESC', 'If enabled, you can define which specific users may be able to read entries. This option has a large impact on the performance of your article overview. Only enable this if you are really going to use this feature.');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_HIDERSS', 'Hide content in RSS');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_HIDERSS_DESC', 'If enabled, the content of this entry will not be shown inside the RSS feed(s).');
-
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS', 'Custom Fields');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC1', 'Additional custom fields can be used in your template at places where you want them to show up. For that, edit your entries.tpl template file and place Smarty tags like {$entry.properties.ep_MyCustomField} in the HTML where you like. Note the prefix ep_ for each field. ');
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC2', 'Here you can enter a list of commaseparated field names that you can use to enter for every entry - do not use special characters or spaces for those fieldnames. Example: "Customfield1, Customfield2". ' . PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC1);
-@define('PLUGIN_EVENT_ENTRYPROPERTIES_CUSTOMFIELDS_DESC3', 'The list of available custom fields can be changed in the <a href="%s" target="_blank" title="' . PLUGIN_EVENT_ENTRYPROPERTIES_TITLE . '">plugin configuration</a>.');
+include dirname(__FILE__) . '/lang_en.inc.php';
 
 class serendipity_event_entryproperties extends serendipity_event
 {
diff --git a/plugins/serendipity_plugin_comments/lang_en.inc.php b/plugins/serendipity_plugin_comments/lang_en.inc.php
new file mode 100644 (file)
index 0000000..0c3a706
--- /dev/null
@@ -0,0 +1,18 @@
+<?php # $Id$
+
+/**
+ *  @version $Revision$
+ *  @author Translator Name <yourmail@example.com>
+ *  EN-Revision: Revision of lang_en.inc.php
+ */
+
+@define('PLUGIN_COMMENTS_BLAHBLAH', 'Displays the last comments to your entries');
+@define('PLUGIN_COMMENTS_WORDWRAP', 'Wordwrap');
+@define('PLUGIN_COMMENTS_WORDWRAP_BLAHBLAH', 'How many words until a wordwrap will occur? (Default: 30)');
+@define('PLUGIN_COMMENTS_MAXCHARS', 'Maximum chars per comment');
+@define('PLUGIN_COMMENTS_MAXCHARS_BLAHBLAH', 'How many chars will be displayed for each comment? (Default: 120)');
+@define('PLUGIN_COMMENTS_MAXENTRIES', 'Maximum number of comments');
+@define('PLUGIN_COMMENTS_MAXENTRIES_BLAHBLAH', 'How many comments will be shown? (Default: 15)');
+@define('PLUGIN_COMMENTS_ABOUT', '%s about%s');
+
+?>
index c3b20ad9931b85df9ce182d729016321a5fdff4e..72db01b03aba6c51fb55b52f493d5d48689fed23 100644 (file)
@@ -6,14 +6,7 @@ if (file_exists($probelang)) {
     include $probelang;
 }
 
-@define('PLUGIN_COMMENTS_BLAHBLAH', 'Displays the last comments to your entries');
-@define('PLUGIN_COMMENTS_WORDWRAP', 'Wordwrap');
-@define('PLUGIN_COMMENTS_WORDWRAP_BLAHBLAH', 'How many words until a wordwrap will occur? (Default: 30)');
-@define('PLUGIN_COMMENTS_MAXCHARS', 'Maximum chars per comment');
-@define('PLUGIN_COMMENTS_MAXCHARS_BLAHBLAH', 'How many chars will be displayed for each comment? (Default: 120)');
-@define('PLUGIN_COMMENTS_MAXENTRIES', 'Maximum number of comments');
-@define('PLUGIN_COMMENTS_MAXENTRIES_BLAHBLAH', 'How many comments will be shown? (Default: 15)');
-@define('PLUGIN_COMMENTS_ABOUT', '%s about%s');
+include dirname(__FILE__) . '/lang_en.inc.php';
 
 class serendipity_plugin_comments extends serendipity_plugin
 {
@@ -28,8 +21,8 @@ class serendipity_plugin_comments extends serendipity_plugin
         $propbag->add('name',          COMMENTS);
         $propbag->add('description',   PLUGIN_COMMENTS_BLAHBLAH);
         $propbag->add('stackable',     true);
-        $propbag->add('author',        'Garvin Hicking');
-        $propbag->add('version',       '1.3');
+        $propbag->add('author',        'Garvin Hicking/Tadashi Jokagi');
+        $propbag->add('version',       '1.4');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -165,11 +158,15 @@ class serendipity_plugin_comments extends serendipity_plugin
 
         if ($sql && is_array($sql)) {
             foreach($sql AS $key => $row) {
-                $comments = wordwrap(strip_tags($row['comment']), $max_chars, '@@@', 1);
-                $aComment = explode('@@@', $comments);
-                $comment  = $aComment[0];
-                if (count($aComment) > 1) {
-                    $comment .= ' [...]';
+                if ( $serendipity['lang'] == "ja" && function_exists( 'mb_strimwidth')) {
+                    $comment = mb_strimwidth( strip_tags($row['comment']), 0, $max_chars, " [...]");
+                } else {
+                    $comments = wordwrap(strip_tags($row['comment']), $max_chars, '@@@', 1);
+                    $aComment = explode('@@@', $comments);
+                    $comment  = $aComment[0];
+                    if (count($aComment) > 1) {
+                        $comment .= ' [...]';
+                    }
                 }
 
                 if ($row['comment_type'] == 'TRACKBACK' && $row['comment_url'] != '') {
@@ -178,7 +175,21 @@ class serendipity_plugin_comments extends serendipity_plugin
                     $user = htmlspecialchars(strip_tags($row['user']));
                 }
 
-                $entry = array('comment' => wordwrap($comment, $wordwrap, "\n", 1),
+           
+                if ( $serendipity['lang'] == "ja" && function_exists( 'mb_strimwidth')) {
+                    $pos = 0;
+                    $parts = array();
+                    $comment_len = mb_strlen( $comment);
+                    while ( $pos < $comment_len) {
+                        $part = mb_strimwidth( $comment, $pos, $wordwrap);
+                        $pos += mb_strlen( $part);
+                        $parts[] = $part;
+                    }
+                    $comment = implode( "\n", $parts);
+                } else {
+                    $comment = wordwrap($comment, $wordwrap, "\n", 1);
+                }
+                $entry = array('comment' => $comment,
                                'email'   => $row['comment_email']);
                 serendipity_plugin_api::hook_event('frontend_display', $entry);
                 printf(
@@ -189,7 +200,7 @@ class serendipity_plugin_comments extends serendipity_plugin
                       . htmlspecialchars($row['subject'])
                       . '</a><br />' . "\n"
                       . htmlspecialchars(serendipity_strftime($dateformat, $row['stamp'])) . '<br />' . "\n"
-                      . strip_tags($entry['comment'], '<br><img>')
+                      . strip_tags($entry['comment'], '<br /><img>')
                       . '<br /><br /><br />' . "\n\n"
                 );
             }