diff options
Diffstat (limited to 'src/feeds.c')
-rw-r--r-- | src/feeds.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/feeds.c b/src/feeds.c index db426994..2f4714f3 100644 --- a/src/feeds.c +++ b/src/feeds.c | |||
@@ -24,6 +24,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
24 | #include "bookmarks.h" | 24 | #include "bookmarks.h" |
25 | #include "gmrequest.h" | 25 | #include "gmrequest.h" |
26 | #include "visited.h" | 26 | #include "visited.h" |
27 | #include "lang.h" | ||
27 | #include "app.h" | 28 | #include "app.h" |
28 | 29 | ||
29 | #include <the_Foundation/file.h> | 30 | #include <the_Foundation/file.h> |
@@ -637,30 +638,28 @@ size_t numUnread_Feeds(void) { | |||
637 | return count; | 638 | return count; |
638 | } | 639 | } |
639 | 640 | ||
640 | #define iPluralS(c) ((c) != 1 ? "s" : "") | ||
641 | |||
642 | const iString *entryListPage_Feeds(void) { | 641 | const iString *entryListPage_Feeds(void) { |
643 | iFeeds *d = &feeds_; | 642 | iFeeds *d = &feeds_; |
644 | iString *src = collectNew_String(); | 643 | iString *src = collectNew_String(); |
645 | format_String(src, "# Feed entries\n\n"); | 644 | setCStr_String(src, translateCStr_Lang("# ${feeds.list.title}\n\n")); |
646 | lock_Mutex(d->mtx); | 645 | lock_Mutex(d->mtx); |
647 | const iPtrArray *subs = listSubscriptions_(); | 646 | const iPtrArray *subs = listSubscriptions_(); |
648 | int elapsed = elapsedSeconds_Time(&d->lastRefreshedAt) / 60; | 647 | const int elapsed = elapsedSeconds_Time(&d->lastRefreshedAt) / 60; |
649 | appendFormat_String( | 648 | appendFormat_String( |
650 | src, | 649 | src, |
651 | "You are subscribed to %zu feed%s that contain%s a total of %zu entries.\n", | 650 | formatCStrs_Lang("feeds.list.counts.n", size_PtrArray(subs)), |
652 | size_PtrArray(subs), | 651 | formatCStrs_Lang("feeds.list.entrycount.n", size_SortedArray(&d->entries))); |
653 | iPluralS(size_PtrArray(subs)), | ||
654 | size_PtrArray(subs) == 1 ? "s" : "", | ||
655 | size_SortedArray(&d->entries)); | ||
656 | if (isValid_Time(&d->lastRefreshedAt)) { | 652 | if (isValid_Time(&d->lastRefreshedAt)) { |
657 | appendFormat_String(src, | 653 | if (elapsed == 0) { |
658 | "\nThe latest refresh occurred %s.\n", | 654 | appendCStr_String(src, translateCStr_Lang("\n${feeds.list.refreshtime.now}\n")); |
659 | elapsed == 0 ? "just a moment ago" | 655 | } |
660 | : elapsed < 60 ? format_CStr("%d minute%s ago", elapsed, iPluralS(elapsed)) | 656 | else { |
661 | : elapsed < 1440 ? format_CStr("%d hour%s ago", elapsed / 60, iPluralS(elapsed / 60)) | 657 | appendFormat_String(src, |
662 | : format_CStr("%d day%s ago", elapsed / 1440, | 658 | translateCStr_Lang("\n${feeds.list.refreshtime}\n"), |
663 | iPluralS(elapsed / 1440))); | 659 | elapsed < 60 ? formatCStr_Lang("minutes.ago.n", elapsed) |
660 | : elapsed < 1440 ? formatCStr_Lang("hours.ago.n", elapsed / 60) | ||
661 | : formatCStr_Lang("days.ago.n", elapsed / 1440)); | ||
662 | } | ||
664 | } | 663 | } |
665 | iDate on; | 664 | iDate on; |
666 | iZap(on); | 665 | iZap(on); |