hamster-applet r491 - trunk/hamster
- From: tbaugis svn gnome org
- To: svn-commits-list gnome org
- Subject: hamster-applet r491 - trunk/hamster
- Date: Sat, 13 Sep 2008 20:32:49 +0000 (UTC)
Author: tbaugis
Date: Sat Sep 13 20:32:49 2008
New Revision: 491
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=491&view=rev
Log:
added missing localization strings for date formats. fixes bug 552156 (hope that doesn't count as string change)
Modified:
trunk/hamster/reports.py
trunk/hamster/stats.py
Modified: trunk/hamster/reports.py
==============================================================================
--- trunk/hamster/reports.py (original)
+++ trunk/hamster/reports.py Sat Sep 13 20:32:49 2008
@@ -22,17 +22,17 @@
def simple(facts, start_date, end_date):
if start_date.year != end_date.year:
- start_str = start_date.strftime('%B %d. %Y')
- end_str = end_date.strftime('%B %d. %Y')
+ start_str = start_date.strftime(_('%B %d. %Y'))
+ end_str = end_date.strftime(_('%B %d. %Y'))
elif start_date.month != end_date.month:
- start_str = start_date.strftime('%B %d')
- end_str = end_date.strftime('%B %d')
+ start_str = start_date.strftime(_('%B %d'))
+ end_str = end_date.strftime(_('%B %d'))
else:
- start_str = start_date.strftime('%B %d')
- end_str = end_date.strftime('%d, %Y')
+ start_str = start_date.strftime(_('%B %d'))
+ end_str = end_date.strftime(_('%d, %Y'))
if start_date == end_date:
- title = _("Overview for %s") % (start_date.strftime('%B %d. %Y'))
+ title = _("Overview for %s") % (start_date.strftime(_('%B %d. %Y')))
else:
title = _("Overview for %s - %s") % (start_str, end_str)
@@ -100,7 +100,7 @@
category = ""
if fact["category"] != _("Unsorted"): #do not print "unsorted"
category = fact["category"]
-
+ # date format in HTML report
report.write("""<tr>
<td>%s</td>
<td>%s</td>
@@ -108,7 +108,7 @@
<td>%s</td>
<td>%s</td>
<td>%s</td>
-</tr>""" % (fact["start_time"].strftime("%d.%m.%y"),
+</tr>""" % (fact["start_time"].strftime(_("%d.%m.%y")),
fact["name"],
category,
fact["start_time"].strftime('%H:%M'),
Modified: trunk/hamster/stats.py
==============================================================================
--- trunk/hamster/stats.py (original)
+++ trunk/hamster/stats.py Sat Sep 13 20:32:49 2008
@@ -167,8 +167,10 @@
for i in range((self.end_date - self.start_date).days + 1):
current_date = self.start_date + dt.timedelta(i)
+ # date format in overview window fact listing
+ fact_date = current_date.strftime(_('%A, %b %d.'))
day_row = self.fact_store.append(None, [-1,
- current_date.strftime('%A, %b %d.'),
+ fact_date,
"",
current_date.strftime('%Y-%m-%d')])
by_day[self.start_date + dt.timedelta(i)] = {"duration": 0, "row_pointer": day_row}
@@ -213,7 +215,8 @@
strday = day.strftime('%a')
totals["by_day"].append([strday, by_day[day]["duration"] / 60.0, None, None, day])
else:
- strday = day.strftime('%d. %b')
+ # date format in month chart in overview window (click on "month" to see it)
+ strday = day.strftime(_('%d. %b'))
background = None
if day.weekday() in [5, 6]:
background = 7
@@ -257,17 +260,26 @@
def do_graph(self):
if self.start_date.year != self.end_date.year:
- start_str = self.start_date.strftime('%B %d. %Y')
- end_str = self.end_date.strftime('%B %d. %Y')
+ # start date format for overview label if start and end years don't match
+ start_str = self.start_date.strftime(_('%B %d. %Y'))
+ # end date format for overview label if start and end years don't match
+ end_str = self.end_date.strftime(_('%B %d. %Y'))
elif self.start_date.month != self.end_date.month:
- start_str = self.start_date.strftime('%B %d.')
- end_str = self.end_date.strftime('%B %d.')
+ # start date format for overview label if start and end month do not match
+ start_str = self.start_date.strftime(_('%B %d.'))
+ # end date format for overview label if start and end month do not match
+ end_str = self.end_date.strftime(_('%B %d.'))
else:
- start_str = self.start_date.strftime('%B %d')
- end_str = self.end_date.strftime('%d, %Y')
+ # start date format for overview label for interval in same month
+ start_str = self.start_date.strftime(_('%B %d'))
+ # end date format for overview label for interval in same month
+ end_str = self.end_date.strftime(_('%d, %Y'))
- if self.day_view.get_active(): #single day is an exception
- label_text = _("Overview for %s") % (self.start_date.strftime('%B %d. %Y'))
+ if self.day_view.get_active():
+ # date format for single day
+ date_str = self.start_date.strftime(_('%B %d. %Y'))
+ # overview label for single day
+ label_text = _("Overview for %s") % (date_str)
dayview_caption = _("Day")
elif self.week_view.get_active():
label_text = _("Overview for %s - %s") % (start_str, end_str)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]