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

@ -139,52 +139,52 @@ class EventType(GrampsType):
_DEFAULT = BIRTH
_DATAMAP = [
(UNKNOWN , _("Unknown"), "Unknown"),
(CUSTOM , _("Custom"), "Custom"),
(ADOPT , _("Adopted"), "Adopted"),
(BIRTH , _("Birth"), "Birth"),
(DEATH , _("Death"), "Death"),
(ADULT_CHRISTEN , _("Adult Christening"), "Adult Christening"),
(BAPTISM , _("Baptism"), "Baptism"),
(BAR_MITZVAH , _("Bar Mitzvah"), "Bar Mitzvah"),
(BAS_MITZVAH , _("Bas Mitzvah"), "Bas Mitzvah"),
(BLESS , _("Blessing"), "Blessing"),
(BURIAL , _("Burial"), "Burial"),
(CAUSE_DEATH , _("Cause Of Death"), "Cause Of Death"),
(CENSUS , _("Census"), "Census"),
(CHRISTEN , _("Christening"), "Christening"),
(CONFIRMATION , _("Confirmation"), "Confirmation"),
(CREMATION , _("Cremation"), "Cremation"),
(DEGREE , _("Degree"), "Degree"),
(EDUCATION , _("Education"), "Education"),
(ELECTED , _("Elected"), "Elected"),
(EMIGRATION , _("Emigration"), "Emigration"),
(FIRST_COMMUN , _("First Communion"), "First Communion"),
(IMMIGRATION , _("Immigration"), "Immigration"),
(GRADUATION , _("Graduation"), "Graduation"),
(MED_INFO , _("Medical Information"), "Medical Information"),
(MILITARY_SERV , _("Military Service"), "Military Service"),
(NATURALIZATION , _("Naturalization"), "Naturalization"),
(NOB_TITLE , _("Nobility Title"), "Nobility Title"),
(NUM_MARRIAGES , _("Number of Marriages"), "Number of Marriages"),
(OCCUPATION , _("Occupation"), "Occupation"),
(ORDINATION , _("Ordination"), "Ordination"),
(PROBATE , _("Probate"), "Probate"),
(PROPERTY , _("Property"), "Property"),
(RELIGION , _("Religion"), "Religion"),
(RESIDENCE , _("Residence"), "Residence"),
(RETIREMENT , _("Retirement"), "Retirement"),
(WILL , _("Will"), "Will"),
(MARRIAGE , _("Marriage"), "Marriage"),
(MARR_SETTL , _("Marriage Settlement"), "Marriage Settlement"),
(MARR_LIC , _("Marriage License"), "Marriage License"),
(MARR_CONTR , _("Marriage Contract"), "Marriage Contract"),
(MARR_BANNS , _("Marriage Banns"), "Marriage Banns"),
(ENGAGEMENT , _("Engagement"), "Engagement"),
(DIVORCE , _("Divorce"), "Divorce"),
(DIV_FILING , _("Divorce Filing"), "Divorce Filing"),
(ANNULMENT , _("Annulment"), "Annulment"),
(MARR_ALT , _("Alternate Marriage"), "Alternate Marriage"),
(UNKNOWN , _("Unknown"), "Unknown"),
(CUSTOM , _("Custom"), "Custom"),
(ADOPT , _("Adopted"), "Adopted"),
(BIRTH , _("Birth"), "Birth"),
(DEATH , _("Death"), "Death"),
(ADULT_CHRISTEN , _("Adult Christening"), "Adult Christening"),
(BAPTISM , _("Baptism"), "Baptism"),
(BAR_MITZVAH , _("Bar Mitzvah"), "Bar Mitzvah"),
(BAS_MITZVAH , _("Bas Mitzvah"), "Bas Mitzvah"),
(BLESS , _("Blessing"), "Blessing"),
(BURIAL , _("Burial"), "Burial"),
(CAUSE_DEATH , _("Cause Of Death"), "Cause Of Death"),
(CENSUS , _("Census"), "Census"),
(CHRISTEN , _("Christening"), "Christening"),
(CONFIRMATION , _("Confirmation"), "Confirmation"),
(CREMATION , _("Cremation"), "Cremation"),
(DEGREE , _("Degree"), "Degree"),
(EDUCATION , _("Education"), "Education"),
(ELECTED , _("Elected"), "Elected"),
(EMIGRATION , _("Emigration"), "Emigration"),
(FIRST_COMMUN , _("First Communion"), "First Communion"),
(IMMIGRATION , _("Immigration"), "Immigration"),
(GRADUATION , _("Graduation"), "Graduation"),
(MED_INFO , _("Medical Information"), "Medical Information"),
(MILITARY_SERV , _("Military Service"), "Military Service"),
(NATURALIZATION , _("Naturalization"), "Naturalization"),
(NOB_TITLE , _("Nobility Title"), "Nobility Title"),
(NUM_MARRIAGES , _("Number of Marriages"), "Number of Marriages"),
(OCCUPATION , _("Occupation"), "Occupation"),
(ORDINATION , _("Ordination"), "Ordination"),
(PROBATE , _("Probate"), "Probate"),
(PROPERTY , _("Property"), "Property"),
(RELIGION , _("Religion"), "Religion"),
(RESIDENCE , _("Residence"), "Residence"),
(RETIREMENT , _("Retirement"), "Retirement"),
(WILL , _("Will"), "Will"),
(MARRIAGE , _("Marriage"), "Marriage"),
(MARR_SETTL , _("Marriage Settlement"), "Marriage Settlement"),
(MARR_LIC , _("Marriage License"), "Marriage License"),
(MARR_CONTR , _("Marriage Contract"), "Marriage Contract"),
(MARR_BANNS , _("Marriage Banns"), "Marriage Banns"),
(ENGAGEMENT , _("Engagement"), "Engagement"),
(DIVORCE , _("Divorce"), "Divorce"),
(DIV_FILING , _("Divorce Filing"), "Divorce Filing"),
(ANNULMENT , _("Annulment"), "Annulment"),
(MARR_ALT , _("Alternate Marriage"), "Alternate Marriage"),
]
def __init__(self, value=None):

View File

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