1.1 --- a/imipweb/event.py Thu Nov 05 20:00:51 2015 +0100
1.2 +++ b/imipweb/event.py Fri Nov 06 00:00:55 2015 +0100
1.3 @@ -27,6 +27,10 @@
1.4 from imipweb.data import EventPeriod, event_period_from_period, FormPeriod, PeriodError
1.5 from imipweb.resource import DateTimeFormUtilities, FormUtilities, ResourceClientForObject
1.6
1.7 +# Fake gettext method for strings to be translated later.
1.8 +
1.9 +_ = lambda s: s
1.10 +
1.11 class EventPageFragment(ResourceClientForObject, DateTimeFormUtilities, FormUtilities):
1.12
1.13 "A resource presenting the details of an event."
1.14 @@ -37,20 +41,20 @@
1.15 # Various property values and labels.
1.16
1.17 property_items = [
1.18 - ("SUMMARY", "Summary"),
1.19 - ("DTSTART", "Start"),
1.20 - ("DTEND", "End"),
1.21 - ("ORGANIZER", "Organiser"),
1.22 - ("ATTENDEE", "Attendee"),
1.23 + ("SUMMARY", _("Summary")),
1.24 + ("DTSTART", _("Start")),
1.25 + ("DTEND", _("End")),
1.26 + ("ORGANIZER", _("Organiser")),
1.27 + ("ATTENDEE", _("Attendee")),
1.28 ]
1.29
1.30 partstat_items = [
1.31 - ("NEEDS-ACTION", "Not confirmed"),
1.32 - ("ACCEPTED", "Attending"),
1.33 - ("TENTATIVE", "Tentatively attending"),
1.34 - ("DECLINED", "Not attending"),
1.35 - ("DELEGATED", "Delegated"),
1.36 - (None, "Not indicated"),
1.37 + ("NEEDS-ACTION", _("Not confirmed")),
1.38 + ("ACCEPTED", _("Attending")),
1.39 + ("TENTATIVE", _("Tentatively attending")),
1.40 + ("DECLINED", _("Not attending")),
1.41 + ("DELEGATED", _("Delegated")),
1.42 + (None, _("Not indicated")),
1.43 ]
1.44
1.45 def can_remove_recurrence(self, recurrence):
1.46 @@ -244,7 +248,7 @@
1.47 continue
1.48
1.49 page.tr()
1.50 - page.th(label, class_="objectheading %s%s" % (field, errors and field in errors and " error" or ""), rowspan=rowspan)
1.51 + page.th(_(label), class_="objectheading %s%s" % (field, errors and field in errors and " error" or ""), rowspan=rowspan)
1.52
1.53 # Handle datetimes specially.
1.54
1.55 @@ -389,8 +393,10 @@
1.56
1.57 # Show participation status, editable for the current user.
1.58
1.59 + partstat_items = [(key, _(partstat_label)) for (key, partstat_label) in self.partstat_items]
1.60 +
1.61 if attendee_uri == self.user:
1.62 - self.menu("partstat", partstat, self.partstat_items, class_="partstat")
1.63 + self.menu("partstat", partstat, partstat_items, class_="partstat")
1.64
1.65 # Allow the participation indicator to act as a submit
1.66 # button in order to refresh the page and show a control for
1.67 @@ -398,12 +404,12 @@
1.68
1.69 elif self.is_organiser() and self.attendee_is_new(attendee_uri):
1.70 self.control("partstat-refresh", "submit", "refresh", id="partstat-%d" % i, class_="refresh")
1.71 - page.label(dict(self.partstat_items).get(partstat, ""), for_="partstat-%s" % i, class_="partstat")
1.72 + page.label(dict(partstat_items).get(partstat, ""), for_="partstat-%s" % i, class_="partstat")
1.73
1.74 # Otherwise, just show a label with the participation status.
1.75
1.76 else:
1.77 - page.span(dict(self.partstat_items).get(partstat, ""), class_="partstat")
1.78 + page.span(dict(partstat_items).get(partstat, ""), class_="partstat")
1.79
1.80 page.td.close()
1.81 page.td()