Use variables for number of comments

        Patch by liv. 

diffs (101 lines):

diff -r 5a7a2a1c0bcc -r e818348e68a5 bin/upgrading/s2layers/core2.s2
--- a/bin/upgrading/s2layers/core2.s2   Sat May 16 17:12:18 2009 +0000
+++ b/bin/upgrading/s2layers/core2.s2   Sun May 17 02:04:13 2009 +0800
@@ -3120,19 +3120,20 @@ function print_module_pagesummary() {
         foreach var Entry e ( $cp.entries ) {
             $poster = $e.poster->ljuser();
             $subject = ($e.subject != "" ? striphtml($e.subject) : 
"<em>$*text_nosubject</em>");
+            var string module_comment_text = 
get_plural_phrase($e.comments.count, "text_read_comments_friends");
             var string comment_display;
             if ($*module_pagesummary_opts_comments_tooltip) {
-                $comment_display = "title='$e.comments.count 
comments'>$subject";
-               }
-            else {
-               $comment_display = ">$subject</a> +$e.comments.count comments";
+                $comment_display = "title='$module_comment_text'>$subject</a>";
+               }
+            else {
+               $comment_display = ">$subject</a> +$module_comment_text";
                }
             
             if (not $e.poster->equals($e.journal)) {
-                $links[size $links] = """$poster in $e.journal - <a 
href="#entry-$e.itemid" $comment_display</a>""";
-            }
-            else {
-                $links[size $links] = """$poster - <a href="#entry-$e.itemid" 
$comment_display</a>""";
+                $links[size $links] = """$poster in $e.journal - <a 
href="#entry-$e.itemid" $comment_display""";
+            }
+            else {
+                $links[size $links] = """$poster - <a href="#entry-$e.itemid" 
$comment_display""";
             }
         }
     }
@@ -3142,20 +3143,21 @@ function print_module_pagesummary() {
         var string poster;
         foreach var Entry e ( $cp.entries ) {
             $subject = ($e.subject != "" ? striphtml($e.subject) : 
"<em>$*text_nosubject</em>");
+            var string module_comment_text = 
get_plural_phrase($e.comments.count, "text_read_comments");
             var string comment_display;
             if ($*module_pagesummary_opts_comments_tooltip) {
-                $comment_display = "title='$e.comments.count 
comments'>$subject";
-               }
-            else {
-               $comment_display = ">$subject</a> +$e.comments.count comments";
+                $comment_display = "title='$module_comment_text'>$subject</a>";
+               }
+            else {
+               $comment_display = ">$subject</a> +$module_comment_text";
                }
             
             if (not $e.poster->equals($e.journal)) {
                 $poster = $e.poster->ljuser();
-                $links[size $links] = """$poster - <a href="#entry-$e.itemid" 
$comment_display</a>""";
-            }
-            else {
-                $links[size $links] = """<a href="#entry-$e.itemid" 
$comment_display</a>""";
+                $links[size $links] = """$poster - <a href="#entry-$e.itemid" 
$comment_display""";
+            }
+            else {
+                $links[size $links] = """<a href="#entry-$e.itemid" 
$comment_display""";
             }
         }
     }
@@ -3166,21 +3168,21 @@ function print_module_pagesummary() {
         var string poster;
         foreach var Entry e ( $cp.entries ) {
             $subject = ($e.subject != "" ? striphtml($e.subject) : 
"<em>$*text_nosubject</em>");
-            
+            var string module_comment_text = 
get_plural_phrase($e.comments.count, "text_read_comments");
             var string comment_display;
             if ($*module_pagesummary_opts_comments_tooltip) {
-                $comment_display = "title='$e.comments.count 
comments'>$subject";
-               }
-            else {
-               $comment_display = ">$subject</a> +$e.comments.count comments";
+                $comment_display = "title='$module_comment_text'>$subject</a>";
+               }
+            else {
+               $comment_display = ">$subject</a> +$module_comment_text";
                }
 
             if (not $e.poster->equals($e.journal)) {
                 $poster = $e.poster->ljuser();
-                $links[size $links] = """$poster - <a href="#entry-$e.itemid" 
title="$e.comments.count comments">$subject</a>""";
-            }
-            else {
-                $links[size $links] = """<a href="#entry-$e.itemid" 
title="$e.comments.count comments">$subject</a>""";
+                $links[size $links] = """$poster - <a href="#entry-$e.itemid" 
$comment_display""";
+            }
+            else {
+                $links[size $links] = """<a href="#entry-$e.itemid" 
$comment_display""";
             }
         }
     }
@@ -3189,6 +3191,7 @@ function print_module_pagesummary() {
     print_module_list($links);
     close_module();
 }
+
 
 function print_module_tags() {
     var Page p = get_page();
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to