From ff04fe06250b7640b62379708b27ae31630150a0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 2 Sep 2013 12:58:14 +0400 Subject: [PATCH] use plurals for comment/comments link in article, properly translate comments string, add feed title to article in zoom mode --- classes/feeds.php | 7 +++++-- css/tt-rss.css | 13 +++++++++++++ include/functions.php | 17 ++++++++++++++--- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/classes/feeds.php b/classes/feeds.php index 3b765d6b..39444434 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -701,10 +701,13 @@ class Feeds extends Handler_Protected { } else { $comments_url = htmlspecialchars($line["link"]); } - $entry_comments = "$num_comments comments"; + $entry_comments = "$num_comments ". + _ngettext("comment", "comments", $num_comments).""; + } else { if ($line["comments"] && $line["link"] != $line["comments"]) { - $entry_comments = "comments"; + $entry_comments = "".__("comments").""; } } diff --git a/css/tt-rss.css b/css/tt-rss.css index beba1d4b..51b18ead 100644 --- a/css/tt-rss.css +++ b/css/tt-rss.css @@ -1018,6 +1018,19 @@ body#ttrssZoom { background : #f9fbff; } +body#ttrssZoom div.postHeader div.postFeedTitle { + float : left; + text-align : right; + padding-left : 0px; + font-size : 10px; +} + +body#ttrssZoom div.postHeader a.postComments { + text-align : right; + padding-left : 0px; + font-size : 10px; +} + body#ttrssZoom div.postHeader div.postDate { float : none; text-align : right; diff --git a/include/functions.php b/include/functions.php index 8ede14a0..4917bca2 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3182,6 +3182,7 @@ $result = db_query("SELECT id,title,link,content,feed_id,comments,int_id,lang, ".SUBSTRING_FOR_DATE."(updated,1,16) as updated, (SELECT site_url FROM ttrss_feeds WHERE id = feed_id) as site_url, + (SELECT title FROM ttrss_feeds WHERE id = feed_id) as feed_title, (SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) as hide_images, (SELECT always_display_enclosures FROM ttrss_feeds WHERE id = feed_id) as always_display_enclosures, num_comments, @@ -3218,10 +3219,13 @@ } else { $comments_url = htmlspecialchars($line["link"]); } - $entry_comments = "$num_comments comments"; + $entry_comments = "$num_comments ". + _ngettext("comment", "comments", $num_comments).""; + } else { if ($line["comments"] && $line["link"] != $line["comments"]) { - $entry_comments = "comments"; + $entry_comments = "".__("comments").""; } } @@ -3276,8 +3280,15 @@ $rv['content'] .= "
" . $line["title"] . "$entry_author
"; } - if ($zoom_mode) + if ($zoom_mode) { + $feed_title = "". + htmlspecialchars($line["feed_title"]).""; + + $rv['content'] .= "
$feed_title
"; + $rv['content'] .= "
$parsed_updated
"; + } $tags_str = format_tags_string($line["tags"], $id); $tags_str_full = join(", ", $line["tags"]); -- 2.39.5