From 1f4a4cfc016c562eb7c8e2b3d99fa53dea036ece Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Thu, 10 Jan 2008 13:36:07 +0100 Subject: - translation fixes --- pages/whats_on.ecpp | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'pages') diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index 9944e21..e2f1a0f 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -202,7 +202,18 @@ if (type == "now") { curresults.GetByID(timer->Id()); results.merge(curresults); } + time_t now = time(NULL); for (SearchResults::iterator result = results.begin(); result != results.end(); ++result) { + long diff = result->StartTime() - now; + long absdiff = labs(diff); + if (absdiff >= 24*60*60) continue; // skip broadcasts more than a day away + + string diffstring = string((diff > 0) ? tr("in") : tr("since")) + " "; + if (absdiff >= (60 * 60)) + diffstring += lexical_cast(long(absdiff / (60*60))) + " " + tr("hours"); + else + diffstring += lexical_cast(long(absdiff / 60)) + " " + tr("minutes"); + string epgId = EpgEvents::EncodeDomId(result->Channel(), result->EventId()); string channelname = Channels.GetByChannelID(result->Channel())->Name(); int channelnr = Channels.GetByChannelID(result->Channel())->Number(); @@ -212,31 +223,15 @@ if (type == "now") { + "

" + tr("Click to view details."); // last result? - bool bottom = false; SearchResults::iterator nextres = result; - nextres++; - if (nextres == results.end()) bottom = true; - - time_t now = time(NULL); - long diff = result->StartTime() - now; - long absdiff = labs(diff); - if (absdiff >= 24*60*60) continue; // skip broadcasts more than a day away - string diffstring; - if (absdiff >= (60 * 60)) - diffstring = lexical_cast(long(absdiff / (60*60))) + " hours"; - else - diffstring = lexical_cast(long(absdiff / 60)) + " minutes"; - if (diff > 0) - diffstring = "in " + diffstring; - else - diffstring = "since " + diffstring; + bool bottom = (++nextres == results.end()); <& pageelems.epg_tool_box detail=(0) epgid=(epgId) title=(result->Title()) startTime=(result->StartTime()) endTime=(result->StopTime()) lastCurrentChanel=(bottom ? 1 : 0) &> ">
<$ (FormatDateTime(tr("%I:%M %p"), result->StartTime())) $> - <$ (FormatDateTime(tr("%I:%M %p"), result->StopTime())) $>
- <$ diffstring $> minutes + <$ diffstring $>
"> -- cgit v1.2.3