* src/Relationship.py (is_spouse): Use context.
* src/get_strings: Add "__" to default keywords. svn: r4866
This commit is contained in:
@@ -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>
|
2005-06-23 Julio Sanchez <jsanchez@users.sourceforge.net>
|
||||||
* src/WriteGedcom.py: Fix family source references, fix spurious
|
* src/WriteGedcom.py: Fix family source references, fix spurious
|
||||||
PLAC subrecords, respect more privacy settings
|
PLAC subrecords, respect more privacy settings
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
import RelLib
|
import RelLib
|
||||||
import types
|
import types
|
||||||
from gettext import gettext as _
|
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)
|
family = self.db.get_family_from_handle(f)
|
||||||
if family and other.get_handle() in [family.get_father_handle(),
|
if family and other.get_handle() in [family.get_father_handle(),
|
||||||
family.get_mother_handle()]:
|
family.get_mother_handle()]:
|
||||||
family_rel = family.get_relationship()
|
family_rel = family.get_relationship()
|
||||||
if other.get_gender() == RelLib.Person.MALE \
|
# Use person's gender
|
||||||
and family_rel != RelLib.Family.CIVIL_UNION:
|
if other.get_gender() == RelLib.Person.MALE:
|
||||||
return _("husband")
|
if family_rel == RelLib.Family.CIVIL_UNION:
|
||||||
elif other.get_gender() == RelLib.Person.FEMALE\
|
return __("male|partner")
|
||||||
and family_rel != RelLib.Family.CIVIL_UNION:
|
|
||||||
return _("wife")
|
|
||||||
else:
|
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:
|
else:
|
||||||
return None
|
return None
|
||||||
return None
|
return None
|
||||||
|
@@ -139,7 +139,7 @@ except ImportError:
|
|||||||
def _(s): return s
|
def _(s): return s
|
||||||
|
|
||||||
__version__ = '1.4'
|
__version__ = '1.4'
|
||||||
default_keywords = ['_']
|
default_keywords = ['_','__']
|
||||||
EMPTYSTRING = ''
|
EMPTYSTRING = ''
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user