* src/Relationship.py (is_spouse): Use context.

* src/get_strings: Add "__" to default keywords.


svn: r4866
This commit is contained in:
Alex Roitman 2005-06-23 16:29:06 +00:00
parent 8187ddc350
commit 44d7865a5e
3 changed files with 33 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2005-06-23 Alex Roitman <shura@gramps-project.org>
* src/Relationship.py (is_spouse): Use context.
* src/get_strings: Add "__" to default keywords.
2005-06-23 Julio Sanchez <jsanchez@users.sourceforge.net>
* src/WriteGedcom.py: Fix family source references, fix spurious
PLAC subrecords, respect more privacy settings

View File

@ -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

View File

@ -139,7 +139,7 @@ except ImportError:
def _(s): return s
__version__ = '1.4'
default_keywords = ['_']
default_keywords = ['_','__']
EMPTYSTRING = ''