1.1 --- a/imipweb/event.py Wed Nov 04 23:35:16 2015 +0100
1.2 +++ b/imipweb/event.py Thu Nov 05 00:58:02 2015 +0100
1.3 @@ -138,6 +138,8 @@
1.4
1.5 "Show form controls for a request."
1.6
1.7 + _ = self.get_translator()
1.8 +
1.9 page = self.page
1.10 args = self.env.get_args()
1.11
1.12 @@ -145,41 +147,41 @@
1.13 is_attendee = self.user in attendees
1.14
1.15 if not self.obj.is_shared():
1.16 - page.p("This event has not been shared.")
1.17 + page.p(_("This event has not been shared."))
1.18
1.19 # Show appropriate options depending on the role of the user.
1.20
1.21 if is_attendee and not self.is_organiser():
1.22 - page.p("An action is required for this request:")
1.23 + page.p(_("An action is required for this request:"))
1.24
1.25 page.p()
1.26 - self.control("reply", "submit", "Send reply")
1.27 + self.control("reply", "submit", _("Send reply"))
1.28 page.add(" ")
1.29 - self.control("discard", "submit", "Discard event")
1.30 + self.control("discard", "submit", _("Discard event"))
1.31 page.add(" ")
1.32 - self.control("ignore", "submit", "Return to the calendar", class_="ignore")
1.33 + self.control("ignore", "submit", _("Return to the calendar"), class_="ignore")
1.34 page.p.close()
1.35
1.36 if self.is_organiser():
1.37 - page.p("As organiser, you can perform the following:")
1.38 + page.p(_("As organiser, you can perform the following:"))
1.39
1.40 page.p()
1.41 - self.control("create", "submit", "Update event")
1.42 + self.control("create", "submit", _("Update event"))
1.43 page.add(" ")
1.44
1.45 if self._get_counters(self.uid, self.recurrenceid):
1.46 - self.control("uncounter", "submit", "Ignore counter-proposals")
1.47 + self.control("uncounter", "submit", _("Ignore counter-proposals"))
1.48 page.add(" ")
1.49
1.50 if self.obj.is_shared() and not self._is_request():
1.51 - self.control("cancel", "submit", "Cancel event")
1.52 + self.control("cancel", "submit", _("Cancel event"))
1.53 else:
1.54 - self.control("discard", "submit", "Discard event")
1.55 + self.control("discard", "submit", _("Discard event"))
1.56
1.57 page.add(" ")
1.58 - self.control("ignore", "submit", "Return to the calendar", class_="ignore")
1.59 + self.control("ignore", "submit", _("Return to the calendar"), class_="ignore")
1.60 page.add(" ")
1.61 - self.control("save", "submit", "Save without sending")
1.62 + self.control("save", "submit", _("Save without sending"))
1.63 page.p.close()
1.64
1.65 def show_object_on_page(self, errors=None):
1.66 @@ -189,6 +191,8 @@
1.67 a suitable message for the different errors provided.
1.68 """
1.69
1.70 + _ = self.get_translator()
1.71 +
1.72 page = self.page
1.73 page.form(method="POST")
1.74
1.75 @@ -216,7 +220,7 @@
1.76 page.table(class_="object", cellspacing=5, cellpadding=5)
1.77 page.thead()
1.78 page.tr()
1.79 - page.th("Event", class_="mainheading", colspan=3)
1.80 + page.th(_("Event"), class_="mainheading", colspan=3)
1.81 page.tr.close()
1.82 page.thead.close()
1.83 page.tbody()
1.84 @@ -263,7 +267,7 @@
1.85
1.86 if replaced:
1.87 page.td(class_="objectvalue %s replaced" % field, rowspan=2, colspan=2)
1.88 - page.a("First occurrence replaced by a separate event", href=self.link_to(self.uid, replaced))
1.89 + page.a(_("First occurrence replaced by a separate event"), href=self.link_to(self.uid, replaced))
1.90 page.td.close()
1.91
1.92 # NOTE: Should provide a way of editing recurrences when the
1.93 @@ -272,7 +276,7 @@
1.94
1.95 elif excluded:
1.96 page.td(class_="objectvalue %s excluded" % field, rowspan=2, colspan=2)
1.97 - page.add("First occurrence excluded")
1.98 + page.add(_("First occurrence excluded"))
1.99 page.td.close()
1.100
1.101 page.tr.close()
1.102 @@ -283,7 +287,7 @@
1.103 page.tr()
1.104 page.td(colspan=2)
1.105 self.control("recur-add", "submit", "add", id="recur-add", class_="add")
1.106 - page.label("Add a recurrence", for_="recur-add", class_="add")
1.107 + page.label(_("Add a recurrence"), for_="recur-add", class_="add")
1.108 page.td.close()
1.109 page.tr.close()
1.110
1.111 @@ -324,7 +328,7 @@
1.112
1.113 page.td(colspan=2)
1.114 self.control("add", "submit", "add", id="add", class_="add")
1.115 - page.label("Add attendee", for_="add", class_="add")
1.116 + page.label(_("Add attendee"), for_="add", class_="add")
1.117 page.td.close()
1.118 page.tr.close()
1.119
1.120 @@ -364,6 +368,8 @@
1.121 'attendee' value, having 'attendee_attr' as any stored attributes.
1.122 """
1.123
1.124 + _ = self.get_translator()
1.125 +
1.126 page = self.page
1.127 args = self.env.get_args()
1.128
1.129 @@ -411,10 +417,10 @@
1.130 remove_type = self.can_remove_attendee(attendee_uri) and "submit" or "checkbox"
1.131 self.control("remove", remove_type, str(i), str(i) in args.get("remove", []), id="remove-%d" % i, class_="remove")
1.132
1.133 - page.label("Remove", for_="remove-%d" % i, class_="remove")
1.134 + page.label(_("Remove"), for_="remove-%d" % i, class_="remove")
1.135 page.label(for_="remove-%d" % i, class_="removed")
1.136 - page.add("(Uninvited)")
1.137 - page.span("Re-invite", class_="action")
1.138 + page.add(_("(Uninvited)"))
1.139 + page.span(_("Re-invite"), class_="action")
1.140 page.label.close()
1.141
1.142 page.td.close()
1.143 @@ -426,6 +432,8 @@
1.144 suitable message for the different errors provided.
1.145 """
1.146
1.147 + _ = self.get_translator()
1.148 +
1.149 page = self.page
1.150
1.151 # Obtain any parent object if this object is a specific recurrence.
1.152 @@ -436,7 +444,7 @@
1.153 return
1.154
1.155 page.p()
1.156 - page.a("This event modifies a recurring event.", href=self.link_to(self.uid))
1.157 + page.a(_("This event modifies a recurring event."), href=self.link_to(self.uid))
1.158 page.p.close()
1.159
1.160 # Obtain the periods associated with the event.
1.161 @@ -446,7 +454,7 @@
1.162 if len(recurrences) < 1:
1.163 return
1.164
1.165 - page.p("This event occurs on the following occasions within the next %d days:" % self.get_window_size())
1.166 + page.p(_("This event occurs on the following occasions within the next %d days:") % self.get_window_size())
1.167
1.168 # Show each recurrence in a separate table.
1.169
1.170 @@ -465,6 +473,8 @@
1.171 provided.
1.172 """
1.173
1.174 + _ = self.get_translator()
1.175 +
1.176 page = self.page
1.177 args = self.env.get_args()
1.178
1.179 @@ -475,7 +485,7 @@
1.180 self.show_object_datetime_controls(period, index)
1.181
1.182 page.table(cellspacing=5, cellpadding=5, class_="recurrence")
1.183 - page.caption(period.origin == "RRULE" and "Occurrence from rule" or "Occurrence")
1.184 + page.caption(period.origin == "RRULE" and _("Occurrence from rule") or _("Occurrence"))
1.185 page.tbody()
1.186
1.187 page.tr()
1.188 @@ -506,10 +516,10 @@
1.189 str(index) in args.get("recur-remove", []),
1.190 id="recur-remove-%d" % index, class_="remove")
1.191
1.192 - page.label("Remove", for_="recur-remove-%d" % index, class_="remove")
1.193 + page.label(_("Remove"), for_="recur-remove-%d" % index, class_="remove")
1.194 page.label(for_="recur-remove-%d" % index, class_="removed")
1.195 - page.add("(Removed)")
1.196 - page.span("Re-add", class_="action")
1.197 + page.add(_("(Removed)"))
1.198 + page.span(_("Re-add"), class_="action")
1.199 page.label.close()
1.200
1.201 page.td.close()
1.202 @@ -524,6 +534,8 @@
1.203
1.204 "Show any counter-proposals for the current object."
1.205
1.206 + _ = self.get_translator()
1.207 +
1.208 page = self.page
1.209 query = self.env.get_query()
1.210 counter = query.get("counter", [None])[0]
1.211 @@ -569,13 +581,13 @@
1.212 # Present the suggested attendees.
1.213
1.214 if suggested_attendees:
1.215 - page.p("The following attendees have been suggested for this event:")
1.216 + page.p(_("The following attendees have been suggested for this event:"))
1.217
1.218 page.table(cellspacing=5, cellpadding=5, class_="counters")
1.219 page.thead()
1.220 page.tr()
1.221 - page.th("Attendee")
1.222 - page.th("Suggested by...")
1.223 + page.th(_("Attendee"))
1.224 + page.th(_("Suggested by..."))
1.225 page.tr.close()
1.226 page.thead.close()
1.227 page.tbody()
1.228 @@ -599,17 +611,17 @@
1.229 # Present the suggested periods.
1.230
1.231 if suggested_periods:
1.232 - page.p("The following periods have been suggested for this event:")
1.233 + page.p(_("The following periods have been suggested for this event:"))
1.234
1.235 page.table(cellspacing=5, cellpadding=5, class_="counters")
1.236 page.thead()
1.237 page.tr()
1.238 - page.th("Periods", colspan=2)
1.239 - page.th("Suggested by...", rowspan=2)
1.240 + page.th(_("Periods"), colspan=2)
1.241 + page.th(_("Suggested by..."), rowspan=2)
1.242 page.tr.close()
1.243 page.tr()
1.244 - page.th("Start")
1.245 - page.th("End")
1.246 + page.th(_("Start"))
1.247 + page.th(_("End"))
1.248 page.tr.close()
1.249 page.thead.close()
1.250 page.tbody()
1.251 @@ -658,6 +670,8 @@
1.252
1.253 "Show conflicting events for the current object."
1.254
1.255 + _ = self.get_translator()
1.256 +
1.257 page = self.page
1.258 recurrenceids = self._get_active_recurrences(self.uid)
1.259
1.260 @@ -713,14 +727,14 @@
1.261 # Show any conflicts with periods of actual attendance.
1.262
1.263 if conflicts:
1.264 - page.p("This event conflicts with others:")
1.265 + page.p(_("This event conflicts with others:"))
1.266
1.267 page.table(cellspacing=5, cellpadding=5, class_="conflicts")
1.268 page.thead()
1.269 page.tr()
1.270 - page.th("Event")
1.271 - page.th("Start")
1.272 - page.th("End")
1.273 + page.th(_("Event"))
1.274 + page.th(_("Start"))
1.275 + page.th(_("End"))
1.276 page.tr.close()
1.277 page.thead.close()
1.278 page.tbody()
1.279 @@ -740,7 +754,7 @@
1.280 if p.summary:
1.281 page.a(p.summary, href=self.link_to(p.uid, p.recurrenceid))
1.282 else:
1.283 - page.add("(Unspecified event)")
1.284 + page.add(_("(Unspecified event)"))
1.285 page.td.close()
1.286
1.287 page.td(start)
1.288 @@ -1265,7 +1279,9 @@
1.289 self.update_current_attendees()
1.290 self.update_current_recurrences()
1.291
1.292 - self.new_page(title="Event")
1.293 + _ = self.get_translator()
1.294 +
1.295 + self.new_page(title=_("Event"))
1.296 self.show_object_on_page(errors)
1.297
1.298 return True