Translation of family events

svn: r218
This commit is contained in:
Don Allingham 2001-07-03 17:14:17 +00:00
parent 7e5a282326
commit 9727dee5ee
3 changed files with 104 additions and 29 deletions

View File

@ -193,7 +193,7 @@ class EditPerson:
self.get_widget("user_label").set_text(Config.attr_name) self.get_widget("user_label").set_text(Config.attr_name)
val = "" val = ""
for attr in self.person.getAttributeList(): for attr in self.person.getAttributeList():
if attr.getType() == Config.attr_name: if attr.getType() == const.save_pattr(Config.attr_name):
val = attr.getValue() val = attr.getValue()
break break
self.get_widget("user_data").set_text(val) self.get_widget("user_data").set_text(val)
@ -338,7 +338,8 @@ class EditPerson:
detail = "N" detail = "N"
if attr.getSourceRef().getBase(): if attr.getSourceRef().getBase():
detail = detail + "S" detail = detail + "S"
self.attr_list.append([attr.getType(),attr.getValue(),detail]) self.attr_list.append([const.display_pattr(attr.getType()),\
attr.getValue(),detail])
self.attr_list.set_row_data(self.attr_index,attr) self.attr_list.set_row_data(self.attr_index,attr)
self.attr_index = self.attr_index + 1 self.attr_index = self.attr_index + 1
@ -509,7 +510,7 @@ def on_attr_list_select_row(obj,row,b,c):
edit_person_obj = obj.get_data(EDITPERSON) edit_person_obj = obj.get_data(EDITPERSON)
attr = obj.get_row_data(row) attr = obj.get_row_data(row)
edit_person_obj.attr_type.set_text(attr.getType()) edit_person_obj.attr_type.set_text(const.display_pattr(attr.getType()))
edit_person_obj.attr_value.set_text(attr.getValue()) edit_person_obj.attr_value.set_text(attr.getValue())
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -581,7 +582,7 @@ def on_update_attr_clicked(obj):
edit_person_obj = obj.get_data(EDITPERSON) edit_person_obj = obj.get_data(EDITPERSON)
attr = obj.get_row_data(row) attr = obj.get_row_data(row)
attr.setType(edit_person_obj.attr_type.get_text()) attr.setType(const.set_pattr(edit_person_obj.attr_type.get_text()))
attr.setValue(edit_person_obj.attr_value.get_text()) attr.setValue(edit_person_obj.attr_value.get_text())
edit_person_obj.redraw_attr_list() edit_person_obj.redraw_attr_list()
@ -733,7 +734,7 @@ def on_add_attr_clicked(obj):
attr = Attribute() attr = Attribute()
name = edit_person_obj.attr_type.get_text() name = edit_person_obj.attr_type.get_text()
attr.setType(name) attr.setType(const.set_pattr(name))
attr.setValue(edit_person_obj.attr_value.get_text()) attr.setValue(edit_person_obj.attr_value.get_text())
if name not in const.personalAttributes: if name not in const.personalAttributes:

View File

@ -881,6 +881,13 @@ class RelDataBase:
map[attr.getType()] = 1 map[attr.getType()] = 1
return map.keys() return map.keys()
def getFamilyEventTypes(self):
map = {}
for family in self.familyMap.values():
for attr in family.getEventList():
map[attr.getName()] = 1
return map.keys()
def getFamilyRelationTypes(self): def getFamilyRelationTypes(self):
map = {} map = {}
for family in self.familyMap.values(): for family in self.familyMap.values():

View File

@ -96,7 +96,6 @@ thumbScale = 100.0
indexFile = "data.gramps" indexFile = "data.gramps"
male = _("male") male = _("male")
female = _("female") female = _("female")
helpMenu = "contents.html"
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -233,22 +232,6 @@ _pe_l2e = {}
for a in _pe_e2l.keys(): for a in _pe_e2l.keys():
_pe_l2e[_pe_e2l[a]] = a _pe_l2e[_pe_e2l[a]] = a
personalConstantAttributes = {
"Description" : "DSCR",
"Identification Number": "IDNO",
"Social Security Number": "SSN"
}
familyConstantAttributes = {
}
familyConstantRelations = [
"Married",
"Common Law",
"Partners",
"Unknown"
]
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# #
@ -271,16 +254,100 @@ def save_pevent(st):
else: else:
return st return st
personalEvents = personalConstantEvents.keys() #-------------------------------------------------------------------------
personalEvents.sort() #
#
#
#-------------------------------------------------------------------------
personalConstantAttributes = {
"Description" : "DSCR",
"Identification Number" : "IDNO",
"Social Security Number": "SSN"
}
personalAttributes = personalConstantAttributes.keys() _pa_e2l = {
personalAttributes.sort() "Description" : _("Description"),
"Identification Number" : _("Identification Number"),
"Social Security Number": _("Social Security Number")
}
_pa_l2e = {}
for a in _pa_e2l.keys():
_pa_l2e[_pa_e2l[a]] = a
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def display_pattr(st):
if _pa_e2l.has_key(st):
return _pa_e2l[st]
else:
return st
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def save_pattr(st):
if _pa_l2e.has_key(st):
return _pa_l2e[st]
else:
return st
familyConstantAttributes = {
}
familyConstantRelations = [
"Married",
"Common Law",
"Partners",
"Unknown"
]
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def initialize_personal_event_list():
p = []
for event in personalConstantEvents.keys():
p.append(_pe_e2l[event])
p.sort()
return p
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def initialize_marriage_event_list():
p = []
for event in familyConstantEvents.keys():
p.append(_fe_e2l[event])
p.sort()
return p
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def initialize_personal_attribute_list():
p = []
for event in personalConstantAttributes.keys():
p.append(_pa_e2l[event])
p.sort()
return p
personalEvents = initialize_personal_event_list()
personalAttributes = initialize_personal_attribute_list()
marriageEvents = initialize_marriage_event_list()
familyAttributes = familyConstantAttributes.keys() familyAttributes = familyConstantAttributes.keys()
familyAttributes.sort() familyAttributes.sort()
marriageEvents = familyConstantEvents.keys()
marriageEvents.sort()
familyRelations = familyConstantRelations familyRelations = familyConstantRelations