Fixed event types not being translated in IndividualPages, Events section. Made some spacial alignment in eventtypes.py for better visual aid.

svn: r13748
This commit is contained in:
Rob G. Healey 2009-12-10 00:01:20 +00:00
parent 072826bc90
commit c544e79b22
2 changed files with 61 additions and 58 deletions

View File

@ -1,4 +1,3 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
@ -509,8 +508,6 @@ class BasePage(object):
@param: evt_ref = eent reference @param: evt_ref = eent reference
@param: showplc = show the event place or not? @param: showplc = show the event place or not?
@param: showdescr = to show the event description or not? @param: showdescr = to show the event description or not?
@param: showsrc = to show the event source references or not?
@param: shownote = show notes or not?
@param: up = either True or False; add subdirs or not? @param: up = either True or False; add subdirs or not?
@param: hyp = to hyperlink the event type or not? @param: hyp = to hyperlink the event type or not?
""" """
@ -518,11 +515,15 @@ class BasePage(object):
# get event type # get event type
evt_type = evt.type.xml_str() evt_type = evt.type.xml_str()
for xtype in EventType._DATAMAP:
if xtype[2] == evt_type:
etype = xtype[1]
break
# get hyperlink or not? # get hyperlink or not?
evt_hyper = evt_type evt_hyper = etype
if hyp: if hyp:
evt_hyper = self.event_link(evt_type, evt_ref.ref, gid, up) evt_hyper = self.event_link(etype, evt_ref.ref, gid, up)
# get place name # get place name
place = None place = None
@ -540,7 +541,8 @@ class BasePage(object):
# position 2 = data # position 2 = data
info = [ info = [
[_EVENT, "Event", evt_hyper], [_EVENT, "Event", evt_hyper],
[DHEAD, "Date", _dd.display(evt.get_date_object() )] ] [DHEAD, "Date", _dd.display(evt.get_date_object() )]
]
if showplc: if showplc:
info.append([PHEAD, "Place", place_hyper]) info.append([PHEAD, "Place", place_hyper])
@ -2345,6 +2347,7 @@ class EventListPage(BasePage):
# separate events by their type and then thier event handles # separate events by their type and then thier event handles
for (evt_type, datalist) in sort_event_types(db, event_types, event_handle_list): for (evt_type, datalist) in sort_event_types(db, event_types, event_handle_list):
evt_type = _("%(eventtype)s") % {'eventtype' : evt_type}
first_event = True first_event = True
for (gid, date, event_handle) in datalist: for (gid, date, event_handle) in datalist:
@ -2358,8 +2361,9 @@ class EventListPage(BasePage):
trow += tcell trow += tcell
if first_event: if first_event:
trow.attr = 'class = "BeginEvent"' trow.attr = 'class = "BeginEvent"'
tcell += Html("a", evt_type, name = "%s" % evt_type, tcell += Html("a", evt_type, name = evt_type,
title = _("Event types beginning with %s" % evt_type), inline = True) title = _("Event types beginning with %(eventtype)s") % {
'eventtype': evt_type}, inline = True)
else: else:
tcell += " " tcell += " "
@ -5235,7 +5239,7 @@ class NavWebReport(Report):
for person_handle in ind_list: for person_handle in ind_list:
person = db.get_person_from_handle(person_handle) person = db.get_person_from_handle(person_handle)
# begin events list for each new person # begin event list new for each person
event_list = [] event_list = []
# get sort name for sorting later # get sort name for sorting later
@ -5254,9 +5258,8 @@ class NavWebReport(Report):
# get event types for class EventsListPage # get event types for class EventsListPage
etype = None etype = None
_type = event.type.xml_str()
for xtype in EventType._DATAMAP: for xtype in EventType._DATAMAP:
if xtype[2] == _type: if xtype[2] == evt_type:
etype = xtype[1] etype = xtype[1]
break break