From 44d7865a5e73ef2cc99807f0bc438c50b7babf13 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Thu, 23 Jun 2005 16:29:06 +0000 Subject: [PATCH] * src/Relationship.py (is_spouse): Use context. * src/get_strings: Add "__" to default keywords. svn: r4866 --- gramps2/ChangeLog | 4 ++++ gramps2/src/Relationship.py | 36 ++++++++++++++++++++++++++++-------- gramps2/src/get_strings | 2 +- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 0d9cb3810..06882a31c 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2005-06-23 Alex Roitman + * src/Relationship.py (is_spouse): Use context. + * src/get_strings: Add "__" to default keywords. + 2005-06-23 Julio Sanchez * src/WriteGedcom.py: Fix family source references, fix spurious PLAC subrecords, respect more privacy settings diff --git a/gramps2/src/Relationship.py b/gramps2/src/Relationship.py index 40b821363..c08905fba 100644 --- a/gramps2/src/Relationship.py +++ b/gramps2/src/Relationship.py @@ -29,6 +29,7 @@ import RelLib import types from gettext import gettext as _ +from Utils import strip_context as __ #------------------------------------------------------------------------- # @@ -242,15 +243,34 @@ class RelationshipCalculator: family = self.db.get_family_from_handle(f) if family and other.get_handle() in [family.get_father_handle(), family.get_mother_handle()]: - family_rel = family.get_relationship() - if other.get_gender() == RelLib.Person.MALE \ - and family_rel != RelLib.Family.CIVIL_UNION: - return _("husband") - elif other.get_gender() == RelLib.Person.FEMALE\ - and family_rel != RelLib.Family.CIVIL_UNION: - return _("wife") + family_rel = family.get_relationship() + # Use person's gender + if other.get_gender() == RelLib.Person.MALE: + if family_rel == RelLib.Family.CIVIL_UNION: + return __("male|partner") else: - return _("partner") + return _("husband") + elif other.get_gender() == RelLib.Person.FEMALE: + if family_rel == RelLib.Family.CIVIL_UNION: + return __("female|partner") + else: + return _("wife") + # Gender is unknown, try using other person's gender + elif orig.get_gender() == RelLib.Person.MALE: + if family_rel == RelLib.Family.CIVIL_UNION: + return __("female|partner") + else: + return _("wife") + elif orig.get_gender() == RelLib.Person.FEMALE: + if family_rel == RelLib.Family.CIVIL_UNION: + return __("male|partner") + else: + return _("husband") + # Gender of both people is unknown, go with family rel alone + elif family_rel == RelLib.Family.CIVIL_UNION: + return __("gender unknown|partner") + else: + return __("gender unknown|spouse") else: return None return None diff --git a/gramps2/src/get_strings b/gramps2/src/get_strings index 93289cf2c..d21a5e747 100755 --- a/gramps2/src/get_strings +++ b/gramps2/src/get_strings @@ -139,7 +139,7 @@ except ImportError: def _(s): return s __version__ = '1.4' -default_keywords = ['_'] +default_keywords = ['_','__'] EMPTYSTRING = ''