From 586640c42bdfc936e736d4213a45c52d85d9b1d2 Mon Sep 17 00:00:00 2001 From: DaveSch-gramps Date: Fri, 3 Jan 2025 14:52:26 -0500 Subject: [PATCH 1/4] Fix Mother-Father --- gramps/plugins/view/relview.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index e1bd55feb58..0be8b65ff24 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -1107,9 +1107,33 @@ def write_parents(self, family_handle, person=None): ) self.row += 1 # now advance it else: - self.write_label(_("%s:") % _("Parents"), family, True, person) - self.write_person(_("Father"), family.get_father_handle()) - self.write_person(_("Mother"), family.get_mother_handle()) + if family: + father = mother = None + hd21 = family.get_father_handle() + if hd21: + father = self.dbstate.db.get_person_from_handle(hd21).gender + hd22 = family.get_mother_handle() + if hd22: + mother = self.dbstate.db.get_person_from_handle(hd22).gender + + parent1 = parent2 = "" + if father == Person.MALE: + parent1 = ("Father") + elif father == Person.FEMALE: + parent1 = _("Mother") + else: + parent1 = _("Parent") + + if mother == Person.FEMALE: + parent2 = _("Mother") + elif mother == Person.MALE: + parent2 = _("Father") + else: + parent2 = _("Parent") + + self.write_label(_("%s:") % _("Parents"), family, True, person) + self.write_person(parent1, family.get_father_handle()) + self.write_person(parent2, family.get_mother_handle()) if self.show_siblings: active = self.get_active() From 2f35363baf6735e1172a0a7d47f94f51aa297920 Mon Sep 17 00:00:00 2001 From: DaveSch-gramps Date: Fri, 3 Jan 2025 14:57:37 -0500 Subject: [PATCH 2/4] Fix Spouse-Partner --- gramps/plugins/view/relview.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index 0be8b65ff24..4d5ca3712fb 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -1675,11 +1675,15 @@ def write_family(self, family_handle, person=None): else: # show "V Family: ..." and the rest self.write_label(_("%s:") % _("Family"), family, False, person) - if handle or family.get_relationship() != FamilyRelType.UNKNOWN: + if family.get_relationship() == FamilyRelType.MARRIED: box = self.write_person(_("Spouse"), handle) + elif family.get_relationship() == FamilyRelType.CIVIL_UNION: + box = self.write_person(_("Spouse"), handle) + else: + box = self.write_person(_("Partner"), handle) - if not self.write_relationship_events(box, family): - self.write_relationship(box, family) + if not self.write_relationship_events(box, family): + self.write_relationship(box, family) hbox = Gtk.Box() if self.check_collapsed(family.handle, "CHILDREN"): From 6a0f2a07e4639d6033b0415db4bab1e63c1d675d Mon Sep 17 00:00:00 2001 From: DaveSch-gramps Date: Sat, 4 Jan 2025 09:55:26 -0500 Subject: [PATCH 3/4] Husband-Wife labels --- gramps/plugins/view/relview.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index 4d5ca3712fb..60cb553a6eb 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -1642,10 +1642,20 @@ def write_family(self, family_handle, person=None): father_handle = family.get_father_handle() mother_handle = family.get_mother_handle() + spouse = spouse1 = spouse2 = None + hd21 = family.get_father_handle() + if hd21: + spouse1 = self.dbstate.db.get_person_from_handle(hd21).gender + hd22 = family.get_mother_handle() + if hd22: + spouse2 = self.dbstate.db.get_person_from_handle(hd22).gender + if self.get_active() == father_handle: handle = mother_handle + spouse = spouse2 else: handle = father_handle + spouse = spouse1 # collapse button if self.check_collapsed(person.handle, family_handle): @@ -1676,9 +1686,19 @@ def write_family(self, family_handle, person=None): # show "V Family: ..." and the rest self.write_label(_("%s:") % _("Family"), family, False, person) if family.get_relationship() == FamilyRelType.MARRIED: - box = self.write_person(_("Spouse"), handle) + if spouse == Person.MALE: + box = self.write_person(_("Husband"), handle) + elif spouse == Person.FEMALE: + box = self.write_person(_("Wife"), handle) + else: + box = self.write_person(_("Spouse"), handle) elif family.get_relationship() == FamilyRelType.CIVIL_UNION: - box = self.write_person(_("Spouse"), handle) + if spouse == Person.MALE: + box = self.write_person(_("Husband"), handle) + elif spouse == Person.FEMALE: + box = self.write_person(_("Wife"), handle) + else: + box = self.write_person(_("Spouse"), handle) else: box = self.write_person(_("Partner"), handle) From f08fad4f1c35185876fa63d968445bbf7717d463 Mon Sep 17 00:00:00 2001 From: DaveSch-gramps Date: Sat, 4 Jan 2025 10:13:25 -0500 Subject: [PATCH 4/4] Fix translating --- gramps/plugins/view/relview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gramps/plugins/view/relview.py b/gramps/plugins/view/relview.py index 60cb553a6eb..dbff2f8b8a6 100644 --- a/gramps/plugins/view/relview.py +++ b/gramps/plugins/view/relview.py @@ -1118,7 +1118,7 @@ def write_parents(self, family_handle, person=None): parent1 = parent2 = "" if father == Person.MALE: - parent1 = ("Father") + parent1 = _("Father") elif father == Person.FEMALE: parent1 = _("Mother") else: