[gnome-clocks] Use "Mondays" (plural) when repeating on just one day
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] Use "Mondays" (plural) when repeating on just one day
- Date: Fri, 31 Aug 2012 15:05:29 +0000 (UTC)
commit 8817480c8c5bbd6e0269d882b1b3ad16d0a4219e
Author: Paolo Borelli <pborelli gnome org>
Date: Fri Aug 31 17:03:49 2012 +0200
Use "Mondays" (plural) when repeating on just one day
gnomeclocks/alarm.py | 29 ++++++++++++++++++++++-------
gnomeclocks/utils.py | 14 +++++++-------
2 files changed, 29 insertions(+), 14 deletions(-)
---
diff --git a/gnomeclocks/alarm.py b/gnomeclocks/alarm.py
index f746fca..e25f3c0 100644
--- a/gnomeclocks/alarm.py
+++ b/gnomeclocks/alarm.py
@@ -96,22 +96,37 @@ class AlarmItem:
return _("Weekdays")
elif len(sorted_repeat) == 0:
return ""
+ elif len(sorted_repeat) == 1:
+ if 'MO' in self.repeat:
+ return _("Mondays")
+ elif 'TU' in self.repeat:
+ return _("Tuesdays")
+ elif 'WE' in self.repeat:
+ return _("Wednesdays")
+ elif 'TH' in self.repeat:
+ return _("Thursdays")
+ elif 'FR' in self.repeat:
+ return _("Fridays")
+ elif 'SA' in self.repeat:
+ return _("Saturdays")
+ elif 'SU' in self.repeat:
+ return _("Sundays")
else:
days = []
if 'MO' in self.repeat:
- days.append(LocalizedWeekdays.MO)
+ days.append(LocalizedWeekdays.MON)
if 'TU' in self.repeat:
- days.append(LocalizedWeekdays.TU)
+ days.append(LocalizedWeekdays.TUE)
if 'WE' in self.repeat:
- days.append(LocalizedWeekdays.WE)
+ days.append(LocalizedWeekdays.WED)
if 'TH' in self.repeat:
- days.append(LocalizedWeekdays.TH)
+ days.append(LocalizedWeekdays.THU)
if 'FR' in self.repeat:
- days.append(LocalizedWeekdays.FR)
+ days.append(LocalizedWeekdays.FRI)
if 'SA' in self.repeat:
- days.append(LocalizedWeekdays.SA)
+ days.append(LocalizedWeekdays.SAT)
if 'SU' in self.repeat:
- days.append(LocalizedWeekdays.SU)
+ days.append(LocalizedWeekdays.SUN)
return ", ".join(days)
# FIXME: this is not a really good way, we assume each alarm
diff --git a/gnomeclocks/utils.py b/gnomeclocks/utils.py
index 03da9b7..d91785f 100644
--- a/gnomeclocks/utils.py
+++ b/gnomeclocks/utils.py
@@ -62,13 +62,13 @@ class SystemSettings:
class LocalizedWeekdays:
- MO = time.strftime("%a", (0, 0, 0, 0, 0, 0, 0, 0, 0))
- TU = time.strftime("%a", (0, 0, 0, 0, 0, 0, 1, 0, 0))
- WE = time.strftime("%a", (0, 0, 0, 0, 0, 0, 2, 0, 0))
- TH = time.strftime("%a", (0, 0, 0, 0, 0, 0, 3, 0, 0))
- FR = time.strftime("%a", (0, 0, 0, 0, 0, 0, 4, 0, 0))
- SA = time.strftime("%a", (0, 0, 0, 0, 0, 0, 5, 0, 0))
- SU = time.strftime("%a", (0, 0, 0, 0, 0, 0, 6, 0, 0))
+ MON = time.strftime("%a", (0, 0, 0, 0, 0, 0, 0, 0, 0))
+ TUE = time.strftime("%a", (0, 0, 0, 0, 0, 0, 1, 0, 0))
+ WED = time.strftime("%a", (0, 0, 0, 0, 0, 0, 2, 0, 0))
+ THU = time.strftime("%a", (0, 0, 0, 0, 0, 0, 3, 0, 0))
+ FRI = time.strftime("%a", (0, 0, 0, 0, 0, 0, 4, 0, 0))
+ SAT = time.strftime("%a", (0, 0, 0, 0, 0, 0, 5, 0, 0))
+ SUN = time.strftime("%a", (0, 0, 0, 0, 0, 0, 6, 0, 0))
class Alert:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]