Make in-law relationships easier to translate for the Kinship Report.
svn: r14053
This commit is contained in:
		@@ -229,6 +229,8 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
                rel_str = _lineal_up[gender]
 | 
			
		||||
            elif removed < 0:
 | 
			
		||||
                rel_str = _lineal_down[gender]
 | 
			
		||||
            elif in_law_a or in_law_b:
 | 
			
		||||
                rel_str = u'Partner'
 | 
			
		||||
            else:
 | 
			
		||||
                rel_str = u'Proband'
 | 
			
		||||
        else:
 | 
			
		||||
@@ -249,8 +251,13 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
                rel_str = _collateral_same[gender]
 | 
			
		||||
        return self._fix_caps(rel_str % {'p': pre, 's': post})
 | 
			
		||||
 | 
			
		||||
    def get_plural_relationship_string(self, Ga, Gb):
 | 
			
		||||
        return self._get_relationship_string(Ga, Gb, 'many')
 | 
			
		||||
    def get_plural_relationship_string(self, Ga, Gb,
 | 
			
		||||
                                       reltocommon_a='', reltocommon_b='',
 | 
			
		||||
                                       only_birth=True,
 | 
			
		||||
                                       in_law_a=False, in_law_b=False):
 | 
			
		||||
        return self._get_relationship_string(Ga, Gb, 'many',
 | 
			
		||||
                                             reltocommon_a, reltocommon_b,
 | 
			
		||||
                                             only_birth, in_law_a, in_law_b)
 | 
			
		||||
 | 
			
		||||
    def get_single_relationship_string(self, Ga, Gb, gender_a, gender_b,
 | 
			
		||||
                                       reltocommon_a, reltocommon_b,
 | 
			
		||||
 
 | 
			
		||||
@@ -426,7 +426,10 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
 | 
			
		||||
# kinship report
 | 
			
		||||
 | 
			
		||||
    def get_plural_relationship_string(self, Ga, Gb):
 | 
			
		||||
    def get_plural_relationship_string(self, Ga, Gb,
 | 
			
		||||
                                       reltocommon_a='', reltocommon_b='',
 | 
			
		||||
                                       only_birth=True,
 | 
			
		||||
                                       in_law_a=False, in_law_b=False):
 | 
			
		||||
        """
 | 
			
		||||
        voir Relationship.py
 | 
			
		||||
        """
 | 
			
		||||
@@ -507,8 +510,7 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
            elif Ga < len(_LEVEL_NAME):
 | 
			
		||||
                rel_str = u"les grands-oncles et grands-tantes" + bygen % \
 | 
			
		||||
                    (Ga + 1)
 | 
			
		||||
            else:
 | 
			
		||||
                return rel_str
 | 
			
		||||
 | 
			
		||||
        elif Gb > 1 and Gb > Ga:
 | 
			
		||||
 | 
			
		||||
            # These are cousins in different generations with the second person
 | 
			
		||||
@@ -529,8 +531,10 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
                rel_str = u"les neveux et nièces" + can + civ
 | 
			
		||||
            elif Ga < len(_LEVEL_NAME):
 | 
			
		||||
                rel_str = u"les neveux et nièces" + bygen % Gb
 | 
			
		||||
            else:
 | 
			
		||||
                return rel_str
 | 
			
		||||
            
 | 
			
		||||
        if in_law_b == True:
 | 
			
		||||
            rel_str = "conjoints des %s" % rel_str
 | 
			
		||||
            
 | 
			
		||||
        return rel_str
 | 
			
		||||
 | 
			
		||||
# quick report (missing on RelCalc tool - Status Bar)
 | 
			
		||||
 
 | 
			
		||||
@@ -434,7 +434,10 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
                return (self.get_junior_female_cousin(Ga-1, Gb-Ga))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    def get_plural_relationship_string(self, Ga, Gb):
 | 
			
		||||
    def get_plural_relationship_string(self, Ga, Gb,
 | 
			
		||||
                                       reltocommon_a='', reltocommon_b='',
 | 
			
		||||
                                       only_birth=True,
 | 
			
		||||
                                       in_law_a=False, in_law_b=False):
 | 
			
		||||
        rel_str = u"дальние родственники"
 | 
			
		||||
        if Ga == 0:
 | 
			
		||||
            # These are descendants
 | 
			
		||||
@@ -478,6 +481,11 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
                                                    _juniors_removed_level[Gb-Ga] )
 | 
			
		||||
            else:
 | 
			
		||||
                rel_str =  u"(младшие) дальние родственники"
 | 
			
		||||
                
 | 
			
		||||
        if in_law_b == True:
 | 
			
		||||
            # TODO: Translate this!
 | 
			
		||||
            rel_str = "spouses of %s" % rel_str
 | 
			
		||||
                
 | 
			
		||||
        return rel_str
 | 
			
		||||
 | 
			
		||||
# TODO: def get_sibling_relationship_string for Russian step and inlaw relations
 | 
			
		||||
 
 | 
			
		||||
@@ -225,7 +225,10 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
 | 
			
		||||
# kinship report
 | 
			
		||||
 | 
			
		||||
    def get_plural_relationship_string(self, Ga, Gb):
 | 
			
		||||
    def get_plural_relationship_string(self, Ga, Gb,
 | 
			
		||||
                                       reltocommon_a='', reltocommon_b='',
 | 
			
		||||
                                       only_birth=True,
 | 
			
		||||
                                       in_law_a=False, in_law_b=False):
 | 
			
		||||
        """
 | 
			
		||||
        see Relationship.py
 | 
			
		||||
        """
 | 
			
		||||
@@ -289,8 +292,6 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
            elif Ga < len(_level_name):
 | 
			
		||||
                rel_str = "prastrýkovia a pratety" + bygen % (
 | 
			
		||||
                               Ga+1)
 | 
			
		||||
            else:
 | 
			
		||||
                return rel_str
 | 
			
		||||
        elif Gb > 1 and Gb > Ga:
 | 
			
		||||
            # These are cousins in different generations with the second person 
 | 
			
		||||
            # being in a lower generation from the common ancestor than the 
 | 
			
		||||
@@ -307,8 +308,10 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
            elif Ga < len(_level_name):
 | 
			
		||||
                rel_str =  "synovci a netere" + bygen % (
 | 
			
		||||
                                Gb)
 | 
			
		||||
            else:
 | 
			
		||||
                return rel_str
 | 
			
		||||
        if in_law_b == True:
 | 
			
		||||
            # TODO: Translate this!
 | 
			
		||||
            rel_str = "spouses of %s" % rel_str
 | 
			
		||||
            
 | 
			
		||||
        return rel_str
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -311,7 +311,10 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
        return rel_str
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    def get_plural_relationship_string(self, Ga, Gb):
 | 
			
		||||
    def get_plural_relationship_string(self, Ga, Gb,
 | 
			
		||||
                                       reltocommon_a='', reltocommon_b='',
 | 
			
		||||
                                       only_birth=True,
 | 
			
		||||
                                       in_law_a=False, in_law_b=False):
 | 
			
		||||
        """
 | 
			
		||||
        Provide a string that describes the relationsip between a person, and
 | 
			
		||||
        a group of people with the same relationship. E.g. "grandparents" or
 | 
			
		||||
@@ -394,6 +397,11 @@ class RelationshipCalculator(Relationship.RelationshipCalculator):
 | 
			
		||||
                rel_str = self.pair_up(result,'')                
 | 
			
		||||
            else:
 | 
			
		||||
                rel_str =  u"avlägsna kusiner"
 | 
			
		||||
                
 | 
			
		||||
        if in_law_b == True:
 | 
			
		||||
            # TODO: Translate this!
 | 
			
		||||
            rel_str = "spouses of %s" % rel_str
 | 
			
		||||
                
 | 
			
		||||
        return rel_str
 | 
			
		||||
 | 
			
		||||
    def get_single_relationship_string(self, Ga, Gb, gender_a, gender_b,
 | 
			
		||||
 
 | 
			
		||||
@@ -64,8 +64,9 @@ plg.fname = 'rel_de.py'
 | 
			
		||||
plg.ptype = RELCALC
 | 
			
		||||
plg.relcalcclass = 'RelationshipCalculator'
 | 
			
		||||
plg.lang_list = ["de", "DE", "de_DE", "deutsch", "Deutsch", "de_DE.UTF8", 
 | 
			
		||||
                 "de_DE@euro", "de_DE.UTF8@euro",
 | 
			
		||||
                 "de_DE@euro", "de_DE.UTF8@euro", "de_AT.UTF-8",
 | 
			
		||||
                 "german","German", "de_DE.UTF-8", "de_DE.utf-8", "de_DE.utf8"]
 | 
			
		||||
 | 
			
		||||
# es
 | 
			
		||||
plg = newplugin()
 | 
			
		||||
plg.id    = 'relcalc_es'
 | 
			
		||||
 
 | 
			
		||||
@@ -128,13 +128,15 @@ class KinshipReport(Report):
 | 
			
		||||
                elif x > 1 and not self.inc_cousins:
 | 
			
		||||
                    continue
 | 
			
		||||
                
 | 
			
		||||
                title = self.rel_calc.get_plural_relationship_string(Ga, Gb)
 | 
			
		||||
                get_rel_str = self.rel_calc.get_plural_relationship_string
 | 
			
		||||
                
 | 
			
		||||
                title = get_rel_str(Ga, Gb, in_law_b=False)
 | 
			
		||||
                self.write_people(title, self.kinship_map[Ga][Gb])
 | 
			
		||||
                
 | 
			
		||||
                if self.inc_spouses and \
 | 
			
		||||
                   Ga in self.spouse_map and \
 | 
			
		||||
                   Gb in self.spouse_map[Ga]:
 | 
			
		||||
                    title = _("spouses of %s") % title
 | 
			
		||||
                    title = get_rel_str(Ga, Gb, in_law_b=True)
 | 
			
		||||
                    self.write_people(title, self.spouse_map[Ga][Gb])
 | 
			
		||||
 | 
			
		||||
    def traverse_down(self, person_handle, Ga, Gb, skip_handle=None):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user