Exemplo n.º 1
2
/**
 * print the information for an individual chart box
 *
 * find and print a given individuals information for a pedigree chart
 * @param string $pid the Gedcom Xref ID of the individual to print
 */
function print_pedigree_person_nav2($pid)
{
    global $spouselinks, $parentlinks, $step_parentlinks, $persons, $person_step, $person_parent;
    global $natdad, $natmom;
    $person = WT_Individual::getInstance($pid);
    if ($pid == false || empty($person)) {
        $spouselinks = false;
        $parentlinks = false;
        $step_parentlinks = false;
    }
    $tmp = array('M' => '', 'F' => 'F', 'U' => 'NN');
    $isF = $tmp[$person->getSex()];
    $spouselinks = "";
    $parentlinks = "";
    $step_parentlinks = "";
    if ($person->canShowName()) {
        //-- draw a box for the family popup
        $spouselinks .= "<table id=\"flyoutFam\" class=\"person_box{$isF}\"><tr><td class=\"name2 ltr\">";
        $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" . $person->getFullName() . ")<br>";
        $parentlinks .= "<table id=\"flyoutPar\" class=\"person_box{$isF}\"><tr><td class=\"name2 ltr\">";
        $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" . $person->getFullName() . ")<br>";
        $step_parentlinks .= "<table id=\"flyoutStep\" class=\"person_box{$isF}\"><tr><td class=\"name2 ltr\">";
        $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" . $person->getFullName() . ")<br>";
        $persons = '';
        $person_parent = '';
        $person_step = '';
        //-- parent families --------------------------------------
        foreach ($person->getChildFamilies() as $family) {
            $husb = $family->getHusband($person);
            $wife = $family->getWife($person);
            $children = $family->getChildren();
            if ($husb || $children) {
                if ($husb) {
                    $person_parent = "Yes";
                    if ($husb->canShowName()) {
                        $fulln = strip_tags($husb->getFullName());
                        $parentlinks .= "<a href=\"#\" onclick=\"opener.insertRowToTable(";
                        $parentlinks .= "'" . $husb->getXref() . "', ";
                        // pid = PID
                        $parentlinks .= "'" . htmlentities($fulln) . "', ";
                        // nam = Name
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "''";
                        $parentlinks .= ");\">";
                        $parentlinks .= $husb->getFullName();
                        $parentlinks .= "</a>";
                    } else {
                        $parentlinks .= WT_I18N::translate('Private');
                    }
                    $natdad = "yes";
                }
            }
            if ($wife || $children) {
                if ($wife) {
                    $person_parent = "Yes";
                    if ($wife->canShowName()) {
                        $fulln = strip_tags($wife->getFullName());
                        $parentlinks .= "<a href=\"#\" onclick=\"opener.insertRowToTable(";
                        $parentlinks .= "'" . $wife->getXref() . "',";
                        // pid = PID
                        $parentlinks .= "'" . htmlentities($fulln) . "',";
                        // nam = Full Name
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "'',";
                        $parentlinks .= "''";
                        $parentlinks .= ");\">";
                        $parentlinks .= $wife->getFullName();
                        $parentlinks .= "</a>";
                    } else {
                        $parentlinks .= WT_I18N::translate('Private');
                    }
                    $parentlinks .= "<br>";
                    $natmom = "yes";
                }
            }
        }
        //-- step families -----------------------------------------
        $fams = $person->getChildStepFamilies();
        foreach ($fams as $family) {
            if (!is_null($family)) {
                $husb = $family->getHusband($person);
                $wife = $family->getWife($person);
                $children = $family->getChildren();
                if ($natdad == "yes") {
                } else {
                    // Husband -----------------------
                    if (($husb || $children) && $husb->getLabel() != ".") {
                        if ($husb) {
                            $person_step = "Yes";
                            $tmp = $husb->getXref();
                            if ($husb->canShowName()) {
                                $parentlinks .= "<a href=\"individual.php?pid={$tmp}&amp;&amp;gedcom=" . WT_GEDURL . "\">";
                                $parentlinks .= $husb->getFullName();
                                $parentlinks .= "</a>";
                            } else {
                                $parentlinks .= WT_I18N::translate('Private');
                            }
                            $parentlinks .= "<br>";
                        }
                    }
                }
                if ($natmom == "yes") {
                } else {
                    // Wife ----------------------------
                    if ($wife || $children) {
                        if ($wife) {
                            $person_step = "Yes";
                            $tmp = $wife->getXref();
                            if ($wife->canShowName()) {
                                $parentlinks .= "<a href=\"individual.php?pid={$tmp}&amp;gedcom=" . WT_GEDURL . "\">";
                                $parentlinks .= $wife->getFullName();
                                $parentlinks .= "</a>";
                            } else {
                                $parentlinks .= WT_I18N::translate('Private');
                            }
                            $parentlinks .= "<br>";
                        }
                    }
                }
            }
        }
        // Spouse Families -------------------------------------- @var $family Family
        foreach ($person->getSpouseFamilies() as $family) {
            $spouse = $family->getSpouse($person);
            $children = $family->getChildren();
            // Spouse ------------------------------
            if ($spouse && $spouse->canShowName()) {
                $spouselinks .= "<a href=\"#\" onclick=\"opener.insertRowToTable(";
                $spouselinks .= "'" . $spouse->getXref() . "',";
                // pid = PID
                $spouselinks .= "'" . strip_tags($spouse->getFullName()) . "',";
                // Full Name
                $spouselinks .= "'',";
                $spouselinks .= "'',";
                $spouselinks .= "'',";
                $spouselinks .= "'',";
                $spouselinks .= "'',";
                $spouselinks .= "'',";
                $spouselinks .= "'',";
                $spouselinks .= "''";
                $spouselinks .= ");\">";
                $spouselinks .= $spouse->getFullName();
                // Full Name
                $spouselinks .= "</a>";
            } else {
                $spouselinks .= WT_I18N::translate('Private');
            }
            $spouselinks .= "</a>";
            if ($spouse->getFullName() != "") {
                $persons = "Yes";
            }
            // Children ------------------------------   @var $child Person
            $spouselinks .= "<div id='spouseFam'>";
            $spouselinks .= "<ul class=\"clist\">";
            foreach ($children as $child) {
                $persons = "Yes";
                if ($child->canShowName()) {
                    $fulln = strip_tags($child->getFullName());
                    $spouselinks .= "<li>";
                    $spouselinks .= "<a href=\"#\" onclick=\"opener.insertRowToTable(";
                    $spouselinks .= "'" . $child->getXref() . "',";
                    // pid = PID
                    $spouselinks .= "'" . htmlentities($fulln) . "',";
                    // nam = Name
                    $spouselinks .= "'',";
                    $spouselinks .= "'',";
                    $spouselinks .= "'',";
                    $spouselinks .= "'',";
                    $spouselinks .= "'',";
                    $spouselinks .= "'',";
                    $spouselinks .= "'',";
                    $spouselinks .= "''";
                    $spouselinks .= ");\">";
                    $spouselinks .= $child->getFullName();
                    // Full Name
                    $spouselinks .= "</a>";
                } else {
                    $spouselinks .= WT_I18N::translate('Private');
                }
                $spouselinks .= "</li>";
            }
            $spouselinks .= "</ul>";
            $spouselinks .= "</div>";
        }
        if ($persons != "Yes") {
            $spouselinks .= "(" . WT_I18N::translate('none') . ")</td></tr></table>";
        } else {
            $spouselinks .= "</td></tr></table>";
        }
        if ($person_parent != "Yes") {
            $parentlinks .= "(" . WT_I18N::translate_c('unknown family', 'unknown') . ")</td></tr></table>";
        } else {
            $parentlinks .= "</td></tr></table>";
        }
        if ($person_step != "Yes") {
            $step_parentlinks .= "(" . WT_I18N::translate_c('unknown family', 'unknown') . ")</td></tr></table>";
        } else {
            $step_parentlinks .= "</td></tr></table>";
        }
    }
}
Exemplo n.º 2
0
 public static function getValue($type, $record = null)
 {
     if ($record instanceof WT_Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'birth':
             switch ($sex) {
                 case 'U':
                     return WT_I18N::translate_c('Pedigree', 'Birth');
                 case 'M':
                     return WT_I18N::translate_c('Male pedigree', 'Birth');
                 case 'F':
                     return WT_I18N::translate_c('Female pedigree', 'Birth');
             }
         case 'adopted':
             switch ($sex) {
                 case 'U':
                     return WT_I18N::translate_c('Pedigree', 'Adopted');
                 case 'M':
                     return WT_I18N::translate_c('Male pedigree', 'Adopted');
                 case 'F':
                     return WT_I18N::translate_c('Female pedigree', 'Adopted');
             }
         case 'foster':
             switch ($sex) {
                 case 'U':
                     return WT_I18N::translate_c('Pedigree', 'Foster');
                 case 'M':
                     return WT_I18N::translate_c('Male pedigree', 'Foster');
                 case 'F':
                     return WT_I18N::translate_c('Female pedigree', 'Foster');
             }
         case 'sealing':
             switch ($sex) {
                 case 'U':
                     return WT_I18N::translate_c('Pedigree', 'Sealing');
                 case 'M':
                     return WT_I18N::translate_c('Male pedigree', 'Sealing');
                 case 'F':
                     return WT_I18N::translate_c('Female pedigree', 'Sealing');
             }
         case 'rada':
             // Not standard GEDCOM - a webtrees extension
             // This is an arabic word which does not exist in other languages.
             // So, it will not have any inflected forms.
             return WT_I18N::translate('Rada');
         default:
             return $type;
     }
 }
Exemplo n.º 3
0
 public static function getValue($type, $record = null)
 {
     if ($record instanceof WT_Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'BOTH':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Adopted by both parents');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Adopted by both parents');
                 default:
                     return WT_I18N::translate('Adopted by both parents');
             }
         case 'HUSB':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Adopted by father');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Adopted by father');
                 default:
                     return WT_I18N::translate('Adopted by father');
             }
         case 'WIFE':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Adopted by mother');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Adopted by mother');
                 default:
                     return WT_I18N::translate('Adopted by mother');
             }
         default:
             return $type;
     }
 }
Exemplo n.º 4
0
 private static function getAbbreviation($tag)
 {
     switch ($tag) {
         case 'BIRT':
             return WT_I18N::translate_c('Abbreviation for birth', 'b.');
         case 'MARR':
             return WT_I18N::translate_c('Abbreviation for marriage', 'm.');
         case 'DEAT':
             return WT_I18N::translate_c('Abbreviation for death', 'd.');
         default:
             return mb_substr(WT_Gedcom_Tag::getLabel($tag), 0, 1);
             // Just use the first letter of the full fact
     }
 }
Exemplo n.º 5
0
function get_relationship_name_from_path($path, WT_Individual $person1 = null, WT_Individual $person2 = null)
{
    if (!preg_match('/^(mot|fat|par|hus|wif|spo|son|dau|chi|bro|sis|sib)*$/', $path)) {
        // TODO: Update all the “3 RELA ” values in class_person
        return '<span class="error">' . $path . '</span>';
    }
    // The path does not include the starting person.  In some languages, the
    // translation for a man’s (relative) is different to a woman’s (relative),
    // due to inflection.
    $sex1 = $person1 ? $person1->getSex() : 'U';
    // The sex of the last person in the relationship determines the name in
    // many cases.  e.g. great-aunt / great-uncle
    if (preg_match('/(fat|hus|son|bro)$/', $path)) {
        $sex2 = 'M';
    } elseif (preg_match('/(mot|wif|dau|sis)$/', $path)) {
        $sex2 = 'F';
    } else {
        $sex2 = 'U';
    }
    switch ($path) {
        case '':
            return WT_I18N::translate('self');
            //  Level One relationships
        //  Level One relationships
        case 'mot':
            return WT_I18N::translate('mother');
        case 'fat':
            return WT_I18N::translate('father');
        case 'par':
            return WT_I18N::translate('parent');
        case 'hus':
            if ($person1 && $person2) {
                foreach ($person1->getSpouseFamilies() as $family) {
                    if ($person2 === $family->getSpouse($person1)) {
                        if ($family->getFacts('_NMR')) {
                            return WT_I18N::translate_c('MALE', 'partner');
                        } elseif ($family->getFacts(WT_EVENTS_DIV)) {
                            return WT_I18N::translate('ex-husband');
                        }
                    }
                }
            }
            return WT_I18N::translate('husband');
        case 'wif':
            if ($person1 && $person1) {
                foreach ($person1->getSpouseFamilies() as $family) {
                    if ($person2 === $family->getSpouse($person1)) {
                        if ($family->getFacts('_NMR')) {
                            return WT_I18N::translate_c('FEMALE', 'partner');
                        } elseif ($family->getFacts(WT_EVENTS_DIV)) {
                            return WT_I18N::translate('ex-wife');
                        }
                    }
                }
            }
            return WT_I18N::translate('wife');
        case 'spo':
            if ($person1 && $person2) {
                foreach ($person1->getSpouseFamilies() as $family) {
                    if ($person2 === $family->getSpouse($person1)) {
                        if ($family->getFacts('_NMR')) {
                            return WT_I18N::translate_c('MALE/FEMALE', 'partner');
                        } elseif ($family->getFacts(WT_EVENTS_DIV)) {
                            return WT_I18N::translate('ex-spouse');
                        }
                    }
                }
            }
            return WT_I18N::translate('spouse');
        case 'son':
            return WT_I18N::translate('son');
        case 'dau':
            return WT_I18N::translate('daughter');
        case 'chi':
            return WT_I18N::translate('child');
        case 'bro':
            if ($person1 && $person2) {
                $dob1 = $person1->getBirthDate();
                $dob2 = $person2->getBirthDate();
                if ($dob1->isOK() && $dob2->isOK()) {
                    if (abs($dob1->JD() - $dob2->JD()) < 2 && !$dob1->qual1 && !$dob2->qual1) {
                        // Exclude BEF, AFT, etc.
                        return WT_I18N::translate('twin brother');
                    } elseif ($dob1->MaxJD() < $dob2->MinJD()) {
                        return WT_I18N::translate('younger brother');
                    } elseif ($dob1->MinJD() > $dob2->MaxJD()) {
                        return WT_I18N::translate('elder brother');
                    }
                }
            }
            return WT_I18N::translate('brother');
        case 'sis':
            if ($person1 && $person2) {
                $dob1 = $person1->getBirthDate();
                $dob2 = $person2->getBirthDate();
                if ($dob1->isOK() && $dob2->isOK()) {
                    if (abs($dob1->JD() - $dob2->JD()) < 2 && !$dob1->qual1 && !$dob2->qual1) {
                        // Exclude BEF, AFT, etc.
                        return WT_I18N::translate('twin sister');
                    } elseif ($dob1->MaxJD() < $dob2->MinJD()) {
                        return WT_I18N::translate('younger sister');
                    } elseif ($dob1->MinJD() > $dob2->MaxJD()) {
                        return WT_I18N::translate('elder sister');
                    }
                }
            }
            return WT_I18N::translate('sister');
        case 'sib':
            if ($person1 && $person2) {
                $dob1 = $person1->getBirthDate();
                $dob2 = $person2->getBirthDate();
                if ($dob1->isOK() && $dob2->isOK()) {
                    if (abs($dob1->JD() - $dob2->JD()) < 2 && !$dob1->qual1 && !$dob2->qual1) {
                        // Exclude BEF, AFT, etc.
                        return WT_I18N::translate('twin sibling');
                    } elseif ($dob1->MaxJD() < $dob2->MinJD()) {
                        return WT_I18N::translate('younger sibling');
                    } elseif ($dob1->MinJD() > $dob2->MaxJD()) {
                        return WT_I18N::translate('elder sibling');
                    }
                }
            }
            return WT_I18N::translate('sibling');
            // Level Two relationships
        // Level Two relationships
        case 'brochi':
            return WT_I18N::translate_c('brother’s child', 'nephew/niece');
        case 'brodau':
            return WT_I18N::translate_c('brother’s daughter', 'niece');
        case 'broson':
            return WT_I18N::translate_c('brother’s son', 'nephew');
        case 'browif':
            return WT_I18N::translate_c('brother’s wife', 'sister-in-law');
        case 'chichi':
            return WT_I18N::translate_c('child’s child', 'grandchild');
        case 'chidau':
            return WT_I18N::translate_c('child’s daughter', 'granddaughter');
        case 'chihus':
            return WT_I18N::translate_c('child’s husband', 'son-in-law');
        case 'chison':
            return WT_I18N::translate_c('child’s son', 'grandson');
        case 'chispo':
            return WT_I18N::translate_c('child’s spouse', 'son/daughter-in-law');
        case 'chiwif':
            return WT_I18N::translate_c('child’s wife', 'daughter-in-law');
        case 'dauchi':
            return WT_I18N::translate_c('daughter’s child', 'grandchild');
        case 'daudau':
            return WT_I18N::translate_c('daughter’s daughter', 'granddaughter');
        case 'dauhus':
            return WT_I18N::translate_c('daughter’s husband', 'son-in-law');
        case 'dauson':
            return WT_I18N::translate_c('daughter’s son', 'grandson');
        case 'fatbro':
            return WT_I18N::translate_c('father’s brother', 'uncle');
        case 'fatchi':
            return WT_I18N::translate_c('father’s child', 'half-sibling');
        case 'fatdau':
            return WT_I18N::translate_c('father’s daughter', 'half-sister');
        case 'fatfat':
            return WT_I18N::translate_c('father’s father', 'paternal grandfather');
        case 'fatmot':
            return WT_I18N::translate_c('father’s mother', 'paternal grandmother');
        case 'fatpar':
            return WT_I18N::translate_c('father’s parent', 'paternal grandparent');
        case 'fatsib':
            return WT_I18N::translate_c('father’s sibling', 'aunt/uncle');
        case 'fatsis':
            return WT_I18N::translate_c('father’s sister', 'aunt');
        case 'fatson':
            return WT_I18N::translate_c('father’s son', 'half-brother');
        case 'fatwif':
            return WT_I18N::translate_c('father’s wife', 'step-mother');
        case 'husbro':
            return WT_I18N::translate_c('husband’s brother', 'brother-in-law');
        case 'huschi':
            return WT_I18N::translate_c('husband’s child', 'step-child');
        case 'husdau':
            return WT_I18N::translate_c('husband’s daughter', 'step-daughter');
        case 'husfat':
            return WT_I18N::translate_c('husband’s father', 'father-in-law');
        case 'husmot':
            return WT_I18N::translate_c('husband’s mother', 'mother-in-law');
        case 'hussib':
            return WT_I18N::translate_c('husband’s sibling', 'brother/sister-in-law');
        case 'hussis':
            return WT_I18N::translate_c('husband’s sister', 'sister-in-law');
        case 'husson':
            return WT_I18N::translate_c('husband’s son', 'step-son');
        case 'motbro':
            return WT_I18N::translate_c('mother’s brother', 'uncle');
        case 'motchi':
            return WT_I18N::translate_c('mother’s child', 'half-sibling');
        case 'motdau':
            return WT_I18N::translate_c('mother’s daughter', 'half-sister');
        case 'motfat':
            return WT_I18N::translate_c('mother’s father', 'maternal grandfather');
        case 'mothus':
            return WT_I18N::translate_c('mother’s husband', 'step-father');
        case 'motmot':
            return WT_I18N::translate_c('mother’s mother', 'maternal grandmother');
        case 'motpar':
            return WT_I18N::translate_c('mother’s parent', 'maternal grandparent');
        case 'motsib':
            return WT_I18N::translate_c('mother’s sibling', 'aunt/uncle');
        case 'motsis':
            return WT_I18N::translate_c('mother’s sister', 'aunt');
        case 'motson':
            return WT_I18N::translate_c('mother’s son', 'half-brother');
        case 'parbro':
            return WT_I18N::translate_c('parent’s brother', 'uncle');
        case 'parchi':
            return WT_I18N::translate_c('parent’s child', 'half-sibling');
        case 'pardau':
            return WT_I18N::translate_c('parent’s daughter', 'half-sister');
        case 'parfat':
            return WT_I18N::translate_c('parent’s father', 'grandfather');
        case 'parmot':
            return WT_I18N::translate_c('parent’s mother', 'grandmother');
        case 'parpar':
            return WT_I18N::translate_c('parent’s parent', 'grandparent');
        case 'parsib':
            return WT_I18N::translate_c('parent’s sibling', 'aunt/uncle');
        case 'parsis':
            return WT_I18N::translate_c('parent’s sister', 'aunt');
        case 'parson':
            return WT_I18N::translate_c('parent’s son', 'half-brother');
        case 'parspo':
            return WT_I18N::translate_c('parent’s spouse', 'step-parent');
        case 'sibchi':
            return WT_I18N::translate_c('sibling’s child', 'nephew/niece');
        case 'sibdau':
            return WT_I18N::translate_c('sibling’s daughter', 'niece');
        case 'sibson':
            return WT_I18N::translate_c('sibling’s son', 'nephew');
        case 'sibspo':
            return WT_I18N::translate_c('sibling’s spouse', 'brother/sister-in-law');
        case 'sischi':
            return WT_I18N::translate_c('sister’s child', 'nephew/niece');
        case 'sisdau':
            return WT_I18N::translate_c('sister’s daughter', 'niece');
        case 'sishus':
            return WT_I18N::translate_c('sister’s husband', 'brother-in-law');
        case 'sisson':
            return WT_I18N::translate_c('sister’s son', 'nephew');
        case 'sonchi':
            return WT_I18N::translate_c('son’s child', 'grandchild');
        case 'sondau':
            return WT_I18N::translate_c('son’s daughter', 'granddaughter');
        case 'sonson':
            return WT_I18N::translate_c('son’s son', 'grandson');
        case 'sonwif':
            return WT_I18N::translate_c('son’s wife', 'daughter-in-law');
        case 'spobro':
            return WT_I18N::translate_c('spouse’s brother', 'brother-in-law');
        case 'spochi':
            return WT_I18N::translate_c('spouse’s child', 'step-child');
        case 'spodau':
            return WT_I18N::translate_c('spouse’s daughter', 'step-daughter');
        case 'spofat':
            return WT_I18N::translate_c('spouse’s father', 'father-in-law');
        case 'spomot':
            return WT_I18N::translate_c('spouse’s mother', 'mother-in-law');
        case 'sposis':
            return WT_I18N::translate_c('spouse’s sister', 'sister-in-law');
        case 'sposon':
            return WT_I18N::translate_c('spouse’s son', 'step-son');
        case 'spopar':
            return WT_I18N::translate_c('spouse’s parent', 'mother/father-in-law');
        case 'sposib':
            return WT_I18N::translate_c('spouse’s sibling', 'brother/sister-in-law');
        case 'wifbro':
            return WT_I18N::translate_c('wife’s brother', 'brother-in-law');
        case 'wifchi':
            return WT_I18N::translate_c('wife’s child', 'step-child');
        case 'wifdau':
            return WT_I18N::translate_c('wife’s daughter', 'step-daughter');
        case 'wiffat':
            return WT_I18N::translate_c('wife’s father', 'father-in-law');
        case 'wifmot':
            return WT_I18N::translate_c('wife’s mother', 'mother-in-law');
        case 'wifsib':
            return WT_I18N::translate_c('wife’s sibling', 'brother/sister-in-law');
        case 'wifsis':
            return WT_I18N::translate_c('wife’s sister', 'sister-in-law');
        case 'wifson':
            return WT_I18N::translate_c('wife’s son', 'step-son');
            // Level Three relationships
            // I have commented out some of the unknown-sex relationships that are unlikely to to occur.
            // Feel free to add them in, if you think they might be needed
        // Level Three relationships
        // I have commented out some of the unknown-sex relationships that are unlikely to to occur.
        // Feel free to add them in, if you think they might be needed
        case 'brochichi':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) brother’s child’s child', 'great-nephew/niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) brother’s child’s child', 'great-nephew/niece');
            }
        case 'brochidau':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) brother’s child’s daughter', 'great-niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) brother’s child’s daughter', 'great-niece');
            }
        case 'brochison':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) brother’s child’s son', 'great-nephew');
            } else {
                return WT_I18N::translate_c('(a woman’s) brother’s child’s son', 'great-nephew');
            }
        case 'brodauchi':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) brother’s daughter’s child', 'great-nephew/niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) brother’s daughter’s child', 'great-nephew/niece');
            }
        case 'brodaudau':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) brother’s daughter’s daughter', 'great-niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) brother’s daughter’s daughter', 'great-niece');
            }
        case 'brodauhus':
            return WT_I18N::translate_c('brother’s daughter’s husband', 'nephew-in-law');
        case 'brodauson':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) brother’s daughter’s son', 'great-nephew');
            } else {
                return WT_I18N::translate_c('(a woman’s) brother’s daughter’s son', 'great-nephew');
            }
        case 'brosonchi':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) brother’s son’s child', 'great-nephew/niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) brother’s son’s child', 'great-nephew/niece');
            }
        case 'brosondau':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) brother’s son’s daughter', 'great-niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) brother’s son’s daughter', 'great-niece');
            }
        case 'brosonson':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) brother’s son’s son', 'great-nephew');
            } else {
                return WT_I18N::translate_c('(a woman’s) brother’s son’s son', 'great-nephew');
            }
        case 'brosonwif':
            return WT_I18N::translate_c('brother’s son’s wife', 'niece-in-law');
        case 'browifbro':
            return WT_I18N::translate_c('brother’s wife’s brother', 'brother-in-law');
        case 'browifsib':
            return WT_I18N::translate_c('brother’s wife’s sibling', 'brother/sister-in-law');
        case 'browifsis':
            return WT_I18N::translate_c('brother’s wife’s sister', 'sister-in-law');
        case 'chichichi':
            return WT_I18N::translate_c('child’s child’s child', 'great-grandchild');
        case 'chichidau':
            return WT_I18N::translate_c('child’s child’s daughter', 'great-granddaughter');
        case 'chichison':
            return WT_I18N::translate_c('child’s child’s son', 'great-grandson');
        case 'chidauchi':
            return WT_I18N::translate_c('child’s daughter’s child', 'great-grandchild');
        case 'chidaudau':
            return WT_I18N::translate_c('child’s daughter’s daughter', 'great-granddaughter');
        case 'chidauhus':
            return WT_I18N::translate_c('child’s daughter’s husband', 'granddaughter’s husband');
        case 'chidauson':
            return WT_I18N::translate_c('child’s daughter’s son', 'great-grandson');
        case 'chisonchi':
            return WT_I18N::translate_c('child’s son’s child', 'great-grandchild');
        case 'chisondau':
            return WT_I18N::translate_c('child’s son’s daughter', 'great-granddaughter');
        case 'chisonson':
            return WT_I18N::translate_c('child’s son’s son', 'great-grandson');
        case 'chisonwif':
            return WT_I18N::translate_c('child’s son’s wife', 'grandson’s wife');
        case 'dauchichi':
            return WT_I18N::translate_c('daughter’s child’s child', 'great-grandchild');
        case 'dauchidau':
            return WT_I18N::translate_c('daughter’s child’s daughter', 'great-granddaughter');
        case 'dauchison':
            return WT_I18N::translate_c('daughter’s child’s son', 'great-grandson');
        case 'daudauchi':
            return WT_I18N::translate_c('daughter’s daughter’s child', 'great-grandchild');
        case 'daudaudau':
            return WT_I18N::translate_c('daughter’s daughter’s daughter', 'great-granddaughter');
        case 'daudauhus':
            return WT_I18N::translate_c('daughter’s daughter’s husband', 'granddaughter’s husband');
        case 'daudauson':
            return WT_I18N::translate_c('daughter’s daughter’s son', 'great-grandson');
        case 'dauhusfat':
            return WT_I18N::translate_c('daughter’s husband’s father', 'son-in-law’s father');
        case 'dauhusmot':
            return WT_I18N::translate_c('daughter’s husband’s mother', 'son-in-law’s mother');
        case 'dauhuspar':
            return WT_I18N::translate_c('daughter’s husband’s parent', 'son-in-law’s parent');
        case 'dausonchi':
            return WT_I18N::translate_c('daughter’s son’s child', 'great-grandchild');
        case 'dausondau':
            return WT_I18N::translate_c('daughter’s son’s daughter', 'great-granddaughter');
        case 'dausonson':
            return WT_I18N::translate_c('daughter’s son’s son', 'great-grandson');
        case 'dausonwif':
            return WT_I18N::translate_c('daughter’s son’s wife', 'grandson’s wife');
        case 'fatbrochi':
            return WT_I18N::translate_c('father’s brother’s child', 'first cousin');
        case 'fatbrodau':
            return WT_I18N::translate_c('father’s brother’s daughter', 'first cousin');
        case 'fatbroson':
            return WT_I18N::translate_c('father’s brother’s son', 'first cousin');
        case 'fatbrowif':
            return WT_I18N::translate_c('father’s brother’s wife', 'aunt');
        case 'fatfatbro':
            return WT_I18N::translate_c('father’s father’s brother', 'great-uncle');
        case 'fatfatfat':
            return WT_I18N::translate_c('father’s father’s father', 'great-grandfather');
        case 'fatfatmot':
            return WT_I18N::translate_c('father’s father’s mother', 'great-grandmother');
        case 'fatfatpar':
            return WT_I18N::translate_c('father’s father’s parent', 'great-grandparent');
        case 'fatfatsib':
            return WT_I18N::translate_c('father’s father’s sibling', 'great-aunt/uncle');
        case 'fatfatsis':
            return WT_I18N::translate_c('father’s father’s sister', 'great-aunt');
        case 'fatmotbro':
            return WT_I18N::translate_c('father’s mother’s brother', 'great-uncle');
        case 'fatmotfat':
            return WT_I18N::translate_c('father’s mother’s father', 'great-grandfather');
        case 'fatmotmot':
            return WT_I18N::translate_c('father’s mother’s mother', 'great-grandmother');
        case 'fatmotpar':
            return WT_I18N::translate_c('father’s mother’s parent', 'great-grandparent');
        case 'fatmotsib':
            return WT_I18N::translate_c('father’s mother’s sibling', 'great-aunt/uncle');
        case 'fatmotsis':
            return WT_I18N::translate_c('father’s mother’s sister', 'great-aunt');
        case 'fatparbro':
            return WT_I18N::translate_c('father’s parent’s brother', 'great-uncle');
        case 'fatparfat':
            return WT_I18N::translate_c('father’s parent’s father', 'great-grandfather');
        case 'fatparmot':
            return WT_I18N::translate_c('father’s parent’s mother', 'great-grandmother');
        case 'fatparpar':
            return WT_I18N::translate_c('father’s parent’s parent', 'great-grandparent');
        case 'fatparsib':
            return WT_I18N::translate_c('father’s parent’s sibling', 'great-aunt/uncle');
        case 'fatparsis':
            return WT_I18N::translate_c('father’s parent’s sister', 'great-aunt');
        case 'fatsischi':
            return WT_I18N::translate_c('father’s sister’s child', 'first cousin');
        case 'fatsisdau':
            return WT_I18N::translate_c('father’s sister’s daughter', 'first cousin');
        case 'fatsishus':
            return WT_I18N::translate_c('father’s sister’s husband', 'uncle');
        case 'fatsisson':
            return WT_I18N::translate_c('father’s sister’s son', 'first cousin');
        case 'fatwifchi':
            return WT_I18N::translate_c('father’s wife’s child', 'step-sibling');
        case 'fatwifdau':
            return WT_I18N::translate_c('father’s wife’s daughter', 'step-sister');
        case 'fatwifson':
            return WT_I18N::translate_c('father’s wife’s son', 'step-brother');
        case 'husbrowif':
            return WT_I18N::translate_c('husband’s brother’s wife', 'sister-in-law');
        case 'hussishus':
            return WT_I18N::translate_c('husband’s sister’s husband', 'brother-in-law');
        case 'motbrochi':
            return WT_I18N::translate_c('mother’s brother’s child', 'first cousin');
        case 'motbrodau':
            return WT_I18N::translate_c('mother’s brother’s daughter', 'first cousin');
        case 'motbroson':
            return WT_I18N::translate_c('mother’s brother’s son', 'first cousin');
        case 'motbrowif':
            return WT_I18N::translate_c('mother’s brother’s wife', 'aunt');
        case 'motfatbro':
            return WT_I18N::translate_c('mother’s father’s brother', 'great-uncle');
        case 'motfatfat':
            return WT_I18N::translate_c('mother’s father’s father', 'great-grandfather');
        case 'motfatmot':
            return WT_I18N::translate_c('mother’s father’s mother', 'great-grandmother');
        case 'motfatpar':
            return WT_I18N::translate_c('mother’s father’s parent', 'great-grandparent');
        case 'motfatsib':
            return WT_I18N::translate_c('mother’s father’s sibling', 'great-aunt/uncle');
        case 'motfatsis':
            return WT_I18N::translate_c('mother’s father’s sister', 'great-aunt');
        case 'mothuschi':
            return WT_I18N::translate_c('mother’s husband’s child', 'step-sibling');
        case 'mothusdau':
            return WT_I18N::translate_c('mother’s husband’s daughter', 'step-sister');
        case 'mothusson':
            return WT_I18N::translate_c('mother’s husband’s son', 'step-brother');
        case 'motmotbro':
            return WT_I18N::translate_c('mother’s mother’s brother', 'great-uncle');
        case 'motmotfat':
            return WT_I18N::translate_c('mother’s mother’s father', 'great-grandfather');
        case 'motmotmot':
            return WT_I18N::translate_c('mother’s mother’s mother', 'great-grandmother');
        case 'motmotpar':
            return WT_I18N::translate_c('mother’s mother’s parent', 'great-grandparent');
        case 'motmotsib':
            return WT_I18N::translate_c('mother’s mother’s sibling', 'great-aunt/uncle');
        case 'motmotsis':
            return WT_I18N::translate_c('mother’s mother’s sister', 'great-aunt');
        case 'motparbro':
            return WT_I18N::translate_c('mother’s parent’s brother', 'great-uncle');
        case 'motparfat':
            return WT_I18N::translate_c('mother’s parent’s father', 'great-grandfather');
        case 'motparmot':
            return WT_I18N::translate_c('mother’s parent’s mother', 'great-grandmother');
        case 'motparpar':
            return WT_I18N::translate_c('mother’s parent’s parent', 'great-grandparent');
        case 'motparsib':
            return WT_I18N::translate_c('mother’s parent’s sibling', 'great-aunt/uncle');
        case 'motparsis':
            return WT_I18N::translate_c('mother’s parent’s sister', 'great-aunt');
        case 'motsischi':
            return WT_I18N::translate_c('mother’s sister’s child', 'first cousin');
        case 'motsisdau':
            return WT_I18N::translate_c('mother’s sister’s daughter', 'first cousin');
        case 'motsishus':
            return WT_I18N::translate_c('mother’s sister’s husband', 'uncle');
        case 'motsisson':
            return WT_I18N::translate_c('mother’s sister’s son', 'first cousin');
        case 'parbrowif':
            return WT_I18N::translate_c('parent’s brother’s wife', 'aunt');
        case 'parfatbro':
            return WT_I18N::translate_c('parent’s father’s brother', 'great-uncle');
        case 'parfatfat':
            return WT_I18N::translate_c('parent’s father’s father', 'great-grandfather');
        case 'parfatmot':
            return WT_I18N::translate_c('parent’s father’s mother', 'great-grandmother');
        case 'parfatpar':
            return WT_I18N::translate_c('parent’s father’s parent', 'great-grandparent');
        case 'parfatsib':
            return WT_I18N::translate_c('parent’s father’s sibling', 'great-aunt/uncle');
        case 'parfatsis':
            return WT_I18N::translate_c('parent’s father’s sister', 'great-aunt');
        case 'parmotbro':
            return WT_I18N::translate_c('parent’s mother’s brother', 'great-uncle');
        case 'parmotfat':
            return WT_I18N::translate_c('parent’s mother’s father', 'great-grandfather');
        case 'parmotmot':
            return WT_I18N::translate_c('parent’s mother’s mother', 'great-grandmother');
        case 'parmotpar':
            return WT_I18N::translate_c('parent’s mother’s parent', 'great-grandparent');
        case 'parmotsib':
            return WT_I18N::translate_c('parent’s mother’s sibling', 'great-aunt/uncle');
        case 'parmotsis':
            return WT_I18N::translate_c('parent’s mother’s sister', 'great-aunt');
        case 'parparbro':
            return WT_I18N::translate_c('parent’s parent’s brother', 'great-uncle');
        case 'parparfat':
            return WT_I18N::translate_c('parent’s parent’s father', 'great-grandfather');
        case 'parparmot':
            return WT_I18N::translate_c('parent’s parent’s mother', 'great-grandmother');
        case 'parparpar':
            return WT_I18N::translate_c('parent’s parent’s parent', 'great-grandparent');
        case 'parparsib':
            return WT_I18N::translate_c('parent’s parent’s sibling', 'great-aunt/uncle');
        case 'parparsis':
            return WT_I18N::translate_c('parent’s parent’s sister', 'great-aunt');
        case 'parsishus':
            return WT_I18N::translate_c('parent’s sister’s husband', 'uncle');
        case 'parspochi':
            return WT_I18N::translate_c('parent’s spouse’s child', 'step-sibling');
        case 'parspodau':
            return WT_I18N::translate_c('parent’s spouse’s daughter', 'step-sister');
        case 'parsposon':
            return WT_I18N::translate_c('parent’s spouse’s son', 'step-brother');
        case 'sibchichi':
            return WT_I18N::translate_c('sibling’s child’s child', 'great-nephew/niece');
        case 'sibchidau':
            return WT_I18N::translate_c('sibling’s child’s daughter', 'great-niece');
        case 'sibchison':
            return WT_I18N::translate_c('sibling’s child’s son', 'great-nephew');
        case 'sibdauchi':
            return WT_I18N::translate_c('sibling’s daughter’s child', 'great-nephew/niece');
        case 'sibdaudau':
            return WT_I18N::translate_c('sibling’s daughter’s daughter', 'great-niece');
        case 'sibdauhus':
            return WT_I18N::translate_c('sibling’s daughter’s husband', 'nephew-in-law');
        case 'sibdauson':
            return WT_I18N::translate_c('sibling’s daughter’s son', 'great-nephew');
        case 'sibsonchi':
            return WT_I18N::translate_c('sibling’s son’s child', 'great-nephew/niece');
        case 'sibsondau':
            return WT_I18N::translate_c('sibling’s son’s daughter', 'great-niece');
        case 'sibsonson':
            return WT_I18N::translate_c('sibling’s son’s son', 'great-nephew');
        case 'sibsonwif':
            return WT_I18N::translate_c('sibling’s son’s wife', 'niece-in-law');
        case 'sischichi':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) sister’s child’s child', 'great-nephew/niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) sister’s child’s child', 'great-nephew/niece');
            }
        case 'sischidau':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) sister’s child’s daughter', 'great-niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) sister’s child’s daughter', 'great-niece');
            }
        case 'sischison':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) sister’s child’s son', 'great-nephew');
            } else {
                return WT_I18N::translate_c('(a woman’s) sister’s child’s son', 'great-nephew');
            }
        case 'sisdauchi':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) sister’s daughter’s child', 'great-nephew/niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) sister’s daughter’s child', 'great-nephew/niece');
            }
        case 'sisdaudau':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) sister’s daughter’s daughter', 'great-niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) sister’s daughter’s daughter', 'great-niece');
            }
        case 'sisdauhus':
            return WT_I18N::translate_c('sisters’s daughter’s husband', 'nephew-in-law');
        case 'sisdauson':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) sister’s daughter’s son', 'great-nephew');
            } else {
                return WT_I18N::translate_c('(a woman’s) sister’s daughter’s son', 'great-nephew');
            }
        case 'sishusbro':
            return WT_I18N::translate_c('sister’s husband’s brother', 'brother-in-law');
        case 'sishussib':
            return WT_I18N::translate_c('sister’s husband’s sibling', 'brother/sister-in-law');
        case 'sishussis':
            return WT_I18N::translate_c('sister’s husband’s sister', 'sister-in-law');
        case 'sissonchi':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) sister’s son’s child', 'great-nephew/niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) sister’s son’s child', 'great-nephew/niece');
            }
        case 'sissondau':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) sister’s son’s daughter', 'great-niece');
            } else {
                return WT_I18N::translate_c('(a woman’s) sister’s son’s daughter', 'great-niece');
            }
        case 'sissonson':
            if ($sex1 == 'M') {
                return WT_I18N::translate_c('(a man’s) sister’s son’s son', 'great-nephew');
            } else {
                return WT_I18N::translate_c('(a woman’s) sister’s son’s son', 'great-nephew');
            }
        case 'sissonwif':
            return WT_I18N::translate_c('sisters’s son’s wife', 'niece-in-law');
        case 'sonchichi':
            return WT_I18N::translate_c('son’s child’s child', 'great-grandchild');
        case 'sonchidau':
            return WT_I18N::translate_c('son’s child’s daughter', 'great-granddaughter');
        case 'sonchison':
            return WT_I18N::translate_c('son’s child’s son', 'great-grandson');
        case 'sondauchi':
            return WT_I18N::translate_c('son’s daughter’s child', 'great-grandchild');
        case 'sondaudau':
            return WT_I18N::translate_c('son’s daughter’s daughter', 'great-granddaughter');
        case 'sondauhus':
            return WT_I18N::translate_c('son’s daughter’s husband', 'granddaughter’s husband');
        case 'sondauson':
            return WT_I18N::translate_c('son’s daughter’s son', 'great-grandson');
        case 'sonsonchi':
            return WT_I18N::translate_c('son’s son’s child', 'great-grandchild');
        case 'sonsondau':
            return WT_I18N::translate_c('son’s son’s daughter', 'great-granddaughter');
        case 'sonsonson':
            return WT_I18N::translate_c('son’s son’s son', 'great-grandson');
        case 'sonsonwif':
            return WT_I18N::translate_c('son’s son’s wife', 'grandson’s wife');
        case 'sonwiffat':
            return WT_I18N::translate_c('son’s wife’s father', 'daughter-in-law’s father');
        case 'sonwifmot':
            return WT_I18N::translate_c('son’s wife’s mother', 'daughter-in-law’s mother');
        case 'sonwifpar':
            return WT_I18N::translate_c('son’s wife’s parent', 'daughter-in-law’s parent');
        case 'wifbrowif':
            return WT_I18N::translate_c('wife’s brother’s wife', 'sister-in-law');
        case 'wifsishus':
            return WT_I18N::translate_c('wife’s sister’s husband', 'brother-in-law');
            // Some “special case” level four relationships that have specific names in certain languages
        // Some “special case” level four relationships that have specific names in certain languages
        case 'fatfatbrowif':
            return WT_I18N::translate_c('father’s father’s brother’s wife', 'great-aunt');
        case 'fatfatsibspo':
            return WT_I18N::translate_c('father’s father’s sibling’s spouse', 'great-aunt/uncle');
        case 'fatfatsishus':
            return WT_I18N::translate_c('father’s father’s sister’s husband', 'great-uncle');
        case 'fatmotbrowif':
            return WT_I18N::translate_c('father’s mother’s brother’s wife', 'great-aunt');
        case 'fatmotsibspo':
            return WT_I18N::translate_c('father’s mother’s sibling’s spouse', 'great-aunt/uncle');
        case 'fatmotsishus':
            return WT_I18N::translate_c('father’s mother’s sister’s husband', 'great-uncle');
        case 'fatparbrowif':
            return WT_I18N::translate_c('father’s parent’s brother’s wife', 'great-aunt');
        case 'fatparsibspo':
            return WT_I18N::translate_c('father’s parent’s sibling’s spouse', 'great-aunt/uncle');
        case 'fatparsishus':
            return WT_I18N::translate_c('father’s parent’s sister’s husband', 'great-uncle');
        case 'motfatbrowif':
            return WT_I18N::translate_c('mother’s father’s brother’s wife', 'great-aunt');
        case 'motfatsibspo':
            return WT_I18N::translate_c('mother’s father’s sibling’s spouse', 'great-aunt/uncle');
        case 'motfatsishus':
            return WT_I18N::translate_c('mother’s father’s sister’s husband', 'great-uncle');
        case 'motmotbrowif':
            return WT_I18N::translate_c('mother’s mother’s brother’s wife', 'great-aunt');
        case 'motmotsibspo':
            return WT_I18N::translate_c('mother’s mother’s sibling’s spouse', 'great-aunt/uncle');
        case 'motmotsishus':
            return WT_I18N::translate_c('mother’s mother’s sister’s husband', 'great-uncle');
        case 'motparbrowif':
            return WT_I18N::translate_c('mother’s parent’s brother’s wife', 'great-aunt');
        case 'motparsibspo':
            return WT_I18N::translate_c('mother’s parent’s sibling’s spouse', 'great-aunt/uncle');
        case 'motparsishus':
            return WT_I18N::translate_c('mother’s parent’s sister’s husband', 'great-uncle');
        case 'parfatbrowif':
            return WT_I18N::translate_c('parent’s father’s brother’s wife', 'great-aunt');
        case 'parfatsibspo':
            return WT_I18N::translate_c('parent’s father’s sibling’s spouse', 'great-aunt/uncle');
        case 'parfatsishus':
            return WT_I18N::translate_c('parent’s father’s sister’s husband', 'great-uncle');
        case 'parmotbrowif':
            return WT_I18N::translate_c('parent’s mother’s brother’s wife', 'great-aunt');
        case 'parmotsibspo':
            return WT_I18N::translate_c('parent’s mother’s sibling’s spouse', 'great-aunt/uncle');
        case 'parmotsishus':
            return WT_I18N::translate_c('parent’s mother’s sister’s husband', 'great-uncle');
        case 'parparbrowif':
            return WT_I18N::translate_c('parent’s parent’s brother’s wife', 'great-aunt');
        case 'parparsibspo':
            return WT_I18N::translate_c('parent’s parent’s sibling’s spouse', 'great-aunt/uncle');
        case 'parparsishus':
            return WT_I18N::translate_c('parent’s parent’s sister’s husband', 'great-uncle');
        case 'fatfatbrodau':
            return WT_I18N::translate_c('father’s father’s brother’s daughter', 'first cousin once removed ascending');
        case 'fatfatbroson':
            return WT_I18N::translate_c('father’s father’s brother’s son', 'first cousin once removed ascending');
        case 'fatfatbrochi':
            return WT_I18N::translate_c('father’s father’s brother’s child', 'first cousin once removed ascending');
        case 'fatfatsisdau':
            return WT_I18N::translate_c('father’s father’s sister’s daughter', 'first cousin once removed ascending');
        case 'fatfatsisson':
            return WT_I18N::translate_c('father’s father’s sister’s son', 'first cousin once removed ascending');
        case 'fatfatsischi':
            return WT_I18N::translate_c('father’s father’s sister’s child', 'first cousin once removed ascending');
        case 'fatmotbrodau':
            return WT_I18N::translate_c('father’s mother’s brother’s daughter', 'first cousin once removed ascending');
        case 'fatmotbroson':
            return WT_I18N::translate_c('father’s mother’s brother’s son', 'first cousin once removed ascending');
        case 'fatmotbrochi':
            return WT_I18N::translate_c('father’s mother’s brother’s child', 'first cousin once removed ascending');
        case 'fatmotsisdau':
            return WT_I18N::translate_c('father’s mother’s sister’s daughter', 'first cousin once removed ascending');
        case 'fatmotsisson':
            return WT_I18N::translate_c('father’s mother’s sister’s son', 'first cousin once removed ascending');
        case 'fatmotsischi':
            return WT_I18N::translate_c('father’s mother’s sister’s child', 'first cousin once removed ascending');
        case 'motfatbrodau':
            return WT_I18N::translate_c('mother’s father’s brother’s daughter', 'first cousin once removed ascending');
        case 'motfatbroson':
            return WT_I18N::translate_c('mother’s father’s brother’s son', 'first cousin once removed ascending');
        case 'motfatbrochi':
            return WT_I18N::translate_c('mother’s father’s brother’s child', 'first cousin once removed ascending');
        case 'motfatsisdau':
            return WT_I18N::translate_c('mother’s father’s sister’s daughter', 'first cousin once removed ascending');
        case 'motfatsisson':
            return WT_I18N::translate_c('mother’s father’s sister’s son', 'first cousin once removed ascending');
        case 'motfatsischi':
            return WT_I18N::translate_c('mother’s father’s sister’s child', 'first cousin once removed ascending');
        case 'motmotbrodau':
            return WT_I18N::translate_c('mother’s mother’s brother’s daughter', 'first cousin once removed ascending');
        case 'motmotbroson':
            return WT_I18N::translate_c('mother’s mother’s brother’s son', 'first cousin once removed ascending');
        case 'motmotbrochi':
            return WT_I18N::translate_c('mother’s mother’s brother’s child', 'first cousin once removed ascending');
        case 'motmotsisdau':
            return WT_I18N::translate_c('mother’s mother’s sister’s daughter', 'first cousin once removed ascending');
        case 'motmotsisson':
            return WT_I18N::translate_c('mother’s mother’s sister’s son', 'first cousin once removed ascending');
        case 'motmotsischi':
            return WT_I18N::translate_c('mother’s mother’s sister’s child', 'first cousin once removed ascending');
    }
    // Some “special case” level five relationships that have specific names in certain languages
    if (preg_match('/^(mot|fat|par)fatbro(son|dau|chi)dau$/', $path)) {
        return WT_I18N::translate_c('grandfather’s brother’s granddaughter', 'second cousin');
    } else {
        if (preg_match('/^(mot|fat|par)fatbro(son|dau|chi)son$/', $path)) {
            return WT_I18N::translate_c('grandfather’s brother’s grandson', 'second cousin');
        } else {
            if (preg_match('/^(mot|fat|par)fatbro(son|dau|chi)chi$/', $path)) {
                return WT_I18N::translate_c('grandfather’s brother’s grandchild', 'second cousin');
            } else {
                if (preg_match('/^(mot|fat|par)fatsis(son|dau|chi)dau$/', $path)) {
                    return WT_I18N::translate_c('grandfather’s sister’s granddaughter', 'second cousin');
                } else {
                    if (preg_match('/^(mot|fat|par)fatsis(son|dau|chi)son$/', $path)) {
                        return WT_I18N::translate_c('grandfather’s sister’s grandson', 'second cousin');
                    } else {
                        if (preg_match('/^(mot|fat|par)fatsis(son|dau|chi)chi$/', $path)) {
                            return WT_I18N::translate_c('grandfather’s sister’s grandchild', 'second cousin');
                        } else {
                            if (preg_match('/^(mot|fat|par)fatsib(son|dau|chi)dau$/', $path)) {
                                return WT_I18N::translate_c('grandfather’s sibling’s granddaughter', 'second cousin');
                            } else {
                                if (preg_match('/^(mot|fat|par)fatsib(son|dau|chi)son$/', $path)) {
                                    return WT_I18N::translate_c('grandfather’s sibling’s grandson', 'second cousin');
                                } else {
                                    if (preg_match('/^(mot|fat|par)fatsib(son|dau|chi)chi$/', $path)) {
                                        return WT_I18N::translate_c('grandfather’s sibling’s grandchild', 'second cousin');
                                    } else {
                                        if (preg_match('/^(mot|fat|par)motbro(son|dau|chi)dau$/', $path)) {
                                            return WT_I18N::translate_c('grandmother’s brother’s granddaughter', 'second cousin');
                                        } else {
                                            if (preg_match('/^(mot|fat|par)motbro(son|dau|chi)son$/', $path)) {
                                                return WT_I18N::translate_c('grandmother’s brother’s grandson', 'second cousin');
                                            } else {
                                                if (preg_match('/^(mot|fat|par)motbro(son|dau|chi)chi$/', $path)) {
                                                    return WT_I18N::translate_c('grandmother’s brother’s grandchild', 'second cousin');
                                                } else {
                                                    if (preg_match('/^(mot|fat|par)motsis(son|dau|chi)dau$/', $path)) {
                                                        return WT_I18N::translate_c('grandmother’s sister’s granddaughter', 'second cousin');
                                                    } else {
                                                        if (preg_match('/^(mot|fat|par)motsis(son|dau|chi)son$/', $path)) {
                                                            return WT_I18N::translate_c('grandmother’s sister’s grandson', 'second cousin');
                                                        } else {
                                                            if (preg_match('/^(mot|fat|par)motsis(son|dau|chi)chi$/', $path)) {
                                                                return WT_I18N::translate_c('grandmother’s sister’s grandchild', 'second cousin');
                                                            } else {
                                                                if (preg_match('/^(mot|fat|par)motsib(son|dau|chi)dau$/', $path)) {
                                                                    return WT_I18N::translate_c('grandmother’s sibling’s granddaughter', 'second cousin');
                                                                } else {
                                                                    if (preg_match('/^(mot|fat|par)motsib(son|dau|chi)son$/', $path)) {
                                                                        return WT_I18N::translate_c('grandmother’s sibling’s grandson', 'second cousin');
                                                                    } else {
                                                                        if (preg_match('/^(mot|fat|par)motsib(son|dau|chi)chi$/', $path)) {
                                                                            return WT_I18N::translate_c('grandmother’s sibling’s grandchild', 'second cousin');
                                                                        } else {
                                                                            if (preg_match('/^(mot|fat|par)parbro(son|dau|chi)dau$/', $path)) {
                                                                                return WT_I18N::translate_c('grandparent’s brother’s granddaughter', 'second cousin');
                                                                            } else {
                                                                                if (preg_match('/^(mot|fat|par)parbro(son|dau|chi)son$/', $path)) {
                                                                                    return WT_I18N::translate_c('grandparent’s brother’s grandson', 'second cousin');
                                                                                } else {
                                                                                    if (preg_match('/^(mot|fat|par)parbro(son|dau|chi)chi$/', $path)) {
                                                                                        return WT_I18N::translate_c('grandparent’s brother’s grandchild', 'second cousin');
                                                                                    } else {
                                                                                        if (preg_match('/^(mot|fat|par)parsis(son|dau|chi)dau$/', $path)) {
                                                                                            return WT_I18N::translate_c('grandparent’s sister’s granddaughter', 'second cousin');
                                                                                        } else {
                                                                                            if (preg_match('/^(mot|fat|par)parsis(son|dau|chi)son$/', $path)) {
                                                                                                return WT_I18N::translate_c('grandparent’s sister’s grandson', 'second cousin');
                                                                                            } else {
                                                                                                if (preg_match('/^(mot|fat|par)parsis(son|dau|chi)chi$/', $path)) {
                                                                                                    return WT_I18N::translate_c('grandparent’s sister’s grandchild', 'second cousin');
                                                                                                } else {
                                                                                                    if (preg_match('/^(mot|fat|par)parsib(son|dau|chi)dau$/', $path)) {
                                                                                                        return WT_I18N::translate_c('grandparent’s sibling’s granddaughter', 'second cousin');
                                                                                                    } else {
                                                                                                        if (preg_match('/^(mot|fat|par)parsib(son|dau|chi)son$/', $path)) {
                                                                                                            return WT_I18N::translate_c('grandparent’s sibling’s grandson', 'second cousin');
                                                                                                        } else {
                                                                                                            if (preg_match('/^(mot|fat|par)parsib(son|dau|chi)chi$/', $path)) {
                                                                                                                return WT_I18N::translate_c('grandparent’s sibling’s grandchild', 'second cousin');
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    // Look for generic/pattern relationships.
    // TODO: these are heavily based on English relationship names.
    // We need feedback from other languages to improve this.
    // Dutch has special names for 8 generations of great-great-..., so these need explicit naming
    // Spanish has special names for four but also has two different numbering patterns
    if (preg_match('/^((?:mot|fat|par)+)(bro|sis|sib)$/', $path, $match)) {
        // siblings of direct ancestors
        $up = strlen($match[1]) / 3;
        $bef_last = substr($path, -6, 3);
        switch ($up) {
            case 3:
                switch ($sex2) {
                    case 'M':
                        if ($bef_last == 'fat') {
                            return WT_I18N::translate_c('great-grandfather’s brother', 'great-great-uncle');
                        } else {
                            if ($bef_last == 'mot') {
                                return WT_I18N::translate_c('great-grandmother’s brother', 'great-great-uncle');
                            } else {
                                return WT_I18N::translate_c('great-grandparent’s brother', 'great-great-uncle');
                            }
                        }
                    case 'F':
                        return WT_I18N::translate('great-great-aunt');
                    case 'U':
                        return WT_I18N::translate('great-great-aunt/uncle');
                }
                break;
            case 4:
                switch ($sex2) {
                    case 'M':
                        if ($bef_last == 'fat') {
                            return WT_I18N::translate_c('great-great-grandfather’s brother', 'great-great-great-uncle');
                        } else {
                            if ($bef_last == 'mot') {
                                return WT_I18N::translate_c('great-great-grandmother’s brother', 'great-great-great-uncle');
                            } else {
                                return WT_I18N::translate_c('great-great-grandparent’s brother', 'great-great-great-uncle');
                            }
                        }
                    case 'F':
                        return WT_I18N::translate('great-great-great-aunt');
                    case 'U':
                        return WT_I18N::translate('great-great-great-aunt/uncle');
                }
                break;
            case 5:
                switch ($sex2) {
                    case 'M':
                        if ($bef_last == 'fat') {
                            return WT_I18N::translate_c('great-great-great-grandfather’s brother', 'great ×4 uncle');
                        } else {
                            if ($bef_last == 'mot') {
                                return WT_I18N::translate_c('great-great-great-grandmother’s brother', 'great ×4 uncle');
                            } else {
                                return WT_I18N::translate_c('great-great-great-grandparent’s brother', 'great ×4 uncle');
                            }
                        }
                    case 'F':
                        return WT_I18N::translate('great ×4 aunt');
                    case 'U':
                        return WT_I18N::translate('great ×4 aunt/uncle');
                }
                break;
            case 6:
                switch ($sex2) {
                    case 'M':
                        if ($bef_last == 'fat') {
                            return WT_I18N::translate_c('great ×4 grandfather’s brother', 'great ×5 uncle');
                        } else {
                            if ($bef_last == 'mot') {
                                return WT_I18N::translate_c('great ×4 grandmother’s brother', 'great ×5 uncle');
                            } else {
                                return WT_I18N::translate_c('great ×4 grandparent’s brother', 'great ×5 uncle');
                            }
                        }
                    case 'F':
                        return WT_I18N::translate('great ×5 aunt');
                    case 'U':
                        return WT_I18N::translate('great ×5 aunt/uncle');
                }
                break;
            case 7:
                switch ($sex2) {
                    case 'M':
                        if ($bef_last == 'fat') {
                            return WT_I18N::translate_c('great ×5 grandfather’s brother', 'great ×6 uncle');
                        } else {
                            if ($bef_last == 'mot') {
                                return WT_I18N::translate_c('great ×5 grandmother’s brother', 'great ×6 uncle');
                            } else {
                                return WT_I18N::translate_c('great ×5 grandparent’s brother', 'great ×6 uncle');
                            }
                        }
                    case 'F':
                        return WT_I18N::translate('great ×6 aunt');
                    case 'U':
                        return WT_I18N::translate('great ×6 aunt/uncle');
                }
                break;
            case 8:
                switch ($sex2) {
                    case 'M':
                        if ($bef_last == 'fat') {
                            return WT_I18N::translate_c('great ×6 grandfather’s brother', 'great ×7 uncle');
                        } else {
                            if ($bef_last == 'mot') {
                                return WT_I18N::translate_c('great ×6 grandmother’s brother', 'great ×7 uncle');
                            } else {
                                return WT_I18N::translate_c('great ×6 grandparent’s brother', 'great ×7 uncle');
                            }
                        }
                    case 'F':
                        return WT_I18N::translate('great ×7 aunt');
                    case 'U':
                        return WT_I18N::translate('great ×7 aunt/uncle');
                }
                break;
            default:
                // Different languages have different rules for naming generations.
                // An English great ×12 uncle is a Danish great ×10 uncle.
                //
                // Need to find out which languages use which rules.
                switch (WT_LOCALE) {
                    case 'da':
                        switch ($sex2) {
                            case 'M':
                                return WT_I18N::translate('great ×%d uncle', $up - 4);
                            case 'F':
                                return WT_I18N::translate('great ×%d aunt', $up - 4);
                            case 'U':
                                return WT_I18N::translate('great ×%d aunt/uncle', $up - 4);
                        }
                    case 'pl':
                        switch ($sex2) {
                            case 'M':
                                if ($bef_last == 'fat') {
                                    return WT_I18N::translate_c('great ×(%d-1) grandfather’s brother', 'great ×%d uncle', $up - 2);
                                } else {
                                    if ($bef_last == 'mot') {
                                        return WT_I18N::translate_c('great ×(%d-1) grandmother’s brother', 'great ×%d uncle', $up - 2);
                                    } else {
                                        return WT_I18N::translate_c('great ×(%d-1) grandparent’s brother', 'great ×%d uncle', $up - 2);
                                    }
                                }
                            case 'F':
                                return WT_I18N::translate('great ×%d aunt', $up - 2);
                            case 'U':
                                return WT_I18N::translate('great ×%d aunt/uncle', $up - 2);
                        }
                    case 'it':
                        // Source: Michele Locati
                    // Source: Michele Locati
                    case 'en_AU':
                    case 'en_GB':
                    case 'en_US':
                    default:
                        switch ($sex2) {
                            case 'M':
                                // I18N: if you need a different number for %d, contact the developers, as a code-change is required
                                return WT_I18N::translate('great ×%d uncle', $up - 1);
                            case 'F':
                                return WT_I18N::translate('great ×%d aunt', $up - 1);
                            case 'U':
                                return WT_I18N::translate('great ×%d aunt/uncle', $up - 1);
                        }
                }
        }
    }
    if (preg_match('/^(?:bro|sis|sib)((?:son|dau|chi)+)$/', $path, $match)) {
        // direct descendants of siblings
        $down = strlen($match[1]) / 3 + 1;
        // Add one, as we count generations from the common ancestor
        $first = substr($path, 0, 3);
        switch ($down) {
            case 4:
                switch ($sex2) {
                    case 'M':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great-grandson', 'great-great-nephew');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great-grandson', 'great-great-nephew');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great-great-nephew', 'great-great-nephew');
                            }
                        }
                    case 'F':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great-granddaughter', 'great-great-niece');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great-granddaughter', 'great-great-niece');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great-great-niece', 'great-great-niece');
                            }
                        }
                    case 'U':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great-grandchild', 'great-great-nephew/niece');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great-grandchild', 'great-great-nephew/niece');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great-great-nephew/niece', 'great-great-nephew/niece');
                            }
                        }
                }
            case 5:
                switch ($sex2) {
                    case 'M':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great-great-grandson', 'great-great-great-nephew');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great-great-grandson', 'great-great-great-nephew');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great-great-great-nephew', 'great-great-great-nephew');
                            }
                        }
                    case 'F':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great-great-granddaughter', 'great-great-great-niece');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great-great-granddaughter', 'great-great-great-niece');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great-great-great-niece', 'great-great-great-niece');
                            }
                        }
                    case 'U':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great-great-grandchild', 'great-great-great-nephew/niece');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great-great-grandchild', 'great-great-great-nephew/niece');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great-great-great-nephew/niece', 'great-great-great-nephew/niece');
                            }
                        }
                }
            case 6:
                switch ($sex2) {
                    case 'M':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great-great-great-grandson', 'great ×4 nephew');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great-great-great-grandson', 'great ×4 nephew');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great ×4 nephew', 'great ×4 nephew');
                            }
                        }
                    case 'F':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great-great-great-granddaughter', 'great ×4 niece');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great-great-great-granddaughter', 'great ×4 niece');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great ×4 niece', 'great ×4 niece');
                            }
                        }
                    case 'U':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great-great-great-grandchild', 'great ×4 nephew/niece');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great-great-great-grandchild', 'great ×4 nephew/niece');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great ×4 nephew/niece', 'great ×4 nephew/niece');
                            }
                        }
                }
            case 7:
                switch ($sex2) {
                    case 'M':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great ×4 grandson', 'great ×5 nephew');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great ×4 grandson', 'great ×5 nephew');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great ×5 nephew', 'great ×5 nephew');
                            }
                        }
                    case 'F':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great ×4 granddaughter', 'great ×5 niece');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great ×4 granddaughter', 'great ×5 niece');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great ×5 niece', 'great ×5 niece');
                            }
                        }
                    case 'U':
                        if ($first == 'bro' && $sex1 == 'M') {
                            return WT_I18N::translate_c('(a man’s) brother’s great ×4 grandchild', 'great ×5 nephew/niece');
                        } else {
                            if ($first == 'sis' && $sex1 == 'M') {
                                return WT_I18N::translate_c('(a man’s) sister’s great ×4 grandchild', 'great ×5 nephew/niece');
                            } else {
                                return WT_I18N::translate_c('(a woman’s) great ×5 nephew/niece', 'great ×5 nephew/niece');
                            }
                        }
                }
            default:
                // Different languages have different rules for naming generations.
                // An English great ×12 nephew is a Polish great ×11 nephew.
                //
                // Need to find out which languages use which rules.
                switch (WT_LOCALE) {
                    case 'pl':
                        // Source: Lukasz Wilenski
                        switch ($sex2) {
                            case 'M':
                                if ($first == 'bro' && $sex1 == 'M') {
                                    return WT_I18N::translate_c('(a man’s) brother’s great ×(%d-1) grandson', 'great ×%d nephew', $down - 3);
                                } else {
                                    if ($first == 'sis' && $sex1 == 'M') {
                                        return WT_I18N::translate_c('(a man’s) sister’s great ×(%d-1) grandson', 'great ×%d nephew', $down - 3);
                                    } else {
                                        return WT_I18N::translate_c('(a woman’s) great ×%d nephew', 'great ×%d nephew', $down - 3);
                                    }
                                }
                            case 'F':
                                if ($first == 'bro' && $sex1 == 'M') {
                                    return WT_I18N::translate_c('(a man’s) brother’s great ×(%d-1) granddaughter', 'great ×%d niece', $down - 3);
                                } else {
                                    if ($first == 'sis' && $sex1 == 'M') {
                                        return WT_I18N::translate_c('(a man’s) sister’s great ×(%d-1) granddaughter', 'great ×%d niece', $down - 3);
                                    } else {
                                        return WT_I18N::translate_c('(a woman’s) great ×%d niece', 'great ×%d niece', $down - 3);
                                    }
                                }
                            case 'U':
                                if ($first == 'bro' && $sex1 == 'M') {
                                    return WT_I18N::translate_c('(a man’s) brother’s great ×(%d-1) grandchild', 'great ×%d nephew/niece', $down - 3);
                                } else {
                                    if ($first == 'sis' && $sex1 == 'M') {
                                        return WT_I18N::translate_c('(a man’s) sister’s great ×(%d-1) grandchild', 'great ×%d nephew/niece', $down - 3);
                                    } else {
                                        return WT_I18N::translate_c('(a woman’s) great ×%d nephew/niece', 'great ×%d nephew/niece', $down - 3);
                                    }
                                }
                        }
                    case 'he':
                        // Source: Meliza Amity
                        switch ($sex2) {
                            case 'M':
                                return WT_I18N::translate('great ×%d nephew', $down - 1);
                            case 'F':
                                return WT_I18N::translate('great ×%d niece', $down - 1);
                            case 'U':
                                return WT_I18N::translate('great ×%d nephew/niece', $down - 1);
                        }
                    case 'it':
                        // Source: Michele Locati.
                    // Source: Michele Locati.
                    case 'en_AU':
                    case 'en_GB':
                    case 'en_US':
                    default:
                        switch ($sex2) {
                            case 'M':
                                // I18N: if you need a different number for %d, contact the developers, as a code-change is required
                                return WT_I18N::translate('great ×%d nephew', $down - 2);
                            case 'F':
                                return WT_I18N::translate('great ×%d niece', $down - 2);
                            case 'U':
                                return WT_I18N::translate('great ×%d nephew/niece', $down - 2);
                        }
                }
        }
    }
    if (preg_match('/^((?:mot|fat|par)*)$/', $path, $match)) {
        // direct ancestors
        $up = strlen($match[1]) / 3;
        switch ($up) {
            case 4:
                switch ($sex2) {
                    case 'M':
                        return WT_I18N::translate('great-great-grandfather');
                    case 'F':
                        return WT_I18N::translate('great-great-grandmother');
                    case 'U':
                        return WT_I18N::translate('great-great-grandparent');
                }
                break;
            case 5:
                switch ($sex2) {
                    case 'M':
                        return WT_I18N::translate('great-great-great-grandfather');
                    case 'F':
                        return WT_I18N::translate('great-great-great-grandmother');
                    case 'U':
                        return WT_I18N::translate('great-great-great-grandparent');
                }
                break;
            case 6:
                switch ($sex2) {
                    case 'M':
                        return WT_I18N::translate('great ×4 grandfather');
                    case 'F':
                        return WT_I18N::translate('great ×4 grandmother');
                    case 'U':
                        return WT_I18N::translate('great ×4 grandparent');
                }
                break;
            case 7:
                switch ($sex2) {
                    case 'M':
                        return WT_I18N::translate('great ×5 grandfather');
                    case 'F':
                        return WT_I18N::translate('great ×5 grandmother');
                    case 'U':
                        return WT_I18N::translate('great ×5 grandparent');
                }
                break;
            case 8:
                switch ($sex2) {
                    case 'M':
                        return WT_I18N::translate('great ×6 grandfather');
                    case 'F':
                        return WT_I18N::translate('great ×6 grandmother');
                    case 'U':
                        return WT_I18N::translate('great ×6 grandparent');
                }
                break;
            case 9:
                switch ($sex2) {
                    case 'M':
                        return WT_I18N::translate('great ×7 grandfather');
                    case 'F':
                        return WT_I18N::translate('great ×7 grandmother');
                    case 'U':
                        return WT_I18N::translate('great ×7 grandparent');
                }
                break;
            default:
                // Different languages have different rules for naming generations.
                // An English great ×12 grandfather is a Danish great ×11 grandfather.
                //
                // Need to find out which languages use which rules.
                switch (WT_LOCALE) {
                    case 'da':
                        // Source: Patrick Sorensen
                        switch ($sex2) {
                            case 'M':
                                return WT_I18N::translate('great ×%d grandfather', $up - 3);
                            case 'F':
                                return WT_I18N::translate('great ×%d grandmother', $up - 3);
                            case 'U':
                                return WT_I18N::translate('great ×%d grandparent', $up - 3);
                        }
                    case 'it':
                        // Source: Michele Locati
                    // Source: Michele Locati
                    case 'es':
                        // Source: Wes Groleau
                        switch ($sex2) {
                            case 'M':
                                return WT_I18N::translate('great ×%d grandfather', $up);
                            case 'F':
                                return WT_I18N::translate('great ×%d grandmother', $up);
                            case 'U':
                                return WT_I18N::translate('great ×%d grandparent', $up);
                        }
                    case 'fr':
                        // Source: Jacqueline Tetreault
                    // Source: Jacqueline Tetreault
                    case 'fr_CA':
                        switch ($sex2) {
                            case 'M':
                                return WT_I18N::translate('great ×%d grandfather', $up - 1);
                            case 'F':
                                return WT_I18N::translate('great ×%d grandmother', $up - 1);
                            case 'U':
                                return WT_I18N::translate('great ×%d grandparent', $up - 1);
                        }
                    case 'nn':
                        // Source: Hogne Røed Nilsen (https://bugs.launchpad.net/webtrees/+bug/1168553)
                    // Source: Hogne Røed Nilsen (https://bugs.launchpad.net/webtrees/+bug/1168553)
                    case 'nb':
                        switch ($sex2) {
                            case 'M':
                                // I18N: if you need a different number for %d, contact the developers, as a code-change is required
                                return WT_I18N::translate('great ×%d grandfather', $up - 3);
                            case 'F':
                                return WT_I18N::translate('great ×%d grandmother', $up - 3);
                            case 'U':
                                return WT_I18N::translate('great ×%d grandparent', $up - 3);
                        }
                    case 'en_AU':
                    case 'en_GB':
                    case 'en_US':
                    default:
                        switch ($sex2) {
                            case 'M':
                                // I18N: if you need a different number for %d, contact the developers, as a code-change is required
                                return WT_I18N::translate('great ×%d grandfather', $up - 2);
                            case 'F':
                                return WT_I18N::translate('great ×%d grandmother', $up - 2);
                            case 'U':
                                return WT_I18N::translate('great ×%d grandparent', $up - 2);
                        }
                }
        }
    }
    if (preg_match('/^((?:son|dau|chi)*)$/', $path, $match)) {
        // direct descendants
        $up = strlen($match[1]) / 3;
        switch ($up) {
            case 4:
                switch ($sex2) {
                    case 'son':
                        return WT_I18N::translate('great-great-grandson');
                    case 'dau':
                        return WT_I18N::translate('great-great-granddaughter');
                    case 'chi':
                        return WT_I18N::translate('great-great-grandchild');
                }
                break;
            case 5:
                switch ($sex2) {
                    case 'M':
                        return WT_I18N::translate('great-great-great-grandson');
                    case 'F':
                        return WT_I18N::translate('great-great-great-granddaughter');
                    case 'U':
                        return WT_I18N::translate('great-great-great-grandchild');
                }
                break;
            case 6:
                switch ($sex2) {
                    case 'M':
                        return WT_I18N::translate('great ×4 grandson');
                    case 'F':
                        return WT_I18N::translate('great ×4 granddaughter');
                    case 'U':
                        return WT_I18N::translate('great ×4 grandchild');
                }
                break;
            case 7:
                switch ($sex2) {
                    case 'M':
                        return WT_I18N::translate('great ×5 grandson');
                    case 'F':
                        return WT_I18N::translate('great ×5 granddaughter');
                    case 'U':
                        return WT_I18N::translate('great ×5 grandchild');
                }
                break;
            case 8:
                switch ($sex2) {
                    case 'M':
                        return WT_I18N::translate('great ×6 grandson');
                    case 'F':
                        return WT_I18N::translate('great ×6 granddaughter');
                    case 'U':
                        return WT_I18N::translate('great ×6 grandchild');
                }
                break;
            case 9:
                switch ($sex2) {
                    case 'M':
                        return WT_I18N::translate('great ×7 grandson');
                    case 'F':
                        return WT_I18N::translate('great ×7 granddaughter');
                    case 'U':
                        return WT_I18N::translate('great ×7 grandchild');
                }
                break;
            default:
                // Different languages have different rules for naming generations.
                // An English great ×12 grandson is a Danish great ×11 grandson.
                //
                // Need to find out which languages use which rules.
                switch (WT_LOCALE) {
                    case 'nn':
                        // Source: Hogne Røed Nilsen
                    // Source: Hogne Røed Nilsen
                    case 'nb':
                    case 'da':
                        // Source: Patrick Sorensen
                        switch ($sex2) {
                            case 'M':
                                return WT_I18N::translate('great ×%d grandson', $up - 3);
                            case 'F':
                                return WT_I18N::translate('great ×%d granddaughter', $up - 3);
                            case 'U':
                                return WT_I18N::translate('great ×%d grandchild', $up - 3);
                        }
                    case 'it':
                        // Source: Michele Locati
                    // Source: Michele Locati
                    case 'es':
                        // Source: Wes Groleau (adding doesn’t change behavior, but needs to be better researched)
                    // Source: Wes Groleau (adding doesn’t change behavior, but needs to be better researched)
                    case 'en_AU':
                    case 'en_GB':
                    case 'en_US':
                    default:
                        switch ($sex2) {
                            case 'M':
                                // I18N: if you need a different number for %d, contact the developers, as a code-change is required
                                return WT_I18N::translate('great ×%d grandson', $up - 2);
                            case 'F':
                                return WT_I18N::translate('great ×%d granddaughter', $up - 2);
                            case 'U':
                                return WT_I18N::translate('great ×%d grandchild', $up - 2);
                        }
                }
        }
    }
    if (preg_match('/^((?:mot|fat|par)+)(?:bro|sis|sib)((?:son|dau|chi)+)$/', $path, $match)) {
        // cousins in English
        $ascent = $match[1];
        $descent = $match[2];
        $up = strlen($ascent) / 3;
        $down = strlen($descent) / 3;
        $cousin = min($up, $down);
        // Moved out of switch (en/default case) so that
        $removed = abs($down - $up);
        // Spanish (and other languages) can use it, too.
        // Different languages have different rules for naming cousins.  For example,
        // an English “second cousin once removed” is a Polish “cousin of 7th degree”.
        //
        // Need to find out which languages use which rules.
        switch (WT_LOCALE) {
            case 'pl':
                // Source: Lukasz Wilenski
                return cousin_name($up + $down + 2, $sex2);
            case 'it':
                // Source: Michele Locati.  See italian_cousins_names.zip
                // http://webtrees.net/forums/8-translation/1200-great-xn-grandparent?limit=6&start=6
                return cousin_name($up + $down - 3, $sex2);
            case 'es':
                // Source: Wes Groleau.  See http://UniGen.us/Parentesco.html & http://UniGen.us/Parentesco-D.html
                if ($down == $up) {
                    return cousin_name($cousin, $sex2);
                } elseif ($down < $up) {
                    return cousin_name2($cousin + 1, $sex2, get_relationship_name_from_path('sib' . $descent, null, null));
                } else {
                    switch ($sex2) {
                        case 'M':
                            return cousin_name2($cousin + 1, $sex2, get_relationship_name_from_path('bro' . $descent, null, null));
                        case 'F':
                            return cousin_name2($cousin + 1, $sex2, get_relationship_name_from_path('sis' . $descent, null, null));
                        case 'U':
                            return cousin_name2($cousin + 1, $sex2, get_relationship_name_from_path('sib' . $descent, null, null));
                    }
                }
            case 'en_AU':
                // See: http://en.wikipedia.org/wiki/File:CousinTree.svg
            // See: http://en.wikipedia.org/wiki/File:CousinTree.svg
            case 'en_GB':
            case 'en_US':
            default:
                switch ($removed) {
                    case 0:
                        return cousin_name($cousin, $sex2);
                    case 1:
                        if ($up > $down) {
                            /* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
                            return WT_I18N::translate('%s once removed ascending', cousin_name($cousin, $sex2));
                        } else {
                            /* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
                            return WT_I18N::translate('%s once removed descending', cousin_name($cousin, $sex2));
                        }
                    case 2:
                        if ($up > $down) {
                            /* I18N: %s=“fifth cousin”, etc. */
                            return WT_I18N::translate('%s twice removed ascending', cousin_name($cousin, $sex2));
                        } else {
                            /* I18N: %s=“fifth cousin”, etc. */
                            return WT_I18N::translate('%s twice removed descending', cousin_name($cousin, $sex2));
                        }
                    case 3:
                        if ($up > $down) {
                            /* I18N: %s=“fifth cousin”, etc. */
                            return WT_I18N::translate('%s three times removed ascending', cousin_name($cousin, $sex2));
                        } else {
                            /* I18N: %s=“fifth cousin”, etc. */
                            return WT_I18N::translate('%s three times removed descending', cousin_name($cousin, $sex2));
                        }
                    default:
                        if ($up > $down) {
                            /* I18N: %1$s=“fifth cousin”, etc., %2$d>=4 */
                            return WT_I18N::translate('%1$s %2$d times removed ascending', cousin_name($cousin, $sex2), $removed);
                        } else {
                            /* I18N: %1$s=“fifth cousin”, etc., %2$d>=4 */
                            return WT_I18N::translate('%1$s %2$d times removed descending', cousin_name($cousin, $sex2), $removed);
                        }
                }
        }
    }
    // Split the relationship into sub-relationships, e.g., third-cousin’s great-uncle.
    // Try splitting at every point, and choose the path with the shorted translated name.
    $relationship = null;
    $path1 = substr($path, 0, 3);
    $path2 = substr($path, 3);
    while ($path2) {
        $tmp = WT_I18N::translate('%1$s’s %2$s', get_relationship_name_from_path($path1, null, null), get_relationship_name_from_path($path2, null, null));
        if (!$relationship || strlen($tmp) < strlen($relationship)) {
            $relationship = $tmp;
        }
        $path1 .= substr($path2, 0, 3);
        $path2 = substr($path2, 3);
    }
    return $relationship;
}
Exemplo n.º 6
0
/**
 * add a new tag input field
 *
 * called for each fact to be edited on a form.
 * Fact level=0 means a new empty form : data are POSTed by name
 * else data are POSTed using arrays :
 * glevels[] : tag level
 *  islink[] : tag is a link
 *     tag[] : tag name
 *    text[] : tag value
 *
 * @param string        $tag        fact record to edit (eg 2 DATE xxxxx)
 * @param string        $upperlevel optional upper level tag (eg BIRT)
 * @param string        $label      An optional label to echo instead of the default
 * @param string        $extra      optional text to display after the input field
 * @param WT_Individual $person     For male/female translations
 *
 * @return string
 */
function add_simple_tag($tag, $upperlevel = '', $label = '', $extra = null, WT_Individual $person = null)
{
    global $tags, $emptyfacts, $main_fact, $FILE_FORM_accept, $xref, $bdm, $action;
    global $QUICK_REQUIRED_FACTS, $QUICK_REQUIRED_FAMFACTS, $PREFER_LEVEL2_SOURCES;
    $subnamefacts = array("NPFX", "GIVN", "SPFX", "SURN", "NSFX", "_MARNM_SURN");
    preg_match('/^(?:(\\d+) (' . WT_REGEX_TAG . ') ?(.*))/', $tag, $match);
    list(, $level, $fact, $value) = $match;
    // element name : used to POST data
    if ($level == 0) {
        if ($upperlevel) {
            $element_name = $upperlevel . '_' . $fact;
        } else {
            $element_name = $fact;
        }
        // ex: OCCU
    } else {
        $element_name = "text[]";
    }
    if ($level == 1) {
        $main_fact = $fact;
    }
    // element id : used by javascript functions
    if ($level == 0) {
        $element_id = $fact;
    } else {
        $element_id = $fact . Uuid::uuid4();
    }
    if ($upperlevel) {
        $element_id = $upperlevel . '_' . $fact . Uuid::uuid4();
    }
    // field value
    $islink = substr($value, 0, 1) === '@' && substr($value, 0, 2) != '@#';
    if ($islink) {
        $value = trim(trim(substr($tag, strlen($fact) + 3)), " @\r");
    } else {
        $value = trim(substr($tag, strlen($fact) + 3));
    }
    if ($fact == 'REPO' || $fact == 'SOUR' || $fact == 'OBJE' || $fact == 'FAMC') {
        $islink = true;
    }
    if ($fact == 'SHARED_NOTE_EDIT' || $fact == 'SHARED_NOTE') {
        $islink = 1;
        $fact = "NOTE";
    }
    // label
    echo "<tr id=\"", $element_id, "_tr\" ";
    if ($fact == "MAP" || ($fact == "LATI" || $fact == "LONG") && $value == '') {
        echo " style=\"display:none;\"";
    }
    echo " >";
    if (in_array($fact, $subnamefacts) || $fact == "LATI" || $fact == "LONG") {
        echo "<td class=\"optionbox wrap width25\">";
    } else {
        echo "<td class=\"descriptionbox wrap width25\">";
    }
    if (WT_DEBUG) {
        echo $element_name, "<br>";
    }
    // tag name
    if ($label) {
        echo $label;
    } elseif ($upperlevel) {
        echo WT_Gedcom_Tag::getLabel($upperlevel . ':' . $fact);
    } else {
        echo WT_Gedcom_Tag::getLabel($fact);
    }
    // help link
    // If using GEDFact-assistant window
    if ($action == "addnewnote_assisted") {
        // Do not print on GEDFact Assistant window
    } else {
        // Not all facts have help text.
        switch ($fact) {
            case 'FORM':
                if ($upperlevel != 'OBJE') {
                    echo help_link($fact);
                }
                break;
            case 'NOTE':
                if ($islink) {
                    echo help_link('edit_add_SHARED_NOTE');
                } else {
                    echo help_link($fact);
                }
                break;
            case 'NAME':
                if ($upperlevel != 'REPO') {
                    echo help_link($fact);
                }
                break;
            case 'ASSO':
            case '_ASSO':
                // Some apps (including webtrees) use "2 _ASSO", since "2 ASSO" is not strictly valid GEDCOM
                if ($level == 1) {
                    echo help_link('ASSO_1');
                } else {
                    echo help_link('ASSO_2');
                }
                break;
            case 'ADDR':
            case 'AGNC':
            case 'CAUS':
            case 'DATE':
            case 'EMAI':
            case 'EMAIL':
            case 'EMAL':
            case '_EMAIL':
            case 'FAX':
            case 'OBJE':
            case 'PAGE':
            case 'PEDI':
            case 'PHON':
            case 'PLAC':
            case 'RELA':
            case 'RESN':
            case 'ROMN':
            case 'SEX':
            case 'SOUR':
            case 'STAT':
            case 'SURN':
            case 'TEMP':
            case 'TEXT':
            case 'TIME':
            case 'URL':
            case '_HEB':
            case '_PRIM':
                echo help_link($fact);
                break;
        }
    }
    // tag level
    if ($level > 0) {
        if ($fact == 'TEXT' && $level > 1) {
            echo "<input type=\"hidden\" name=\"glevels[]\" value=\"", $level - 1, "\">";
            echo "<input type=\"hidden\" name=\"islink[]\" value=\"0\">";
            echo "<input type=\"hidden\" name=\"tag[]\" value=\"DATA\">";
            //-- leave data text[] value empty because the following TEXT line will
            //--- cause the DATA to be added
            echo "<input type=\"hidden\" name=\"text[]\" value=\"\">";
        }
        echo "<input type=\"hidden\" name=\"glevels[]\" value=\"", $level, "\">";
        echo "<input type=\"hidden\" name=\"islink[]\" value=\"", $islink, "\">";
        echo "<input type=\"hidden\" name=\"tag[]\" value=\"", $fact, "\">";
    }
    echo "</td>";
    // value
    echo "<td class=\"optionbox wrap\">";
    if (WT_DEBUG) {
        echo $tag, "<br>";
    }
    // retrieve linked NOTE
    if ($fact == "NOTE" && $islink) {
        $note1 = WT_Note::getInstance($value);
        if ($note1) {
            $noterec = $note1->getGedcom();
            preg_match("/{$value}/i", $noterec, $notematch);
            $value = $notematch[0];
        }
    }
    if (in_array($fact, $emptyfacts) && ($value == '' || $value == 'Y' || $value == 'y')) {
        echo "<input type=\"hidden\" id=\"", $element_id, "\" name=\"", $element_name, "\" value=\"", $value, "\">";
        if ($level <= 1) {
            echo '<input type="checkbox" ';
            if ($value) {
                echo ' checked="checked"';
            }
            echo " onclick=\"if (this.checked) ", $element_id, ".value='Y'; else ", $element_id, ".value='';\">";
            echo WT_I18N::translate('yes');
        }
    } else {
        if ($fact == "TEMP") {
            echo select_edit_control($element_name, WT_Gedcom_Code_Temp::templeNames(), WT_I18N::translate('No temple - living ordinance'), $value);
        } else {
            if ($fact == "ADOP") {
                echo edit_field_adop($element_name, $value, '', $person);
            } else {
                if ($fact == "PEDI") {
                    echo edit_field_pedi($element_name, $value, '', $person);
                } else {
                    if ($fact == 'STAT') {
                        echo select_edit_control($element_name, WT_Gedcom_Code_Stat::statusNames($upperlevel), '', $value);
                    } else {
                        if ($fact == 'RELA') {
                            echo edit_field_rela($element_name, strtolower($value));
                        } else {
                            if ($fact == 'QUAY') {
                                echo select_edit_control($element_name, WT_Gedcom_Code_Quay::getValues(), '', $value);
                            } else {
                                if ($fact == '_WT_USER') {
                                    echo edit_field_username($element_name, $value);
                                } else {
                                    if ($fact == 'RESN') {
                                        echo edit_field_resn($element_name, $value);
                                    } else {
                                        if ($fact == '_PRIM') {
                                            echo '<select id="', $element_id, '" name="', $element_name, '" >';
                                            echo '<option value=""></option>';
                                            echo '<option value="Y"';
                                            if ($value == 'Y') {
                                                echo ' selected="selected"';
                                            }
                                            echo '>', WT_I18N::translate('yes'), '</option>';
                                            echo '<option value="N"';
                                            if ($value == 'N') {
                                                echo ' selected="selected"';
                                            }
                                            echo '>', WT_I18N::translate('no'), '</option>';
                                            echo '</select>';
                                        } else {
                                            if ($fact == 'SEX') {
                                                echo '<select id="', $element_id, '" name="', $element_name, '"><option value="M"';
                                                if ($value == 'M') {
                                                    echo ' selected="selected"';
                                                }
                                                echo '>', WT_I18N::translate('Male'), '</option><option value="F"';
                                                if ($value == 'F') {
                                                    echo ' selected="selected"';
                                                }
                                                echo '>', WT_I18N::translate('Female'), '</option><option value="U"';
                                                if ($value == 'U' || empty($value)) {
                                                    echo ' selected="selected"';
                                                }
                                                echo '>', WT_I18N::translate_c('unknown gender', 'Unknown'), '</option></select>';
                                            } else {
                                                if ($fact == 'TYPE' && $level == '3') {
                                                    //-- Build the selector for the Media 'TYPE' Fact
                                                    echo '<select name="text[]"><option selected="selected" value="" ></option>';
                                                    $selectedValue = strtolower($value);
                                                    if (!array_key_exists($selectedValue, WT_Gedcom_Tag::getFileFormTypes())) {
                                                        echo '<option selected="selected" value="', WT_Filter::escapeHtml($value), '" >', WT_Filter::escapeHtml($value), '</option>';
                                                    }
                                                    foreach (WT_Gedcom_Tag::getFileFormTypes() as $typeName => $typeValue) {
                                                        echo '<option value="', $typeName, '"';
                                                        if ($selectedValue == $typeName) {
                                                            echo ' selected="selected"';
                                                        }
                                                        echo '>', $typeValue, '</option>';
                                                    }
                                                    echo '</select>';
                                                } else {
                                                    if ($fact == 'NAME' && $upperlevel != 'REPO' || $fact == '_MARNM') {
                                                        // Populated in javascript from sub-tags
                                                        echo "<input type=\"hidden\" id=\"", $element_id, "\" name=\"", $element_name, "\" onchange=\"updateTextName('", $element_id, "');\" value=\"", WT_Filter::escapeHtml($value), "\" class=\"", $fact, "\">";
                                                        echo '<span id="', $element_id, '_display" dir="auto">', WT_Filter::escapeHtml($value), '</span>';
                                                        echo ' <a href="#edit_name" onclick="convertHidden(\'', $element_id, '\'); return false;" class="icon-edit_indi" title="' . WT_I18N::translate('Edit name') . '"></a>';
                                                    } else {
                                                        // textarea
                                                        if ($fact == 'TEXT' || $fact == 'ADDR' || $fact == 'NOTE' && !$islink) {
                                                            echo "<textarea id=\"", $element_id, "\" name=\"", $element_name, "\" dir=\"auto\">", WT_Filter::escapeHtml($value), "</textarea><br>";
                                                        } else {
                                                            // text
                                                            // If using GEDFact-assistant window
                                                            if ($action == "addnewnote_assisted") {
                                                                echo "<input type=\"text\" id=\"", $element_id, "\" name=\"", $element_name, "\" value=\"", WT_Filter::escapeHtml($value), "\" style=\"width:4.1em;\" dir=\"ltr\"";
                                                            } else {
                                                                echo "<input type=\"text\" id=\"", $element_id, "\" name=\"", $element_name, "\" value=\"", WT_Filter::escapeHtml($value), "\" dir=\"ltr\"";
                                                            }
                                                            echo " class=\"{$fact}\"";
                                                            if (in_array($fact, $subnamefacts)) {
                                                                echo " onblur=\"updatewholename();\" onkeyup=\"updatewholename();\"";
                                                            }
                                                            // Extra markup for specific fact types
                                                            switch ($fact) {
                                                                case 'DATE':
                                                                    echo " onblur=\"valid_date(this);\" onmouseout=\"valid_date(this);\"";
                                                                    break;
                                                                case 'GIVN':
                                                                    echo ' autofocus data-autocomplete-type="GIVN"';
                                                                    break;
                                                                case 'LATI':
                                                                    echo " onblur=\"valid_lati_long(this, 'N', 'S');\" onmouseout=\"valid_lati_long(this, 'N', 'S');\"";
                                                                    break;
                                                                case 'LONG':
                                                                    echo " onblur=\"valid_lati_long(this, 'E', 'W');\" onmouseout=\"valid_lati_long(this, 'E', 'W');\"";
                                                                    break;
                                                                case 'NOTE':
                                                                    // Shared notes.  Inline notes are handled elsewhere.
                                                                    echo ' data-autocomplete-type="NOTE"';
                                                                    break;
                                                                case 'OBJE':
                                                                    echo ' data-autocomplete-type="OBJE"';
                                                                    break;
                                                                case 'PLAC':
                                                                    echo ' data-autocomplete-type="PLAC"';
                                                                    break;
                                                                case 'REPO':
                                                                    echo ' data-autocomplete-type="REPO"';
                                                                    break;
                                                                case 'SOUR':
                                                                    echo ' data-autocomplete-type="SOUR"';
                                                                    break;
                                                                case 'SURN':
                                                                case '_MARNM_SURN':
                                                                    echo ' data-autocomplete-type="SURN"';
                                                                    break;
                                                            }
                                                            echo '>';
                                                        }
                                                        $tmp_array = array('TYPE', 'TIME', 'NOTE', 'SOUR', 'REPO', 'OBJE', 'ASSO', '_ASSO', 'AGE');
                                                        // split PLAC
                                                        if ($fact == 'PLAC') {
                                                            echo "<div id=\"", $element_id, "_pop\" style=\"display: inline;\">";
                                                            echo print_specialchar_link($element_id), ' ', print_findplace_link($element_id);
                                                            echo '<span  onclick="jQuery(\'tr[id^=', $upperlevel, '_LATI],tr[id^=', $upperlevel, '_LONG],tr[id^=LATI],tr[id^=LONG]\').toggle(\'fast\'); return false;" class="icon-target" title="', WT_Gedcom_Tag::getLabel('LATI'), ' / ', WT_Gedcom_Tag::getLabel('LONG'), '"></span>';
                                                            echo '</div>';
                                                            if (array_key_exists('places_assistant', WT_Module::getActiveModules())) {
                                                                places_assistant_WT_Module::setup_place_subfields($element_id);
                                                                places_assistant_WT_Module::print_place_subfields($element_id);
                                                            }
                                                        } elseif (!in_array($fact, $tmp_array)) {
                                                            echo print_specialchar_link($element_id);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    // MARRiage TYPE : hide text field and show a selection list
    if ($fact == 'TYPE' && $level == 2 && $tags[0] == 'MARR') {
        echo '<script>';
        echo "document.getElementById('", $element_id, "').style.display='none'";
        echo '</script>';
        echo "<select id=\"", $element_id, "_sel\" onchange=\"document.getElementById('", $element_id, "').value=this.value;\" >";
        foreach (array("Unknown", "Civil", "Religious", "Partners") as $key) {
            if ($key == "Unknown") {
                echo "<option value=\"\"";
            } else {
                echo "<option value=\"", $key, "\"";
            }
            $a = strtolower($key);
            $b = strtolower($value);
            if (@strpos($a, $b) !== false || @strpos($b, $a) !== false) {
                echo ' selected="selected"';
            }
            $tmp = "MARR_" . strtoupper($key);
            echo ">", WT_Gedcom_Tag::getLabel($tmp), "</option>";
        }
        echo "</select>";
    } else {
        if ($fact == 'TYPE' && $level == 0) {
            $onchange = 'onchange="document.getElementById(\'' . $element_id . '\').value=this.value;"';
            echo edit_field_name_type($element_name, $value, $onchange, $person);
            echo '<script>';
            echo "document.getElementById('", $element_id, "').style.display='none';";
            echo '</script>';
        }
    }
    // popup links
    switch ($fact) {
        case 'DATE':
            echo print_calendar_popup($element_id);
            // Allow the GEDFact_assistant module to show a census-date selector
            if (array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) {
                echo GEDFact_assistant_WT_Module::censusDateSelector($action, $upperlevel, $element_id);
            }
            break;
        case 'FAMC':
        case 'FAMS':
            echo print_findfamily_link($element_id);
            break;
        case 'ASSO':
        case '_ASSO':
            echo print_findindi_link($element_id, $element_id . '_description');
            break;
        case 'FILE':
            print_findmedia_link($element_id, "0file");
            break;
        case 'SOUR':
            echo print_findsource_link($element_id, $element_id . '_description'), ' ', print_addnewsource_link($element_id);
            //-- checkboxes to apply '1 SOUR' to BIRT/MARR/DEAT as '2 SOUR'
            if ($level == 1) {
                echo '<br>';
                if ($PREFER_LEVEL2_SOURCES === '0') {
                    $level1_checked = '';
                    $level2_checked = '';
                } else {
                    if ($PREFER_LEVEL2_SOURCES === '1' || $PREFER_LEVEL2_SOURCES === true) {
                        $level1_checked = '';
                        $level2_checked = ' checked="checked"';
                    } else {
                        $level1_checked = ' checked="checked"';
                        $level2_checked = '';
                    }
                }
                if (strpos($bdm, 'B') !== false) {
                    echo '&nbsp;<input type="checkbox" name="SOUR_INDI" ', $level1_checked, ' value="1">';
                    echo WT_I18N::translate('Individual');
                    if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $QUICK_REQUIRED_FACTS, $matches)) {
                        foreach ($matches[1] as $match) {
                            if (!in_array($match, explode('|', WT_EVENTS_DEAT))) {
                                echo '&nbsp;<input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="1">';
                                echo WT_Gedcom_Tag::getLabel($match);
                            }
                        }
                    }
                }
                if (strpos($bdm, 'D') !== false) {
                    if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $QUICK_REQUIRED_FACTS, $matches)) {
                        foreach ($matches[1] as $match) {
                            if (in_array($match, explode('|', WT_EVENTS_DEAT))) {
                                echo '&nbsp;<input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="1">';
                                echo WT_Gedcom_Tag::getLabel($match);
                            }
                        }
                    }
                }
                if (strpos($bdm, 'M') !== false) {
                    echo '&nbsp;<input type="checkbox" name="SOUR_FAM" ', $level1_checked, ' value="1">';
                    echo WT_I18N::translate('Family');
                    if (preg_match_all('/(' . WT_REGEX_TAG . ')/', $QUICK_REQUIRED_FAMFACTS, $matches)) {
                        foreach ($matches[1] as $match) {
                            echo '&nbsp;<input type="checkbox" name="SOUR_', $match, '"', $level2_checked, ' value="1">';
                            echo WT_Gedcom_Tag::getLabel($match);
                        }
                    }
                }
            }
            break;
        case 'REPO':
            echo print_findrepository_link($element_id), ' ', print_addnewrepository_link($element_id);
            break;
        case 'NOTE':
            // Shared Notes Icons ========================================
            if ($islink) {
                // Print regular Shared Note icons ---------------------------
                echo ' ', print_findnote_link($element_id, $element_id . '_description'), ' ', print_addnewnote_link($element_id);
                if ($value) {
                    echo ' ', print_editnote_link($value);
                }
                // Allow the GEDFact_assistant module to create a formatted shared note.
                if (array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) {
                    echo GEDFact_assistant_WT_Module::print_addnewnote_assisted_link($element_id, $xref, $action);
                }
            }
            break;
        case 'OBJE':
            echo print_findmedia_link($element_id, '1media');
            if (!$value) {
                echo ' ', print_addnewmedia_link($element_id);
                $value = 'new';
            }
            break;
    }
    echo '<div id="' . $element_id . '_description">';
    // current value
    if ($fact == 'DATE') {
        $date = new WT_Date($value);
        echo $date->Display(false);
    }
    if ($value && $value != 'new' && $islink) {
        switch ($fact) {
            case 'ASSO':
            case '_ASSO':
                $tmp = WT_Individual::getInstance($value);
                if ($tmp) {
                    echo ' ', $tmp->getFullname();
                }
                break;
            case 'SOUR':
                $tmp = WT_Source::getInstance($value);
                if ($tmp) {
                    echo ' ', $tmp->getFullname();
                }
                break;
            case 'NOTE':
                $tmp = WT_Note::getInstance($value);
                if ($tmp) {
                    echo ' ', $tmp->getFullname();
                }
                break;
            case 'OBJE':
                $tmp = WT_Media::getInstance($value);
                if ($tmp) {
                    echo ' ', $tmp->getFullname();
                }
                break;
            case 'REPO':
                $tmp = WT_Repository::getInstance($value);
                if ($tmp) {
                    echo ' ', $tmp->getFullname();
                }
                break;
        }
    }
    // pastable values
    if ($fact == 'FORM' && $upperlevel == 'OBJE') {
        print_autopaste_link($element_id, $FILE_FORM_accept);
    }
    echo '</div>', $extra, '</td></tr>';
    return $element_id;
}
Exemplo n.º 7
0
 static function NUM_TO_SHORT_MONTH($n, $leap_year)
 {
     switch ($n) {
         case 1:
             return WT_I18N::translate_c('Abbreviation for Persian month: Farvardin', 'Far');
         case 2:
             return WT_I18N::translate_c('Abbreviation for Persian month: Ordibehesht', 'Ord');
         case 3:
             return WT_I18N::translate_c('Abbreviation for Persian month: Khordad', 'Khor');
         case 4:
             return WT_I18N::translate_c('Abbreviation for Persian month: Tir', 'Tir');
         case 5:
             return WT_I18N::translate_c('Abbreviation for Persian month: Mordad', 'Mor');
         case 6:
             return WT_I18N::translate_c('Abbreviation for Persian month: Shahrivar', 'Shah');
         case 7:
             return WT_I18N::translate_c('Abbreviation for Persian month: Mehr', 'Mehr');
         case 8:
             return WT_I18N::translate_c('Abbreviation for Persian month: Aban', 'Aban');
         case 9:
             return WT_I18N::translate_c('Abbreviation for Persian month: Azar', 'Azar');
         case 10:
             return WT_I18N::translate_c('Abbreviation for Persian month: Dey', 'Dey');
         case 11:
             return WT_I18N::translate_c('Abbreviation for Persian month: Bahman', 'Bah');
         case 12:
             return WT_I18N::translate_c('Abbreviation for Persian month: Esfand', 'Esf');
         default:
             return '';
     }
 }
Exemplo n.º 8
0
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
define('WT_SCRIPT_NAME', 'repo.php');
require './includes/session.php';
require_once WT_ROOT . 'includes/functions/functions_print_lists.php';
$controller = new WT_Controller_Repository();
if ($controller->record && $controller->record->canShow()) {
    $controller->pageHeader();
    if ($controller->record->isOld()) {
        if (WT_USER_CAN_ACCEPT) {
            echo '<p class="ui-state-highlight">', WT_I18N::translate('This repository has been deleted.  You should review the deletion and then %1$s or %2$s it.', '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>'), ' ', help_link('pending_changes'), '</p>';
        } elseif (WT_USER_CAN_EDIT) {
            echo '<p class="ui-state-highlight">', WT_I18N::translate('This repository has been deleted.  The deletion will need to be reviewed by a moderator.'), ' ', help_link('pending_changes'), '</p>';
        }
    } elseif ($controller->record->isNew()) {
        if (WT_USER_CAN_ACCEPT) {
            echo '<p class="ui-state-highlight">', WT_I18N::translate('This repository has been edited.  You should review the changes and then %1$s or %2$s them.', '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>'), ' ', help_link('pending_changes'), '</p>';
        } elseif (WT_USER_CAN_EDIT) {
            echo '<p class="ui-state-highlight">', WT_I18N::translate('This repository has been edited.  The changes need to be reviewed by a moderator.'), ' ', help_link('pending_changes'), '</p>';
        }
    }
} else {
    header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
    $controller->pageHeader();
    echo '<p class="ui-state-error">', WT_I18N::translate('This repository does not exist or you do not have permission to view it.'), '</p>';
    exit;
}
$controller->addInlineJavascript('
		jQuery("#repo-tabs")
			.tabs({
				create: function(e, ui){
					jQuery(e.target).css("visibility", "visible");  // prevent FOUC
Exemplo n.º 9
0
 static function NUM_TO_MONTH_INSTRUMENTAL($n, $leap_year)
 {
     switch ($n) {
         case 1:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Tishrei');
         case 2:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Heshvan');
         case 3:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Kislev');
         case 4:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Tevet');
         case 5:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Shevat');
         case 6:
             if ($leap_year) {
                 return WT_I18N::translate_c('INSTRUMENTAL', 'Adar I');
             } else {
                 return WT_I18N::translate_c('INSTRUMENTAL', 'Adar');
             }
         case 7:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Adar II');
         case 8:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Nissan');
         case 9:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Iyar');
         case 10:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Sivan');
         case 11:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Tamuz');
         case 12:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Av');
         case 13:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Elul');
         default:
             return '';
     }
 }
Exemplo n.º 10
0
 private static function _centuryName($century)
 {
     if ($century < 0) {
         return str_replace(-$century, WT_Stats::_centuryName(-$century), WT_I18N::translate('%s BCE', WT_I18N::number(-$century)));
     }
     // The current chart engine (Google charts) can't handle <sup></sup> markup
     switch ($century) {
         case 21:
             return strip_tags(WT_I18N::translate_c('CENTURY', '21st'));
         case 20:
             return strip_tags(WT_I18N::translate_c('CENTURY', '20th'));
         case 19:
             return strip_tags(WT_I18N::translate_c('CENTURY', '19th'));
         case 18:
             return strip_tags(WT_I18N::translate_c('CENTURY', '18th'));
         case 17:
             return strip_tags(WT_I18N::translate_c('CENTURY', '17th'));
         case 16:
             return strip_tags(WT_I18N::translate_c('CENTURY', '16th'));
         case 15:
             return strip_tags(WT_I18N::translate_c('CENTURY', '15th'));
         case 14:
             return strip_tags(WT_I18N::translate_c('CENTURY', '14th'));
         case 13:
             return strip_tags(WT_I18N::translate_c('CENTURY', '13th'));
         case 12:
             return strip_tags(WT_I18N::translate_c('CENTURY', '12th'));
         case 11:
             return strip_tags(WT_I18N::translate_c('CENTURY', '11th'));
         case 10:
             return strip_tags(WT_I18N::translate_c('CENTURY', '10th'));
         case 9:
             return strip_tags(WT_I18N::translate_c('CENTURY', '9th'));
         case 8:
             return strip_tags(WT_I18N::translate_c('CENTURY', '8th'));
         case 7:
             return strip_tags(WT_I18N::translate_c('CENTURY', '7th'));
         case 6:
             return strip_tags(WT_I18N::translate_c('CENTURY', '6th'));
         case 5:
             return strip_tags(WT_I18N::translate_c('CENTURY', '5th'));
         case 4:
             return strip_tags(WT_I18N::translate_c('CENTURY', '4th'));
         case 3:
             return strip_tags(WT_I18N::translate_c('CENTURY', '3rd'));
         case 2:
             return strip_tags(WT_I18N::translate_c('CENTURY', '2nd'));
         case 1:
             return strip_tags(WT_I18N::translate_c('CENTURY', '1st'));
         default:
             return $century - 1 . '01-' . $century . '00';
     }
 }
Exemplo n.º 11
0
			<tr>
				<th colspan="2">
					<?php 
echo WT_I18N::translate('Other settings');
?>
				</th>
			</tr>
			<tr>
				<td>
					<?php 
echo WT_I18N::translate('Surname tradition'), help_link('SURNAME_TRADITION');
?>
				</td>
				<td>
					<?php 
echo select_edit_control('NEW_SURNAME_TRADITION', array('paternal' => WT_I18N::translate_c('Surname tradition', 'paternal'), 'patrilineal' => WT_I18N::translate('patrilineal'), 'matrilineal' => WT_I18N::translate('matrilineal'), 'spanish' => WT_I18N::translate_c('Surname tradition', 'Spanish'), 'portuguese' => WT_I18N::translate_c('Surname tradition', 'Portuguese'), 'icelandic' => WT_I18N::translate_c('Surname tradition', 'Icelandic'), 'polish' => WT_I18N::translate_c('Surname tradition', 'Polish'), 'lithuanian' => WT_I18N::translate_c('Surname tradition', 'Lithuanian'), 'none' => WT_I18N::translate_c('Surname tradition', 'none')), null, get_gedcom_setting(WT_GED_ID, 'SURNAME_TRADITION'));
?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
echo WT_I18N::translate('Use full source citations'), help_link('FULL_SOURCES');
?>
				</td>
				<td>
					<?php 
echo edit_field_yes_no('NEW_FULL_SOURCES', get_gedcom_setting(WT_GED_ID, 'FULL_SOURCES'));
?>
				</td>
			</tr>
Exemplo n.º 12
0
 public static function getLabel($tag, $record = null)
 {
     if ($record instanceof WT_Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($tag) {
         case 'ABBR':
             return WT_I18N::translate('Abbreviation');
         case 'ADDR':
             return WT_I18N::translate('Address');
         case 'ADR1':
             return WT_I18N::translate('Address line 1');
         case 'ADR2':
             return WT_I18N::translate('Address line 2');
         case 'ADOP':
             return WT_I18N::translate('Adoption');
         case 'ADOP:DATE':
             return WT_I18N::translate('Date of adoption');
         case 'ADOP:PLAC':
             return WT_I18N::translate('Place of adoption');
         case 'AFN':
             return WT_I18N::translate('Ancestral file number');
         case 'AGE':
             return WT_I18N::translate('Age');
         case 'AGNC':
             return WT_I18N::translate('Agency');
         case 'ALIA':
             return WT_I18N::translate('Alias');
         case 'ANCE':
             return WT_I18N::translate('Generations of ancestors');
         case 'ANCI':
             return WT_I18N::translate('Ancestors interest');
         case 'ANUL':
             return WT_I18N::translate('Annulment');
         case 'ASSO':
             return WT_I18N::translate('Associate');
             /* see also _ASSO */
         /* see also _ASSO */
         case 'AUTH':
             return WT_I18N::translate('Author');
         case 'BAPL':
             return WT_I18N::translate('LDS baptism');
         case 'BAPL:DATE':
             return WT_I18N::translate('Date of LDS baptism');
         case 'BAPL:PLAC':
             return WT_I18N::translate('Place of LDS baptism');
         case 'BAPM':
             return WT_I18N::translate('Baptism');
         case 'BAPM:DATE':
             return WT_I18N::translate('Date of baptism');
         case 'BAPM:PLAC':
             return WT_I18N::translate('Place of baptism');
         case 'BARM':
             return WT_I18N::translate('Bar mitzvah');
         case 'BARM:DATE':
             return WT_I18N::translate('Date of bar mitzvah');
         case 'BARM:PLAC':
             return WT_I18N::translate('Place of bar mitzvah');
         case 'BASM':
             return WT_I18N::translate('Bat mitzvah');
         case 'BASM:DATE':
             return WT_I18N::translate('Date of bat mitzvah');
         case 'BASM:PLAC':
             return WT_I18N::translate('Place of bat mitzvah');
         case 'BIRT':
             return WT_I18N::translate('Birth');
         case 'BIRT:DATE':
             return WT_I18N::translate('Date of birth');
         case 'BIRT:PLAC':
             return WT_I18N::translate('Place of birth');
         case 'BLES':
             return WT_I18N::translate('Blessing');
         case 'BLES:DATE':
             return WT_I18N::translate('Date of blessing');
         case 'BLES:PLAC':
             return WT_I18N::translate('Place of blessing');
         case 'BLOB':
             return WT_I18N::translate('Binary data object');
         case 'BURI':
             return WT_I18N::translate('Burial');
         case 'BURI:DATE':
             return WT_I18N::translate('Date of burial');
         case 'BURI:PLAC':
             return WT_I18N::translate('Place of burial');
         case 'CALN':
             return WT_I18N::translate('Call number');
         case 'CAST':
             return WT_I18N::translate('Caste');
         case 'CAUS':
             return WT_I18N::translate('Cause');
         case 'CEME':
             return WT_I18N::translate('Cemetery');
         case 'CENS':
             return WT_I18N::translate('Census');
         case 'CENS:DATE':
             return WT_I18N::translate('Census date');
         case 'CENS:PLAC':
             return WT_I18N::translate('Census place');
         case 'CHAN':
             return WT_I18N::translate('Last change');
         case 'CHAN:DATE':
             return WT_I18N::translate('Date of last change');
         case 'CHAN:_WT_USER':
             return WT_I18N::translate('Author of last change');
         case 'CHAR':
             return WT_I18N::translate('Character set');
         case 'CHIL':
             return WT_I18N::translate('Child');
         case 'CHR':
             return WT_I18N::translate('Christening');
         case 'CHR:DATE':
             return WT_I18N::translate('Date of christening');
         case 'CHR:PLAC':
             return WT_I18N::translate('Place of christening');
         case 'CHRA':
             return WT_I18N::translate('Adult christening');
         case 'CITN':
             return WT_I18N::translate('Citizenship');
         case 'CITY':
             return WT_I18N::translate('City');
         case 'COMM':
             return WT_I18N::translate('Comment');
         case 'CONC':
             return WT_I18N::translate('Concatenation');
         case 'CONT':
             return WT_I18N::translate('Continued');
         case 'CONF':
             return WT_I18N::translate('Confirmation');
         case 'CONF:DATE':
             return WT_I18N::translate('Date of confirmation');
         case 'CONF:PLAC':
             return WT_I18N::translate('Place of confirmation');
         case 'CONL':
             return WT_I18N::translate('LDS confirmation');
         case 'COPR':
             return WT_I18N::translate('Copyright');
         case 'CORP':
             return WT_I18N::translate('Corporation');
         case 'CREM':
             return WT_I18N::translate('Cremation');
         case 'CREM:DATE':
             return WT_I18N::translate('Date of cremation');
         case 'CREM:PLAC':
             return WT_I18N::translate('Place of cremation');
         case 'CTRY':
             return WT_I18N::translate('Country');
         case 'DATA':
             return WT_I18N::translate('Data');
         case 'DATA:DATE':
             return WT_I18N::translate('Date of entry in original source');
         case 'DATE':
             return WT_I18N::translate('Date');
         case 'DEAT':
             return WT_I18N::translate('Death');
         case 'DEAT:CAUS':
             return WT_I18N::translate('Cause of death');
         case 'DEAT:DATE':
             return WT_I18N::translate('Date of death');
         case 'DEAT:PLAC':
             return WT_I18N::translate('Place of death');
         case 'DESC':
             return WT_I18N::translate('Descendants');
         case 'DESI':
             return WT_I18N::translate('Descendants interest');
         case 'DEST':
             return WT_I18N::translate('Destination');
         case 'DIV':
             return WT_I18N::translate('Divorce');
         case 'DIVF':
             return WT_I18N::translate('Divorce filed');
         case 'DSCR':
             return WT_I18N::translate('Description');
         case 'EDUC':
             return WT_I18N::translate('Education');
         case 'EDUC:AGNC':
             return WT_I18N::translate('School or college');
         case 'EMAI':
             return WT_I18N::translate('Email address');
         case 'EMAIL':
             return WT_I18N::translate('Email address');
         case 'EMAL':
             return WT_I18N::translate('Email address');
         case 'EMIG':
             return WT_I18N::translate('Emigration');
         case 'EMIG:DATE':
             return WT_I18N::translate('Date of emigration');
         case 'EMIG:PLAC':
             return WT_I18N::translate('Place of emigration');
         case 'ENDL':
             return WT_I18N::translate('LDS endowment');
         case 'ENDL:DATE':
             return WT_I18N::translate('Date of LDS endowment');
         case 'ENDL:PLAC':
             return WT_I18N::translate('Place of LDS endowment');
         case 'ENGA':
             return WT_I18N::translate('Engagement');
         case 'ENGA:DATE':
             return WT_I18N::translate('Date of engagement');
         case 'ENGA:PLAC':
             return WT_I18N::translate('Place of engagement');
         case 'EVEN':
             return WT_I18N::translate('Event');
         case 'EVEN:DATE':
             return WT_I18N::translate('Date of event');
         case 'EVEN:PLAC':
             return WT_I18N::translate('Place of event');
         case 'FACT':
             return WT_I18N::translate('Fact');
         case 'FAM':
             return WT_I18N::translate('Family');
         case 'FAMC':
             return WT_I18N::translate('Family as a child');
         case 'FAMF':
             return WT_I18N::translate('Family file');
         case 'FAMS':
             return WT_I18N::translate('Family as a spouse');
         case 'FAMS:CENS:DATE':
             return WT_I18N::translate('Spouse census date');
         case 'FAMS:CENS:PLAC':
             return WT_I18N::translate('Spouse census place');
         case 'FAMS:DIV:DATE':
             return WT_I18N::translate('Date of divorce');
         case 'FAMS:MARR:DATE':
             return WT_I18N::translate('Date of marriage');
         case 'FAMS:MARR:PLAC':
             return WT_I18N::translate('Place of marriage');
         case 'FAMS:NOTE':
             return WT_I18N::translate('Spouse note');
         case 'FAMS:SLGS:DATE':
             return WT_I18N::translate('Date of LDS spouse sealing');
         case 'FAMS:SLGS:PLAC':
             return WT_I18N::translate('Place of LDS spouse sealing');
         case 'FAX':
             return WT_I18N::translate('Fax');
         case 'FCOM':
             return WT_I18N::translate('First communion');
         case 'FCOM:DATE':
             return WT_I18N::translate('Date of first communion');
         case 'FCOM:PLAC':
             return WT_I18N::translate('Place of first communion');
         case 'FILE':
             return WT_I18N::translate('Filename');
         case 'FONE':
             return WT_I18N::translate('Phonetic');
         case 'FORM':
             return WT_I18N::translate('Format');
         case 'GEDC':
             return WT_I18N::translate('GEDCOM file');
         case 'GIVN':
             return WT_I18N::translate('Given names');
         case 'GRAD':
             return WT_I18N::translate('Graduation');
         case 'HEAD':
             return WT_I18N::translate('Header');
         case 'HUSB':
             return WT_I18N::translate('Husband');
         case 'IDNO':
             return WT_I18N::translate('Identification number');
         case 'IMMI':
             return WT_I18N::translate('Immigration');
         case 'IMMI:DATE':
             return WT_I18N::translate('Date of immigration');
         case 'IMMI:PLAC':
             return WT_I18N::translate('Place of immigration');
         case 'INDI':
             return WT_I18N::translate('Individual');
         case 'INFL':
             return WT_I18N::translate('Infant');
         case 'LANG':
             return WT_I18N::translate('Language');
         case 'LATI':
             return WT_I18N::translate('Latitude');
         case 'LEGA':
             return WT_I18N::translate('Legatee');
         case 'LONG':
             return WT_I18N::translate('Longitude');
         case 'MAP':
             return WT_I18N::translate('Map');
         case 'MARB':
             return WT_I18N::translate('Marriage banns');
         case 'MARB:DATE':
             return WT_I18N::translate('Date of marriage banns');
         case 'MARB:PLAC':
             return WT_I18N::translate('Place of marriage banns');
         case 'MARC':
             return WT_I18N::translate('Marriage contract');
         case 'MARL':
             return WT_I18N::translate('Marriage license');
         case 'MARR':
             return WT_I18N::translate('Marriage');
         case 'MARR:DATE':
             return WT_I18N::translate('Date of marriage');
         case 'MARR:PLAC':
             return WT_I18N::translate('Place of marriage');
         case 'MARR_CIVIL':
             return WT_I18N::translate('Civil marriage');
         case 'MARR_PARTNERS':
             return WT_I18N::translate('Registered partnership');
         case 'MARR_RELIGIOUS':
             return WT_I18N::translate('Religious marriage');
         case 'MARR_UNKNOWN':
             return WT_I18N::translate('Marriage type unknown');
         case 'MARS':
             return WT_I18N::translate('Marriage settlement');
         case 'MEDI':
             return WT_I18N::translate('Media type');
         case 'NAME':
             if ($record instanceof WT_Repository) {
                 return WT_I18N::translate_c('Repository', 'Name');
             } else {
                 return WT_I18N::translate('Name');
             }
         case 'NAME:FONE':
             return WT_I18N::translate('Phonetic name');
         case 'NAME:_HEB':
             return WT_I18N::translate('Name in Hebrew');
         case 'NATI':
             return WT_I18N::translate('Nationality');
         case 'NATU':
             return WT_I18N::translate('Naturalization');
         case 'NATU:DATE':
             return WT_I18N::translate('Date of naturalization');
         case 'NATU:PLAC':
             return WT_I18N::translate('Place of naturalization');
         case 'NCHI':
             return WT_I18N::translate('Number of children');
         case 'NICK':
             return WT_I18N::translate('Nickname');
         case 'NMR':
             return WT_I18N::translate('Number of marriages');
         case 'NOTE':
             return WT_I18N::translate('Note');
         case 'NPFX':
             return WT_I18N::translate('Name prefix');
         case 'NSFX':
             return WT_I18N::translate('Name suffix');
         case 'OBJE':
             return WT_I18N::translate('Media object');
         case 'OCCU':
             return WT_I18N::translate('Occupation');
         case 'OCCU:AGNC':
             return WT_I18N::translate('Employer');
         case 'ORDI':
             return WT_I18N::translate('Ordinance');
         case 'ORDN':
             return WT_I18N::translate('Ordination');
         case 'ORDN:AGNC':
             return WT_I18N::translate('Religious institution');
         case 'ORDN:DATE':
             return WT_I18N::translate('Date of ordination');
         case 'ORDN:PLAC':
             return WT_I18N::translate('Place of ordination');
         case 'PAGE':
             return WT_I18N::translate('Citation details');
         case 'PEDI':
             return WT_I18N::translate('Relationship to parents');
         case 'PHON':
             return WT_I18N::translate('Phone');
         case 'PLAC':
             return WT_I18N::translate('Place');
         case 'PLAC:FONE':
             return WT_I18N::translate('Phonetic place');
         case 'PLAC:ROMN':
             return WT_I18N::translate('Romanized place');
         case 'PLAC:_HEB':
             return WT_I18N::translate('Place in Hebrew');
         case 'POST':
             return WT_I18N::translate('Postal code');
         case 'PROB':
             return WT_I18N::translate('Probate');
         case 'PROP':
             return WT_I18N::translate('Property');
         case 'PUBL':
             return WT_I18N::translate('Publication');
         case 'QUAY':
             return WT_I18N::translate('Quality of data');
         case 'REFN':
             return WT_I18N::translate('Reference number');
         case 'RELA':
             return WT_I18N::translate('Relationship');
         case 'RELI':
             return WT_I18N::translate('Religion');
         case 'REPO':
             return WT_I18N::translate('Repository');
         case 'RESI':
             return WT_I18N::translate('Residence');
         case 'RESI:DATE':
             return WT_I18N::translate('Date of residence');
         case 'RESI:PLAC':
             return WT_I18N::translate('Place of residence');
         case 'RESN':
             return WT_I18N::translate('Restriction');
         case 'RETI':
             return WT_I18N::translate('Retirement');
         case 'RETI:AGNC':
             return WT_I18N::translate('Employer');
         case 'RFN':
             return WT_I18N::translate('Record file number');
         case 'RIN':
             return WT_I18N::translate('Record ID number');
         case 'ROLE':
             return WT_I18N::translate('Role');
         case 'ROMN':
             return WT_I18N::translate('Romanized');
         case 'SERV':
             return WT_I18N::translate('Remote server');
         case 'SEX':
             return WT_I18N::translate('Gender');
         case 'SHARED_NOTE':
             return WT_I18N::translate('Shared note');
         case 'SLGC':
             return WT_I18N::translate('LDS child sealing');
         case 'SLGC:DATE':
             return WT_I18N::translate('Date of LDS child sealing');
         case 'SLGC:PLAC':
             return WT_I18N::translate('Place of LDS child sealing');
         case 'SLGS':
             return WT_I18N::translate('LDS spouse sealing');
         case 'SOUR':
             return WT_I18N::translate('Source');
         case 'SPFX':
             return WT_I18N::translate('Surname prefix');
         case 'SSN':
             return WT_I18N::translate('Social security number');
         case 'STAE':
             return WT_I18N::translate('State');
         case 'STAT':
             return WT_I18N::translate('Status');
         case 'STAT:DATE':
             return WT_I18N::translate('Status change date');
         case 'SUBM':
             return WT_I18N::translate('Submitter');
         case 'SUBN':
             return WT_I18N::translate('Submission');
         case 'SURN':
             return WT_I18N::translate('Surname');
         case 'TEMP':
             return WT_I18N::translate('Temple');
         case 'TEXT':
             return WT_I18N::translate('Text');
         case 'TIME':
             return WT_I18N::translate('Time');
         case 'TITL':
             return WT_I18N::translate('Title');
         case 'TITL:FONE':
             return WT_I18N::translate('Phonetic title');
         case 'TITL:ROMN':
             return WT_I18N::translate('Romanized title');
         case 'TITL:_HEB':
             return WT_I18N::translate('Title in Hebrew');
         case 'TRLR':
             return WT_I18N::translate('Trailer');
         case 'TYPE':
             return WT_I18N::translate('Type');
         case 'URL':
             return WT_I18N::translate('URL');
         case 'VERS':
             return WT_I18N::translate('Version');
         case 'WIFE':
             return WT_I18N::translate('Wife');
         case 'WILL':
             return WT_I18N::translate('Will');
         case 'WWW':
             return WT_I18N::translate('URL');
         case '_ADOP_CHIL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Adoption of a son');
                 case 'F':
                     return WT_I18N::translate('Adoption of a daughter');
                 default:
                     return WT_I18N::translate('Adoption of a child');
             }
         case '_ADOP_GCHI':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Adoption of a grandson');
                 case 'F':
                     return WT_I18N::translate('Adoption of a granddaughter');
                 default:
                     return WT_I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_GCH1':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('daughter’s son', 'Adoption of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('daughter’s daughter', 'Adoption of a granddaughter');
                 default:
                     return WT_I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_GCH2':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('son’s son', 'Adoption of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('son’s daughter', 'Adoption of a granddaughter');
                 default:
                     return WT_I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_HSIB':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Adoption of a half-brother');
                 case 'F':
                     return WT_I18N::translate('Adoption of a half-sister');
                 default:
                     return WT_I18N::translate('Adoption of a half-sibling');
             }
         case '_ADOP_SIBL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Adoption of a brother');
                 case 'F':
                     return WT_I18N::translate('Adoption of a sister');
                 default:
                     return WT_I18N::translate('Adoption of a sibling');
             }
         case '_ADPF':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Adopted by father');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Adopted by father');
                 default:
                     return WT_I18N::translate('Adopted by father');
             }
         case '_ADPM':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Adopted by mother');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Adopted by mother');
                 default:
                     return WT_I18N::translate('Adopted by mother');
             }
         case '_AKA':
         case '_AKAN':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Also known as');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Also known as');
                 default:
                     return WT_I18N::translate('Also known as');
             }
         case '_ASSO':
             return WT_I18N::translate('Associate');
             /* see also ASSO */
         /* see also ASSO */
         case '_BAPM_CHIL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Baptism of a son');
                 case 'F':
                     return WT_I18N::translate('Baptism of a daughter');
                 default:
                     return WT_I18N::translate('Baptism of a child');
             }
         case '_BAPM_GCHI':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Baptism of a grandson');
                 case 'F':
                     return WT_I18N::translate('Baptism of a granddaughter');
                 default:
                     return WT_I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_GCH1':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('daughter’s son', 'Baptism of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('daughter’s daughter', 'Baptism of a granddaughter');
                 default:
                     return WT_I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_GCH2':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('son’s son', 'Baptism of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('son’s daughter', 'Baptism of a granddaughter');
                 default:
                     return WT_I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_HSIB':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Baptism of a half-brother');
                 case 'F':
                     return WT_I18N::translate('Baptism of a half-sister');
                 default:
                     return WT_I18N::translate('Baptism of a half-sibling');
             }
         case '_BAPM_SIBL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Baptism of a brother');
                 case 'F':
                     return WT_I18N::translate('Baptism of a sister');
                 default:
                     return WT_I18N::translate('Baptism of a sibling');
             }
         case '_BIBL':
             return WT_I18N::translate('Bibliography');
         case '_BIRT_CHIL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Birth of a son');
                 case 'F':
                     return WT_I18N::translate('Birth of a daughter');
                 default:
                     return WT_I18N::translate('Birth of a child');
             }
         case '_BIRT_GCHI':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Birth of a grandson');
                 case 'F':
                     return WT_I18N::translate('Birth of a granddaughter');
                 default:
                     return WT_I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_GCH1':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('daughter’s son', 'Birth of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('daughter’s daughter', 'Birth of a granddaughter');
                 default:
                     return WT_I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_GCH2':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('son’s son', 'Birth of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('son’s daughter', 'Birth of a granddaughter');
                 default:
                     return WT_I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_HSIB':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Birth of a half-brother');
                 case 'F':
                     return WT_I18N::translate('Birth of a half-sister');
                 default:
                     return WT_I18N::translate('Birth of a half-sibling');
             }
         case '_BIRT_SIBL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Birth of a brother');
                 case 'F':
                     return WT_I18N::translate('Birth of a sister');
                 default:
                     return WT_I18N::translate('Birth of a sibling');
             }
         case '_BRTM':
             return WT_I18N::translate('Brit milah');
         case '_BRTM:DATE':
             return WT_I18N::translate('Date of brit milah');
         case '_BRTM:PLAC':
             return WT_I18N::translate('Place of brit milah');
         case '_BURI_CHIL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Burial of a son');
                 case 'F':
                     return WT_I18N::translate('Burial of a daughter');
                 default:
                     return WT_I18N::translate('Burial of a child');
             }
         case '_BURI_GCHI':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Burial of a grandson');
                 case 'F':
                     return WT_I18N::translate('Burial of a granddaughter');
                 default:
                     return WT_I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GCH1':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('daughter’s son', 'Burial of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('daughter’s daughter', 'Burial of a granddaughter');
                 default:
                     return WT_I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GCH2':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('son’s son', 'Burial of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('son’s daughter', 'Burial of a granddaughter');
                 default:
                     return WT_I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GPAR':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Burial of a grandfather');
                 case 'F':
                     return WT_I18N::translate('Burial of a grandmother');
                 default:
                     return WT_I18N::translate('Burial of a grandparent');
             }
         case '_BURI_GPA1':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Burial of a paternal grandfather');
                 case 'F':
                     return WT_I18N::translate('Burial of a paternal grandmother');
                 default:
                     return WT_I18N::translate('Burial of a paternal grandparent');
             }
         case '_BURI_GPA2':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Burial of a maternal grandfather');
                 case 'F':
                     return WT_I18N::translate('Burial of a maternal grandmother');
                 default:
                     return WT_I18N::translate('Burial of a maternal grandparent');
             }
         case '_BURI_HSIB':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Burial of a half-brother');
                 case 'F':
                     return WT_I18N::translate('Burial of a half-sister');
                 default:
                     return WT_I18N::translate('Burial of a half-sibling');
             }
         case '_BURI_PARE':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Burial of a father');
                 case 'F':
                     return WT_I18N::translate('Burial of a mother');
                 default:
                     return WT_I18N::translate('Burial of a parent');
             }
         case '_BURI_SIBL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Burial of a brother');
                 case 'F':
                     return WT_I18N::translate('Burial of a sister');
                 default:
                     return WT_I18N::translate('Burial of a sibling');
             }
         case '_BURI_SPOU':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Burial of a husband');
                 case 'F':
                     return WT_I18N::translate('Burial of a wife');
                 default:
                     return WT_I18N::translate('Burial of a spouse');
             }
         case '_CHR_CHIL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Christening of a son');
                 case 'F':
                     return WT_I18N::translate('Christening of a daughter');
                 default:
                     return WT_I18N::translate('Christening of a child');
             }
         case '_CHR_GCHI':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Christening of a grandson');
                 case 'F':
                     return WT_I18N::translate('Christening of a granddaughter');
                 default:
                     return WT_I18N::translate('Christening of a grandchild');
             }
         case '_CHR_GCH1':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('daughter’s son', 'Christening of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('daughter’s daughter', 'Christening of a granddaughter');
                 default:
                     return WT_I18N::translate('Christening of a grandchild');
             }
         case '_CHR_GCH2':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('son’s son', 'Christening of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('son’s daughter', 'Christening of a granddaughter');
                 default:
                     return WT_I18N::translate('Christening of a grandchild');
             }
         case '_CHR_HSIB':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Christening of a half-brother');
                 case 'F':
                     return WT_I18N::translate('Christening of a half-sister');
                 default:
                     return WT_I18N::translate('Christening of a half-sibling');
             }
         case '_CHR_SIBL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Christening of a brother');
                 case 'F':
                     return WT_I18N::translate('Christening of a sister');
                 default:
                     return WT_I18N::translate('Christening of a sibling');
             }
         case '_COML':
             return WT_I18N::translate('Common law marriage');
         case '_CREM_CHIL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Cremation of a son');
                 case 'F':
                     return WT_I18N::translate('Cremation of a daughter');
                 default:
                     return WT_I18N::translate('Cremation of a child');
             }
         case '_CREM_GCHI':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Cremation of a grandson');
                 case 'F':
                     return WT_I18N::translate('Cremation of a granddaughter');
                 default:
                     return WT_I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GCH1':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('daughter’s son', 'Cremation of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('daughter’s daughter', 'Cremation of a granddaughter');
                 default:
                     return WT_I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GCH2':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('son’s son', 'Cremation of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('son’s daughter', 'Cremation of a granddaughter');
                 default:
                     return WT_I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GPAR':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Cremation of a grandfather');
                 case 'F':
                     return WT_I18N::translate('Cremation of a grandmother');
                 default:
                     return WT_I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_GPA1':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Cremation of a paternal grandfather');
                 case 'F':
                     return WT_I18N::translate('Cremation of a paternal grandmother');
                 default:
                     return WT_I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_GPA2':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Cremation of a maternal grandfather');
                 case 'F':
                     return WT_I18N::translate('Cremation of a maternal grandmother');
                 default:
                     return WT_I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_HSIB':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Cremation of a half-brother');
                 case 'F':
                     return WT_I18N::translate('Cremation of a half-sister');
                 default:
                     return WT_I18N::translate('Cremation of a half-sibling');
             }
         case '_CREM_PARE':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Cremation of a father');
                 case 'F':
                     return WT_I18N::translate('Cremation of a mother');
                 default:
                     return WT_I18N::translate('Cremation of a parent');
             }
         case '_CREM_SIBL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Cremation of a brother');
                 case 'F':
                     return WT_I18N::translate('Cremation of a sister');
                 default:
                     return WT_I18N::translate('Cremation of a sibling');
             }
         case '_CREM_SPOU':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Cremation of a husband');
                 case 'F':
                     return WT_I18N::translate('Cremation of a wife');
                 default:
                     return WT_I18N::translate('Cremation of a spouse');
             }
         case '_DBID':
             return WT_I18N::translate('Linked database ID');
         case '_DEAT_CHIL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Death of a son');
                 case 'F':
                     return WT_I18N::translate('Death of a daughter');
                 default:
                     return WT_I18N::translate('Death of a child');
             }
         case '_DEAT_GCHI':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Death of a grandson');
                 case 'F':
                     return WT_I18N::translate('Death of a granddaughter');
                 default:
                     return WT_I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GCH1':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('daughter’s son', 'Death of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('daughter’s daughter', 'Death of a granddaughter');
                 default:
                     return WT_I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GCH2':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('son’s son', 'Death of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('son’s daughter', 'Death of a granddaughter');
                 default:
                     return WT_I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GPAR':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Death of a grandfather');
                 case 'F':
                     return WT_I18N::translate('Death of a grandmother');
                 default:
                     return WT_I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_GPA1':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Death of a paternal grandfather');
                 case 'F':
                     return WT_I18N::translate('Death of a paternal grandmother');
                 default:
                     return WT_I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_GPA2':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Death of a maternal grandfather');
                 case 'F':
                     return WT_I18N::translate('Death of a maternal grandmother');
                 default:
                     return WT_I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_HSIB':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Death of a half-brother');
                 case 'F':
                     return WT_I18N::translate('Death of a half-sister');
                 default:
                     return WT_I18N::translate('Death of a half-sibling');
             }
         case '_DEAT_PARE':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Death of a father');
                 case 'F':
                     return WT_I18N::translate('Death of a mother');
                 default:
                     return WT_I18N::translate('Death of a parent');
             }
         case '_DEAT_SIBL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Death of a brother');
                 case 'F':
                     return WT_I18N::translate('Death of a sister');
                 default:
                     return WT_I18N::translate('Death of a sibling');
             }
         case '_DEAT_SPOU':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Death of a husband');
                 case 'F':
                     return WT_I18N::translate('Death of a wife');
                 default:
                     return WT_I18N::translate('Death of a spouse');
             }
         case '_DEG':
             return WT_I18N::translate('Degree');
         case '_DETS':
             return WT_I18N::translate('Death of one spouse');
         case '_DNA':
             return WT_I18N::translate('DNA markers');
         case '_EMAIL':
             return WT_I18N::translate('Email address');
         case '_EYEC':
             return WT_I18N::translate('Eye color');
         case '_FA1':
             return WT_I18N::translate('Fact 1');
         case '_FA2':
             return WT_I18N::translate('Fact 2');
         case '_FA3':
             return WT_I18N::translate('Fact 3');
         case '_FA4':
             return WT_I18N::translate('Fact 4');
         case '_FA5':
             return WT_I18N::translate('Fact 5');
         case '_FA6':
             return WT_I18N::translate('Fact 6');
         case '_FA7':
             return WT_I18N::translate('Fact 7');
         case '_FA8':
             return WT_I18N::translate('Fact 8');
         case '_FA9':
             return WT_I18N::translate('Fact 9');
         case '_FA10':
             return WT_I18N::translate('Fact 10');
         case '_FA11':
             return WT_I18N::translate('Fact 11');
         case '_FA12':
             return WT_I18N::translate('Fact 12');
         case '_FA13':
             return WT_I18N::translate('Fact 13');
         case '_FNRL':
             return WT_I18N::translate('Funeral');
         case '_FREL':
             return WT_I18N::translate('Relationship to father');
         case '_GEDF':
             return WT_I18N::translate('GEDCOM file');
         case '_GODP':
             return WT_I18N::translate('Godparent');
         case '_HAIR':
             return WT_I18N::translate('Hair color');
         case '_HEB':
             return WT_I18N::translate('Hebrew');
         case '_HEIG':
             return WT_I18N::translate('Height');
         case '_HNM':
             return WT_I18N::translate('Hebrew name');
         case '_HOL':
             return WT_I18N::translate('Holocaust');
         case '_INTE':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Interred');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Interred');
                 default:
                     return WT_I18N::translate('Interred');
             }
         case '_LOC':
             return WT_I18N::translate('Location');
         case '_MARI':
             return WT_I18N::translate('Marriage intention');
         case '_MARNM':
             return WT_I18N::translate('Married name');
         case '_PRIM':
             return WT_I18N::translate('Highlighted image');
         case '_MARNM_SURN':
             return WT_I18N::translate('Married surname');
         case '_MARR_CHIL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Marriage of a son');
                 case 'F':
                     return WT_I18N::translate('Marriage of a daughter');
                 default:
                     return WT_I18N::translate('Marriage of a child');
             }
         case '_MARR_FAMC':
             return WT_I18N::translate('Marriage of parents');
         case '_MARR_GCHI':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Marriage of a grandson');
                 case 'F':
                     return WT_I18N::translate('Marriage of a granddaughter');
                 default:
                     return WT_I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_GCH1':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('daughter’s son', 'Marriage of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('daughter’s daughter', 'Marriage of a granddaughter');
                 default:
                     return WT_I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_GCH2':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('son’s son', 'Marriage of a grandson');
                 case 'F':
                     return WT_I18N::translate_c('son’s daughter', 'Marriage of a granddaughter');
                 default:
                     return WT_I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_HSIB':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Marriage of a half-brother');
                 case 'F':
                     return WT_I18N::translate('Marriage of a half-sister');
                 default:
                     return WT_I18N::translate('Marriage of a half-sibling');
             }
         case '_MARR_PARE':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Marriage of a father');
                 case 'F':
                     return WT_I18N::translate('Marriage of a mother');
                 default:
                     return WT_I18N::translate('Marriage of a parent');
             }
         case '_MARR_SIBL':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate('Marriage of a brother');
                 case 'F':
                     return WT_I18N::translate('Marriage of a sister');
                 default:
                     return WT_I18N::translate('Marriage of a sibling');
             }
         case '_MBON':
             return WT_I18N::translate('Marriage bond');
         case '_MDCL':
             return WT_I18N::translate('Medical');
         case '_MEDC':
             return WT_I18N::translate('Medical condition');
         case '_MEND':
             return WT_I18N::translate('Marriage ending status');
         case '_MILI':
             return WT_I18N::translate('Military');
         case '_MILT':
             return WT_I18N::translate('Military service');
         case '_MREL':
             return WT_I18N::translate('Relationship to mother');
         case '_MSTAT':
             return WT_I18N::translate('Marriage beginning status');
         case '_NAME':
             return WT_I18N::translate('Mailing name');
         case '_NAMS':
             return WT_I18N::translate('Namesake');
         case '_NLIV':
             return WT_I18N::translate('Not living');
         case '_NMAR':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Never married');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Never married');
                 default:
                     return WT_I18N::translate('Never married');
             }
         case '_NMR':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Not married');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Not married');
                 default:
                     return WT_I18N::translate('Not married');
             }
         case '_WT_USER':
             return WT_I18N::translate('by');
         case '_PRMN':
             return WT_I18N::translate('Permanent number');
         case '_SCBK':
             return WT_I18N::translate('Scrapbook');
         case '_SEPR':
             return WT_I18N::translate('Separated');
         case '_SSHOW':
             return WT_I18N::translate('Slide show');
         case '_STAT':
             return WT_I18N::translate('Marriage status');
         case '_SUBQ':
             return WT_I18N::translate('Short version');
         case '_TODO':
             return WT_I18N::translate('Research task');
         case '_TYPE':
             return WT_I18N::translate('Media type');
         case '_UID':
             return WT_I18N::translate('Globally unique identifier');
         case '_URL':
             return WT_I18N::translate('URL');
         case '_WEIG':
             return WT_I18N::translate('Weight');
         case '_WITN':
             return WT_I18N::translate('Witness');
         case '_WT_OBJE_SORT':
             return WT_I18N::translate('Re-order media');
         case '_YART':
             return WT_I18N::translate('Yahrzeit');
             // Brit milah applies only to males, no need for male/female translations
         // Brit milah applies only to males, no need for male/female translations
         case '__BRTM_CHIL':
             return WT_I18N::translate('Brit milah of a son');
         case '__BRTM_GCHI':
             return WT_I18N::translate('Brit milah of a grandson');
         case '__BRTM_GCH1':
             return WT_I18N::translate_c('daughter’s son', 'Brit milah of a grandson');
         case '__BRTM_GCH2':
             return WT_I18N::translate_c('son’s son', 'Brit milah of a grandson');
         case '__BRTM_HSIB':
             return WT_I18N::translate('Brit milah of a half-brother');
         case '__BRTM_SIBL':
             return WT_I18N::translate('Brit milah of a brother');
             // These "pseudo" tags are generated internally to present information about a media object
         // These "pseudo" tags are generated internally to present information about a media object
         case '__FILE_SIZE__':
             return WT_I18N::translate('File size');
         case '__IMAGE_SIZE__':
             return WT_I18N::translate('Image dimensions');
         default:
             // If no specialisation exists (e.g. DEAT:CAUS), then look for the general (CAUS)
             if (strpos($tag, ':')) {
                 list(, $tag) = explode(':', $tag, 2);
                 return self::getLabel($tag, $record);
             }
             // Still no translation? Highlight this as an error
             return '<span class="error" title="' . WT_I18N::translate('Unrecognized GEDCOM code') . '">' . WT_Filter::escapeHtml($tag) . '</span>';
     }
 }
Exemplo n.º 13
0
 private function getParents($person)
 {
     global $SEARCH_SPIDER;
     $father = null;
     $mother = null;
     $html = sprintf(self::TTL, WT_I18N::translate('Parents'));
     $family = $person->getPrimaryChildFamily();
     if (!$SEARCH_SPIDER && $person->canShowName() && $family !== null) {
         $father = $family->getHusband($person);
         $mother = $family->getWife($person);
         $html .= $this->getHTML($father) . $this->getHTML($mother);
         // Can only have a step parent if one & only one parent found at this point
         if ($this->isPerson($father) xor $this->isPerson($mother)) {
             $stepParents = '';
             foreach ($person->getChildStepFamilies() as $family) {
                 if (!$this->isPerson($father)) {
                     $stepParents .= $this->getHTML($family->getHusband($person));
                 } else {
                     $stepParents .= $this->getHTML($family->getWife($person));
                 }
             }
             if ($stepParents) {
                 $relationship = $this->isPerson($father) ? WT_I18N::translate_c("father’s wife", "step-mother") : WT_I18N::translate_c("mother’s husband", "step-father");
                 $html .= sprintf(self::TTL, $relationship) . $stepParents;
             }
         }
     }
     if (!($this->isPerson($father) || $this->isPerson($mother))) {
         $html .= sprintf(self::MSG, WT_I18N::translate_c('unknown family', 'unknown'));
     }
     return $html;
 }
Exemplo n.º 14
0
 public static function getValue($type, $record = null)
 {
     if ($record instanceof WT_Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'attendant':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Attendant');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Attendant');
                 default:
                     return WT_I18N::translate('Attendant');
             }
         case 'attending':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Attending');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Attending');
                 default:
                     return WT_I18N::translate('Attending');
             }
         case 'best_man':
             // always male
             return WT_I18N::translate('Best man');
         case 'bridesmaid':
             // always female
             return WT_I18N::translate('Bridesmaid');
         case 'buyer':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Buyer');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Buyer');
                 default:
                     return WT_I18N::translate('Buyer');
             }
         case 'circumciser':
             // always male
             return WT_I18N::translate('Circumciser');
         case 'civil_registrar':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Civil registrar');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Civil registrar');
                 default:
                     return WT_I18N::translate('Civil registrar');
             }
         case 'employee':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Employee');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Employee');
                 default:
                     return WT_I18N::translate('Employee');
             }
         case 'employer':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Employer');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Employer');
                 default:
                     return WT_I18N::translate('Employer');
             }
         case 'foster_child':
             // no sex implied
             return WT_I18N::translate('Foster child');
         case 'foster_father':
             // always male
             return WT_I18N::translate('Foster father');
         case 'foster_mother':
             // always female
             return WT_I18N::translate('Foster mother');
         case 'friend':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Friend');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Friend');
                 default:
                     return WT_I18N::translate('Friend');
             }
         case 'godfather':
             // always male
             return WT_I18N::translate('Godfather');
         case 'godmother':
             // always female
             return WT_I18N::translate('Godmother');
         case 'godparent':
             // no sex implied
             return WT_I18N::translate('Godparent');
         case 'godson':
             // always male
             return WT_I18N::translate('Godson');
         case 'goddaughter':
             // always female
             return WT_I18N::translate('Goddaughter');
         case 'godchild':
             // no sex implied
             return WT_I18N::translate('Godchild');
         case 'guardian':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Guardian');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Guardian');
                 default:
                     return WT_I18N::translate('Guardian');
             }
         case 'informant':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Informant');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Informant');
                 default:
                     return WT_I18N::translate('Informant');
             }
         case 'lodger':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Lodger');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Lodger');
                 default:
                     return WT_I18N::translate('Lodger');
             }
         case 'nanny':
             // no sex implied
             return WT_I18N::translate('Nanny');
         case 'nurse':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Nurse');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Nurse');
                 default:
                     return WT_I18N::translate('Nurse');
             }
         case 'owner':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Owner');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Owner');
                 default:
                     return WT_I18N::translate('Owner');
             }
         case 'priest':
             // no sex implied
             return WT_I18N::translate('Priest');
         case 'rabbi':
             // always male
             return WT_I18N::translate('Rabbi');
         case 'registry_officer':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Registry officer');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Registry officer');
                 default:
                     return WT_I18N::translate('Registry officer');
             }
         case 'seller':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Seller');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Seller');
                 default:
                     return WT_I18N::translate('Seller');
             }
         case 'servant':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Servant');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Servant');
                 default:
                     return WT_I18N::translate('Servant');
             }
         case 'slave':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Slave');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Slave');
                 default:
                     return WT_I18N::translate('Slave');
             }
         case 'ward':
             switch ($sex) {
                 case 'M':
                     return WT_I18N::translate_c('MALE', 'Ward');
                 case 'F':
                     return WT_I18N::translate_c('FEMALE', 'Ward');
                 default:
                     return WT_I18N::translate('Ward');
             }
         case 'witness':
             // Do we need separate male/female translations for this?
             return WT_I18N::translate('Witness');
         default:
             return $type;
     }
 }
Exemplo n.º 15
0
 static function NUM_TO_SHORT_MONTH($n, $leap_year)
 {
     switch ($n) {
         case 1:
             return WT_I18N::translate_c('Abbreviation for January', 'Jan');
         case 2:
             return WT_I18N::translate_c('Abbreviation for February', 'Feb');
         case 3:
             return WT_I18N::translate_c('Abbreviation for March', 'Mar');
         case 4:
             return WT_I18N::translate_c('Abbreviation for April', 'Apr');
         case 5:
             return WT_I18N::translate_c('Abbreviation for May', 'May');
         case 6:
             return WT_I18N::translate_c('Abbreviation for June', 'Jun');
         case 7:
             return WT_I18N::translate_c('Abbreviation for July', 'Jul');
         case 8:
             return WT_I18N::translate_c('Abbreviation for August', 'Aug');
         case 9:
             return WT_I18N::translate_c('Abbreviation for September', 'Sep');
         case 10:
             return WT_I18N::translate_c('Abbreviation for October', 'Oct');
         case 11:
             return WT_I18N::translate_c('Abbreviation for November', 'Nov');
         case 12:
             return WT_I18N::translate_c('Abbreviation for December', 'Dec');
         default:
             return '';
     }
 }
Exemplo n.º 16
0
function calendar_list_text($list, $tag1, $tag2, $show_sex_symbols)
{
    global $males, $females;
    $html = '';
    foreach ($list as $id => $facts) {
        $tmp = WT_GedcomRecord::GetInstance($id);
        $html .= $tag1 . '<a href="' . $tmp->getHtmlUrl() . '">' . $tmp->getFullName() . '</a> ';
        if ($show_sex_symbols && $tmp instanceof WT_Individual) {
            switch ($tmp->getSex()) {
                case 'M':
                    $html .= '<i class="icon-sex_m_9x9" title="' . WT_I18N::translate('Male') . '"></i>';
                    ++$males;
                    break;
                case 'F':
                    $html .= '<i class="icon-sex_f_9x9" title="' . WT_I18N::translate('Female') . '"></i>';
                    ++$females;
                    break;
                default:
                    $html .= '<i class="icon-sex_u_9x9" title="' . WT_I18N::translate_c('unknown gender', 'Unknown') . '"></i>';
                    break;
            }
        }
        $html .= '<div class="indent">' . $facts . '</div>' . $tag2;
    }
    return $html;
}
Exemplo n.º 17
0
/**
 * javascript declaration for calendar popup
 */
function init_calendar_popup()
{
    global $WEEK_START, $controller;
    $controller->addInlineJavascript('
		cal_setMonthNames(
			"' . WT_I18N::translate_c('NOMINATIVE', 'January') . '",
			"' . WT_I18N::translate_c('NOMINATIVE', 'February') . '",
			"' . WT_I18N::translate_c('NOMINATIVE', 'March') . '",
			"' . WT_I18N::translate_c('NOMINATIVE', 'April') . '",
			"' . WT_I18N::translate_c('NOMINATIVE', 'May') . '",
			"' . WT_I18N::translate_c('NOMINATIVE', 'June') . '",
			"' . WT_I18N::translate_c('NOMINATIVE', 'July') . '",
			"' . WT_I18N::translate_c('NOMINATIVE', 'August') . '",
			"' . WT_I18N::translate_c('NOMINATIVE', 'September') . '",
			"' . WT_I18N::translate_c('NOMINATIVE', 'October') . '",
			"' . WT_I18N::translate_c('NOMINATIVE', 'November') . '",
			"' . WT_I18N::translate_c('NOMINATIVE', 'December') . '"
		)
		cal_setDayHeaders(
			"' . WT_I18N::translate('Sun') . '",
			"' . WT_I18N::translate('Mon') . '",
			"' . WT_I18N::translate('Tue') . '",
			"' . WT_I18N::translate('Wed') . '",
			"' . WT_I18N::translate('Thu') . '",
			"' . WT_I18N::translate('Fri') . '",
			"' . WT_I18N::translate('Sat') . '"
		)
		cal_setWeekStart(' . $WEEK_START . ');
	');
}
Exemplo n.º 18
0
     break;
 case 'SOUR_FACTS_QUICK':
     $title = WT_I18N::translate('Quick source facts');
     $text = WT_I18N::translate('This is the short list of GEDCOM source facts that appears next to the full list and can be added with a single click.');
     break;
 case 'SOUR_FACTS_UNIQUE':
     $title = WT_I18N::translate('Unique source facts');
     $text = WT_I18N::translate('This is the list of GEDCOM facts that your users can only add once to sources.  For example, if TITL is in this list, users will not be able to add more than one TITL record to a source.  Fact names that appear in this list must not also appear in the “All source facts” list.');
     break;
 case 'SUBLIST_TRIGGER_I':
     $title = WT_I18N::translate('Maximum number of surnames on individual list');
     $text = WT_I18N::translate('Long lists of individuals with the same surname can be broken into smaller sub-lists according to the first letter of the individual’s given name.<br><br>This option determines when sub-listing of surnames will occur.  To disable sub-listing completely, set this option to zero.');
     break;
 case 'SURNAME_TRADITION':
     $title = WT_I18N::translate('Surname tradition');
     $text = WT_I18N::translate('When you add a new family member, a default surname can be provided.  This surname will depend on the local tradition.') . '<br><br><dl><dt>' . WT_I18N::translate('patrilineal') . '</dt><dd>' . WT_I18N::translate('Children take their father’s surname.') . '</dd></dl><dl><dt>' . WT_I18N::translate('matrilineal') . '</dt><dd>' . WT_I18N::translate('Children take their mother’s surname.') . '</dd></dl><dl><dt>' . WT_I18N::translate_c('Surname tradition', 'paternal') . '</dt><dd>' . WT_I18N::translate('Children take their father’s surname.') . '<br>' . WT_I18N::translate('Wives take their husband’s surname.') . '</dd></dl><dl><dt>' . WT_I18N::translate_c('Surname tradition', 'Spanish') . '</dt><dd>' . WT_I18N::translate('Children take one surname from the father and one surname from the mother.') . '</dd></dl><dl><dt>' . WT_I18N::translate_c('Surname tradition', 'Portuguese') . '</dt><dd>' . WT_I18N::translate('Children take one surname from the mother and one surname from the father.') . '</dd></dl><dl><dt>' . WT_I18N::translate_c('Surname tradition', 'Icelandic') . '</dt><dd>' . WT_I18N::translate('Children take a patronym instead of a surname.') . '</dd></dl><dl><dt>' . WT_I18N::translate_c('Surname tradition', 'Polish') . '</dt><dd>' . WT_I18N::translate('Children take their father’s surname.') . '<br>' . WT_I18N::translate('Wives take their husband’s surname.') . '<br>' . WT_I18N::translate('Surnames are inflected to indicate an individual’s gender.') . '</dd></dl><dl><dt>' . WT_I18N::translate_c('Surname tradition', 'Lithuanian') . '</dt><dd>' . WT_I18N::translate('Children take their father’s surname.') . '<br>' . WT_I18N::translate('Wives take their husband’s surname.') . '<br>' . WT_I18N::translate('Surnames are inflected to indicate an individual’s gender and marital status.') . '</dd></dl>';
     break;
 case 'THEME':
     $title = WT_I18N::translate('Theme');
     $text = WT_I18N::translate('You can change the appearance of <b>webtrees</b> using “themes”.  Each theme has a different style, layout, color scheme, etc.') . '<br><br>' . WT_I18N::translate('Themes can be selected at three levels: user, GEDCOM, and site.  User settings take priority over GEDCOM settings, which in turn take priority over the site setting.  Selecting “default theme” at user level will give the setting for the current GEDCOM.  Selecting “default theme” at GEDCOM level will give the site setting.');
     break;
 case 'THUMBNAIL_WIDTH':
     $title = WT_I18N::translate('Width of generated thumbnails');
     $text = WT_I18N::translate('This is the width (in pixels) that the program will use when automatically generating thumbnails.  The default setting is 100.');
     break;
 case 'GEONAMES_ACCOUNT':
     $title = WT_I18N::translate('Use GeoNames database for autocomplete on places');
     $text = WT_I18N::translate('The website www.geonames.org provides a large database of place names.  This can be searched when entering new places.  To use this feature, you must register for a free account at www.geonames.org and provide the username.');
     break;
 case 'USE_REGISTRATION_MODULE':
     $title = WT_I18N::translate('Allow visitors to request account registration');
Exemplo n.º 19
0
        echo "</tr><tr>";
    }
    $i++;
    ?>
		<td class="person<?php 
    echo $col;
    ?>
" style="padding: 5px;">
		<?php 
    if ($indi && $indi->canShow()) {
        if ($indi->getSex() == "M") {
            echo $indi->getSexImage('large', '', WT_I18N::translate('Male'));
        } elseif ($indi->getSex() == "F") {
            echo $indi->getSexImage('large', '', WT_I18N::translate('Female'));
        } else {
            echo $indi->getSexImage('large', '', WT_I18N::translate_c('unknown gender', 'Unknown'));
        }
        ?>
			<a href="<?php 
        echo $indi->getHtmlUrl();
        ?>
">&nbsp;<?php 
        echo $indi->getFullName();
        ?>
<br>
			<?php 
        echo $indi->getAddName();
        ?>
<br>
			</a>
			<input type="hidden" name="pids[<?php 
Exemplo n.º 20
0
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if (!defined('WT_WEBTREES')) {
    header('HTTP/1.0 403 Forbidden');
    exit;
}
// Unknown surname
$UNKNOWN_NN = WT_I18N::translate_c('Unknown surname', '…');
// Unknown given name
$UNKNOWN_PN = WT_I18N::translate_c('Unknown given name', '…');
// NPFX tags - name prefixes
$NPFX_accept = array('Adm', 'Amb', 'Brig', 'Can', 'Capt', 'Chan', 'Chapln', 'Cmdr', 'Col', 'Cpl', 'Cpt', 'Dr', 'Gen', 'Gov', 'Hon', 'Lady', 'Lt', 'Mr', 'Mrs', 'Ms', 'Msgr', 'Pfc', 'Pres', 'Prof', 'Pvt', 'Rabbi', 'Rep', 'Rev', 'Sen', 'Sgt', 'Sir', 'Sr', 'Sra', 'Srta', 'Ven');
// SPFX tags - surname prefixes
$SPFX_accept = array('al', 'da', 'de', 'dem', 'den', 'der', 'di', 'du', 'el', 'la', 'van', 'von');
// NSFX tags - name suffixes
$NSFX_accept = array('I', 'II', 'III', 'IV', 'Jr', 'Junior', 'MD', 'PhD', 'Senior', 'Sr', 'V', 'VI');
// FILE:FORM tags - file formats
$FILE_FORM_accept = array('avi', 'bmp', 'gif', 'jpeg', 'mp3', 'ole', 'pcx', 'png', 'tiff', 'wav');
// Fact tags (as opposed to event tags), that don't normally have a value
$emptyfacts = array('ADOP', 'ANUL', 'BAPL', 'BAPM', 'BARM', 'BASM', 'BIRT', 'BLES', 'BURI', 'CENS', 'CHAN', 'CHR', 'CHRA', 'CONF', 'CONL', 'CREM', 'DATA', 'DEAT', 'DIV', 'DIVF', 'EMIG', 'ENDL', 'ENGA', 'FCOM', 'GRAD', 'HUSB', 'IMMI', 'MAP', 'MARB', 'MARC', 'MARL', 'MARR', 'MARS', 'NATU', 'ORDN', 'PROB', 'RESI', 'RETI', 'SLGC', 'SLGS', 'WIFE', 'WILL', '_HOL', '_NMR', '_NMAR', '_SEPR');
// Tags that don't require a PLAC subtag
$nonplacfacts = array('ENDL', 'NCHI', 'REFN', 'SLGC', 'SLGS');
// Tags that don't require a DATE subtag
$nondatefacts = array('ABBR', 'ADDR', 'AFN', 'AUTH', 'CHIL', 'EMAIL', 'FAX', 'FILE', 'HUSB', 'NAME', 'NCHI', 'NOTE', 'OBJE', 'PHON', 'PUBL', 'REFN', 'REPO', 'RESN', 'SEX', 'SOUR', 'SSN', 'TEXT', 'TITL', 'WIFE', 'WWW', '_EMAIL');
// Tags that require a TYPE subtag
Exemplo n.º 21
0
 /**
  * print information for a sex record
  *
  * @param WT_Fact $event the Event object
  */
 function print_sex_record(WT_Fact $event)
 {
     $sex = $event->getValue();
     if (empty($sex)) {
         $sex = 'U';
     }
     echo '<span id="sex" class="';
     if ($event->isOld()) {
         echo 'old ';
     }
     if ($event->isNew()) {
         echo 'new ';
     }
     switch ($sex) {
         case 'M':
             echo 'male_gender"';
             if ($event->canEdit()) {
                 echo ' title="', WT_I18N::translate('Male'), ' - ', WT_I18N::translate('Edit'), '"';
                 echo ' onclick="edit_record(\'' . $this->record->getXref() . '\', \'' . $event->getFactId() . '\'); return false;">';
             } else {
                 echo ' title="', WT_I18N::translate('Male'), '">';
             }
             break;
         case 'F':
             echo 'female_gender"';
             if ($event->canEdit()) {
                 echo ' title="', WT_I18N::translate('Female'), ' - ', WT_I18N::translate('Edit'), '"';
                 echo ' onclick="edit_record(\'' . $this->record->getXref() . '\', \'' . $event->getFactId() . '\'); return false;">';
             } else {
                 echo ' title="', WT_I18N::translate('Female'), '">';
             }
             break;
         case 'U':
             echo 'unknown_gender"';
             if ($event->canEdit()) {
                 echo ' title="', WT_I18N::translate_c('unknown gender', 'Unknown'), ' - ', WT_I18N::translate('Edit'), '"';
                 echo ' onclick="edit_record(\'' . $this->record->getXref() . '\', \'' . $event->getFactId() . '\'); return false;">';
             } else {
                 echo ' title="', WT_I18N::translate_c('unknown gender', 'Unknown'), '">';
             }
             break;
     }
     echo '</span>';
 }
Exemplo n.º 22
0
 public static function getValue($type, $record = null)
 {
     if ($record instanceof WT_Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'adopted':
             switch ($sex) {
                 case 'M':
                     /* I18N: The name given to a child by its adoptive parents */
                     return WT_I18N::translate_c('MALE', 'adopted name');
                 case 'F':
                     /* I18N: The name given to a child by its adoptive parents */
                     return WT_I18N::translate_c('FEMALE', 'adopted name');
                 default:
                     /* I18N: The name given to a child by its adoptive parents */
                     return WT_I18N::translate('adopted name');
             }
         case 'aka':
             switch ($sex) {
                 case 'M':
                     /* I18N: The name by which an individual is also known.  e.g. a professional name or a stage name */
                     return WT_I18N::translate_c('MALE', 'also known as');
                 case 'F':
                     /* I18N: The name by which an individual is also known.  e.g. a professional name or a stage name */
                     return WT_I18N::translate_c('FEMALE', 'also known as');
                 default:
                     /* I18N: The name by which an individual is also known.  e.g. a professional name or a stage name */
                     return WT_I18N::translate('also known as');
             }
         case 'birth':
             switch ($sex) {
                 case 'M':
                     /* I18N: The name given to an individual at their birth */
                     return WT_I18N::translate_c('MALE', 'birth name');
                 case 'F':
                     /* I18N: The name given to an individual at their birth */
                     return WT_I18N::translate_c('FEMALE', 'birth name');
                 default:
                     /* I18N: The name given to an individual at their birth */
                     return WT_I18N::translate('birth name');
             }
         case 'change':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name chosen by an individual, to replace their existing name (whether legal or otherwise) */
                     return WT_I18N::translate_c('MALE', 'change of name');
                 case 'F':
                     /* I18N: A name chosen by an individual, to replace their existing name (whether legal or otherwise) */
                     return WT_I18N::translate_c('FEMALE', 'change of name');
                 default:
                     /* I18N: A name chosen by an individual, to replace their existing name (whether legal or otherwise) */
                     return WT_I18N::translate('change of name');
             }
         case 'estate':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name given to an individual, from the farm or estate on which they lived or worked */
                     return WT_I18N::translate_c('MALE', 'estate name');
                 case 'F':
                     /* I18N: A name given to an individual, from the farm or estate on which they lived or worked */
                     return WT_I18N::translate_c('FEMALE', 'estate name');
                 default:
                     /* I18N: A name given to an individual, from the farm or estate on which they lived or worked */
                     return WT_I18N::translate('estate name');
             }
         case 'immigrant':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name taken on immigration - e.g. migrants to the USA frequently anglicized their names */
                     return WT_I18N::translate_c('MALE', 'immigration name');
                 case 'F':
                     /* I18N: A name taken on immigration - e.g. migrants to the USA frequently anglicized their names */
                     return WT_I18N::translate_c('FEMALE', 'immigration name');
                 default:
                     /* I18N: A name taken on immigration - e.g. migrants to the USA frequently anglicized their names */
                     return WT_I18N::translate('immigration name');
             }
         case 'maiden':
             // Only women have “maiden” names!
             return WT_I18N::translate('maiden name');
         case 'married':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name taken on marriage - usually the wife takes the husband’s surname */
                     return WT_I18N::translate_c('MALE', 'married name');
                 case 'F':
                     /* I18N: A name taken on marriage - usually the wife takes the husband’s surname */
                     return WT_I18N::translate_c('FEMALE', 'married name');
                 default:
                     /* I18N: A name taken on marriage - usually the wife takes the husband’s surname */
                     return WT_I18N::translate('married name');
             }
         case 'religious':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name taken when entering a religion or a religious order */
                     return WT_I18N::translate_c('MALE', 'religious name');
                 case 'F':
                     /* I18N: A name taken when entering a religion or a religious order */
                     return WT_I18N::translate_c('FEMALE', 'religious name');
                 default:
                     /* I18N: A name taken when entering a religion or a religious order */
                     return WT_I18N::translate('religious name');
             }
         default:
             return $type;
     }
 }
Exemplo n.º 23
0
 static function monthNameInstrumentalCase($n, $leap_year)
 {
     switch ($n) {
         case 1:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Vendémiaire');
         case 2:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Brumaire');
         case 3:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Frimaire');
         case 4:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Nivôse');
         case 5:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Pluviôse');
         case 6:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Ventôse');
         case 7:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Germinal');
         case 8:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Floréal');
         case 9:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Prairial');
         case 10:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Messidor');
         case 11:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Thermidor');
         case 12:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Fructidor');
         case 13:
             return WT_I18N::translate_c('INSTRUMENTAL', 'jours complémentaires');
     }
 }
Exemplo n.º 24
0
 static function monthNameInstrumentalCase($n, $leap_year)
 {
     switch ($n) {
         case 1:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Muharram');
         case 2:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Safar');
         case 3:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Rabi’ al-awwal');
         case 4:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Rabi’ al-thani');
         case 5:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Jumada al-awwal');
         case 6:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Jumada al-thani');
         case 7:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Rajab');
         case 8:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Sha’aban');
         case 9:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Ramadan');
         case 10:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Shawwal');
         case 11:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Dhu al-Qi’dah');
         case 12:
             return WT_I18N::translate_c('INSTRUMENTAL', 'Dhu al-Hijjah');
         default:
             return '';
     }
 }
Exemplo n.º 25
-1
/**
 * print the information for an individual chart box
 *
 * find and print a given individuals information for a pedigree chart
 *
 * @param string $pid The Gedcom Xref ID of the individual  to print
 * @param string $currpid
 * @param string $censyear
 *
 */
function print_pedigree_person_nav2($pid, $currpid, $censyear)
{
    global $PEDIGREE_FULL_DETAILS;
    global $TEXT_DIRECTION, $DEFAULT_PEDIGREE_GENERATIONS, $OLD_PGENS, $talloffset, $PEDIGREE_LAYOUT;
    global $show_full;
    global $SEARCH_SPIDER;
    global $spouselinks, $parentlinks, $step_parentlinks, $persons, $person_step, $person_parent;
    global $natdad, $natmom, $censyear;
    if (empty($show_full)) {
        $show_full = 0;
    }
    if (empty($PEDIGREE_FULL_DETAILS)) {
        $PEDIGREE_FULL_DETAILS = 0;
    }
    if (!isset($OLD_PGENS)) {
        $OLD_PGENS = $DEFAULT_PEDIGREE_GENERATIONS;
    }
    if (!isset($talloffset)) {
        $talloffset = $PEDIGREE_LAYOUT;
    }
    $person = WT_Individual::getInstance($pid);
    if ($pid == false || empty($person)) {
        $spouselinks = false;
        $parentlinks = false;
        $step_parentlinks = false;
    }
    $tmp = array('M' => '', 'F' => 'F', 'U' => 'NN');
    $isF = $tmp[$person->getSex()];
    $spouselinks = "";
    $parentlinks = "";
    $step_parentlinks = "";
    if ($person->canShowName() && !$SEARCH_SPIDER) {
        //-- draw a box for the family popup
        if ($TEXT_DIRECTION == "rtl") {
            $spouselinks .= "<table class=\"rtlnav person_box{$isF}\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2 nowrap\">";
            $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" . $person->getFullName() . ")<br>";
            $parentlinks .= "<table class=\"rtlnav person_box{$isF}\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2 nowrap\">";
            $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" . $person->getFullName() . ")<br>";
            $step_parentlinks .= "<table class=\"rtlnav person_box{$isF}\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2 nowrap\">";
            $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" . $person->getFullName() . ")<br>";
        } else {
            $spouselinks .= "<table class=\"ltrnav person_box{$isF}\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2 nowrap\">";
            $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" . $person->getFullName() . ")<br>";
            $parentlinks .= "<table class=\"ltrnav person_box{$isF}\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2 nowrap\">";
            $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" . $person->getFullName() . ")<br>";
            $step_parentlinks .= "<table class=\"ltrnav person_box{$isF}\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2 nowrap\">";
            $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" . $person->getFullName() . ")<br>";
        }
        $persons = "";
        $person_parent = "";
        $person_step = "";
        //-- Parent families --------------------------------------
        foreach ($person->getChildFamilies() as $family) {
            $husb = $family->getHusband();
            $wife = $family->getWife();
            $children = $family->getChildren();
            $num = count($children);
            $marrdate = $family->getMarriageDate();
            //-- Get Parent Children’s Name, DOB, DOD --------------------------
            if (isset($children)) {
                $chBLDarray = array();
                foreach ($children as $child) {
                    $chnam = $child->getAllNames();
                    $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname'];
                    $chfulln = str_replace('"', "", $chfulln);
                    // Must remove quotes completely here
                    $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln);
                    $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln);
                    // Child’s Full Name
                    $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2;
                    // Child’s Date of Birth (Julian)
                    $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2;
                    // Child’s Date of Death (Julian)
                    $chBLD = $chfulln . ", " . $chdob . ", " . $chdod;
                    array_push($chBLDarray, $chBLD);
                }
            }
            //-- Parent Husband ------------------------------
            if ($husb || $num > 0) {
                if ($husb) {
                    //-- Parent Husbands Parents ----------------------
                    $gparent = WT_Individual::getInstance($husb->getXref());
                    $parfams = $gparent->getChildFamilies();
                    foreach ($parfams as $pfamily) {
                        $phusb = $pfamily->getHusband();
                        $pwife = $pfamily->getWife();
                        if ($phusb) {
                            $pHusbFBP = $phusb->getBirthPlace();
                        }
                        if ($pwife) {
                            $pHusbMBP = $pwife->getBirthPlace();
                        }
                    }
                    //-- Parent Husbands Details ----------------------
                    $person_parent = "Yes";
                    if ($husb->canShowName()) {
                        $nam = $husb->getAllNames();
                        $fulln = rtrim($nam[0]['givn'], '*') . "&nbsp;" . $nam[0]['surname'];
                        $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                        $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                        for ($i = 0; $i < count($nam); $i++) {
                            if ($nam[$i]['type'] == '_MARNM') {
                                $fulmn = rtrim($nam[$i]['givn'], '*') . "&nbsp;" . $nam[$i]['surname'];
                            }
                        }
                        $parentlinks .= "<a class=\"linka\" href=\"#\" onclick=\"insertRowToTable(";
                        $parentlinks .= "'" . $husb->getXref() . "',";
                        // pid = PID
                        $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                        // nam = Name
                        if (isset($fulmn)) {
                            $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                            // mnam = Full Married Name
                        } else {
                            $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                            // mnam = Full Name
                        }
                        if ($currpid == "Wife" || $currpid == "Husband") {
                            $parentlinks .= "'Father in Law',";
                            // label = 1st Gen Male Relationship
                        } else {
                            $parentlinks .= "'Grand-Father',";
                            // label = 2st Gen Male Relationship
                        }
                        $parentlinks .= "'" . $husb->getSex() . "',";
                        // sex = Gender
                        $parentlinks .= "''" . ",";
                        // cond = Condition (Married etc)
                        if ($marrdate) {
                            $parentlinks .= "'" . ($marrdate->minJD() + $marrdate->maxJD()) / 2 . "',";
                            // dom = Date of Marriage (Julian)
                        }
                        $parentlinks .= "'" . ($husb->getBirthDate()->minJD() + $husb->getBirthDate()->maxJD()) / 2 . "',";
                        // dob = Date of Birth
                        if ($husb->getbirthyear() >= 1) {
                            $parentlinks .= "'" . ($censyear - $husb->getbirthyear()) . "',";
                            // age =  Census Year - Year of Birth
                        } else {
                            $parentlinks .= "''" . ",";
                            // age =  Undefined
                        }
                        $parentlinks .= "'" . ($husb->getDeathDate()->minJD() + $husb->getDeathDate()->maxJD()) / 2 . "',";
                        // dod = Date of Death
                        $parentlinks .= "''" . ",";
                        // occu  = Occupation
                        $parentlinks .= "'" . WT_Filter::escapeHtml($husb->getBirthPlace()) . "'" . ",";
                        // birthpl = Individuals Birthplace
                        if (isset($pHusbFBP)) {
                            $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbFBP) . "'" . ",";
                            // fbirthpl = Fathers Birthplace
                        } else {
                            $parentlinks .= "'UNK, UNK, UNK, UNK'" . ",";
                            // fbirthpl = Fathers Birthplace
                        }
                        if (isset($pHusbMBP)) {
                            $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbMBP) . "'" . ",";
                            // mbirthpl = Mothers Birthplace
                        } else {
                            $parentlinks .= "'UNK, UNK, UNK, UNK'" . ",";
                            // mbirthpl = Mothers Birthplace
                        }
                        if (isset($chBLDarray) && $husb->getSex() == "F") {
                            $chBLDarray = implode("::", $chBLDarray);
                            $parentlinks .= "'" . $chBLDarray . "'";
                            // Array of Children (name, birthdate, deathdate)
                        } else {
                            $parentlinks .= "''";
                        }
                        $parentlinks .= ");\">";
                        $parentlinks .= $husb->getFullName();
                        // Full Name (Link)
                        $parentlinks .= "</a>";
                    } else {
                        $parentlinks .= WT_I18N::translate('Private');
                    }
                    $natdad = "yes";
                }
            }
            //-- Parent Wife ------------------------------
            if ($wife || $num > 0) {
                if ($wife) {
                    //-- Parent Wifes Parents ----------------------
                    $gparent = WT_Individual::getInstance($wife->getXref());
                    $parfams = $gparent->getChildFamilies();
                    foreach ($parfams as $pfamily) {
                        $pwhusb = $pfamily->getHusband();
                        $pwwife = $pfamily->getWife();
                        if ($pwhusb) {
                            $pWifeFBP = $pwhusb->getBirthPlace();
                        }
                        if ($pwwife) {
                            $pWifeMBP = $pwwife->getBirthPlace();
                        }
                    }
                    //-- Parent Wifes Details ----------------------
                    $person_parent = "Yes";
                    if ($wife->canShowName()) {
                        $nam = $wife->getAllNames();
                        $fulln = rtrim($nam[0]['givn'], '*') . "&nbsp;" . $nam[0]['surname'];
                        $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                        $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                        $husbnam = null;
                        for ($i = 0; $i < count($nam); $i++) {
                            if ($nam[$i]['type'] == '_MARNM') {
                                $fulmn = rtrim($nam[$i]['givn'], '*') . "&nbsp;" . $nam[$i]['surname'];
                            }
                        }
                        $parentlinks .= "<a class=\"linka\" href=\"#\" onclick=\"insertRowToTable(";
                        $parentlinks .= "'" . $wife->getXref() . "',";
                        // pid = PID
                        $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                        // nam = Name
                        if (isset($fulmn)) {
                            $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulmn)) . "',";
                            // mnam = Full Married Name
                        } else {
                            $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                            // mnam = Full Name
                        }
                        if ($currpid == "Wife" || $currpid == "Husband") {
                            $parentlinks .= "'Mother in Law',";
                            // label = 1st Gen Female Relationship
                        } else {
                            $parentlinks .= "'Grand-Mother',";
                            // label = 2st Gen Female Relationship
                        }
                        $parentlinks .= "'" . $wife->getSex() . "',";
                        // sex = Gender
                        $parentlinks .= "''" . ",";
                        // cond = Condition (Married etc)
                        if ($marrdate) {
                            $parentlinks .= "'" . ($marrdate->minJD() + $marrdate->maxJD()) / 2 . "',";
                            // dom = Date of Marriage (Julian)
                        }
                        $parentlinks .= "'" . ($wife->getBirthDate()->minJD() + $wife->getBirthDate()->maxJD()) / 2 . "',";
                        // dob = Date of Birth
                        if ($wife->getbirthyear() >= 1) {
                            $parentlinks .= "'" . ($censyear - $wife->getbirthyear()) . "',";
                            // age =  Census Year - Year of Birth
                        } else {
                            $parentlinks .= "''" . ",";
                            // age =  Undefined
                        }
                        $parentlinks .= "'" . ($wife->getDeathDate()->minJD() + $wife->getDeathDate()->maxJD()) / 2 . "',";
                        // dod = Date of Death
                        $parentlinks .= "''" . ",";
                        // occu  = Occupation
                        $parentlinks .= "'" . WT_Filter::escapeHtml($wife->getBirthPlace()) . "'" . ",";
                        // birthpl = Individuals Birthplace
                        if (isset($pWifeFBP)) {
                            $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeFBP) . "'" . ",";
                            // fbirthpl = Fathers Birthplace
                        } else {
                            $parentlinks .= "'UNK, UNK, UNK, UNK'" . ",";
                            // fbirthpl = Fathers Birthplace Not Known
                        }
                        if (isset($pWifeMBP)) {
                            $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeMBP) . "'" . ",";
                            // mbirthpl = Mothers Birthplace
                        } else {
                            $parentlinks .= "'UNK, UNK, UNK, UNK'" . ",";
                            // mbirthpl = Mothers Birthplace Not Known
                        }
                        if (isset($chBLDarray) && $wife->getSex() == "F") {
                            $chBLDarray = implode("::", $chBLDarray);
                            $parentlinks .= "'" . $chBLDarray . "'";
                            // Array of Children (name, birthdate, deathdate)
                        } else {
                            $parentlinks .= "''";
                        }
                        $parentlinks .= ");\">";
                        $parentlinks .= $wife->getFullName();
                        // Full Name (Link)
                        $parentlinks .= "</a>";
                    } else {
                        $parentlinks .= WT_I18N::translate('Private');
                    }
                    $natmom = "yes";
                }
            }
        }
        //-- Step families -----------------------------------------
        foreach ($person->getChildStepFamilies() as $family) {
            $husb = $family->getHusband();
            $wife = $family->getWife();
            $children = $family->getChildren();
            $num = count($children);
            $marrdate = $family->getMarriageDate();
            //-- Get StepParent’s Children’s Name, DOB, DOD --------------------------
            if (isset($children)) {
                $chBLDarray = array();
                foreach ($children as $child) {
                    $chnam = $child->getAllNames();
                    $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname'];
                    $chfulln = str_replace('"', "", $chfulln);
                    // Must remove quotes completely here
                    $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln);
                    $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln);
                    // Child’s Full Name
                    $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2;
                    // Child’s Date of Birth (Julian)
                    $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2;
                    // Child’s Date of Death (Julian)
                    $chBLD = $chfulln . ", " . $chdob . ", " . $chdod;
                    array_push($chBLDarray, $chBLD);
                }
            }
            //-- Step Husband --------------------------------------
            if ($natdad == "yes") {
            } else {
                if (($husb || $num > 0) && $husb !== $person) {
                    if ($husb) {
                        //-- Step Husbands Parents -----------------------------
                        $gparent = WT_Individual::getInstance($husb->getXref());
                        $parfams = $gparent->getChildFamilies();
                        foreach ($parfams as $pfamily) {
                            $phusb = $pfamily->getHusband();
                            $pwife = $pfamily->getWife();
                            if ($phusb) {
                                $pHusbFBP = $phusb->getBirthPlace();
                            }
                            if ($pwife) {
                                $pHusbMBP = $pwife->getBirthPlace();
                            }
                        }
                        //-- Step Husband Details ------------------------------
                        $person_step = "Yes";
                        if ($husb->canShowName()) {
                            $nam = $husb->getAllNames();
                            $fulln = rtrim($nam[0]['givn'], '*') . "&nbsp;" . $nam[0]['surname'];
                            $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                            $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                            for ($i = 0; $i < count($nam); $i++) {
                                if ($nam[$i]['type'] == '_MARNM') {
                                    $fulmn = rtrim($nam[$i]['givn'], '*') . "&nbsp;" . $nam[$i]['surname'];
                                }
                            }
                            $parentlinks .= "<a class=\"linka\" href=\"#\" onclick=\"insertRowToTable(";
                            $parentlinks .= "'" . $husb->getXref() . "',";
                            // pid = PID
                            $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                            // nam = Name
                            if (isset($fulmn)) {
                                $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                                // mnam = Full Married Name
                            } else {
                                $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                                // mnam = Full Name
                            }
                            if ($currpid == "Wife" || $currpid == "Husband") {
                                $parentlinks .= "'Step Father-in-Law',";
                                // label = 1st Gen Male Relationship
                            } else {
                                $parentlinks .= "'Step Grand-Father',";
                                // label = 2st Gen Male Relationship
                            }
                            $parentlinks .= "'" . $husb->getSex() . "',";
                            // sex = Gender
                            $parentlinks .= "''" . ",";
                            // cond = Condition (Married etc)
                            if ($marrdate) {
                                $parentlinks .= "'" . ($marrdate->minJD() + $marrdate->maxJD()) / 2 . "',";
                                // dom = Date of Marriage (Julian)
                            }
                            $parentlinks .= "'" . ($husb->getBirthDate()->minJD() + $husb->getBirthDate()->maxJD()) / 2 . "',";
                            // dob = Date of Birth
                            if ($husb->getbirthyear() >= 1) {
                                $parentlinks .= "'" . ($censyear - $husb->getbirthyear()) . "',";
                                // age =  Census Year - Year of Birth
                            } else {
                                $parentlinks .= "''" . ",";
                                // age =  Undefined
                            }
                            $parentlinks .= "'" . ($husb->getDeathDate()->minJD() + $husb->getDeathDate()->maxJD()) / 2 . "',";
                            // dod = Date of Death
                            $parentlinks .= "''" . ",";
                            // occu  = Occupation
                            $parentlinks .= "'" . WT_Filter::escapeHtml($husb->getBirthPlace()) . "'" . ",";
                            // birthpl = Individuals Birthplace
                            if (isset($pHusbFBP)) {
                                $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbFBP) . "'" . ",";
                                // fbirthpl = Fathers Birthplace
                            } else {
                                $parentlinks .= "'UNK, UNK, UNK, UNK'" . ",";
                                // fbirthpl = Fathers Birthplace
                            }
                            if (isset($pHusbMBP)) {
                                $parentlinks .= "'" . WT_Filter::escapeHtml($pHusbMBP) . "'" . ",";
                                // mbirthpl = Mothers Birthplace
                            } else {
                                $parentlinks .= "'UNK, UNK, UNK, UNK'" . ",";
                                // mbirthpl = Mothers Birthplace
                            }
                            if (isset($chBLDarray) && $husb->getSex() == "F") {
                                $chBLDarray = implode("::", $chBLDarray);
                                $parentlinks .= "'" . $chBLDarray . "'";
                                // Array of Children (name, birthdate, deathdate)
                            } else {
                                $parentlinks .= "''";
                            }
                            $parentlinks .= ");\">";
                            $parentlinks .= $husb->getFullName();
                            // Full Name (Link)
                            $parentlinks .= "</a>";
                        } else {
                            $parentlinks .= WT_I18N::translate('Private');
                        }
                    }
                }
            }
            //-- Step Wife ----------------------------------------
            if ($natmom == "yes") {
            } else {
                if ($wife || $num > 0) {
                    if ($wife) {
                        //-- Step Wifes Parents ---------------------------
                        $gparent = WT_Individual::getInstance($wife->getXref());
                        $parfams = $gparent->getChildFamilies();
                        foreach ($parfams as $pfamily) {
                            $pwhusb = $pfamily->getHusband();
                            $pwwife = $pfamily->getWife();
                            if ($pwhusb) {
                                $pWifeFBP = $pwhusb->getBirthPlace();
                            }
                            if ($pwwife) {
                                $pWifeMBP = $pwwife->getBirthPlace();
                            }
                        }
                        //-- Step Wife Details ------------------------------
                        $person_step = "Yes";
                        if ($wife->canShowName()) {
                            $nam = $wife->getAllNames();
                            $fulln = rtrim($nam[0]['givn'], '*') . "&nbsp;" . $nam[0]['surname'];
                            $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                            $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                            $husbnam = null;
                            for ($i = 0; $i < count($nam); $i++) {
                                if ($nam[$i]['type'] == '_MARNM') {
                                    $fulmn = rtrim($nam[$i]['givn'], '*') . "&nbsp;" . $nam[$i]['surname'];
                                }
                            }
                            $parentlinks .= "<a class=\"linka\" href=\"#\" onclick=\"insertRowToTable(";
                            $parentlinks .= "'" . $wife->getXref() . "',";
                            // pid = PID
                            $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                            // nam = Name
                            if (isset($fulmn)) {
                                $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulmn)) . "',";
                                // mnam = Full Married Name
                            } else {
                                $parentlinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                                // mnam = Full Name
                            }
                            if ($currpid == "Wife" || $currpid == "Husband") {
                                $parentlinks .= "'Step Mother-in-Law',";
                                // label = 1st Gen Female Relationship
                            } else {
                                $parentlinks .= "'Step Grand-Mother',";
                                // label = 2st Gen Female Relationship
                            }
                            $parentlinks .= "'" . $wife->getSex() . "',";
                            // sex = Gender
                            $parentlinks .= "''" . ",";
                            // cond = Condition (Married etc)
                            if ($marrdate) {
                                $parentlinks .= "'" . ($marrdate->minJD() + $marrdate->maxJD()) / 2 . "',";
                                // dom = Date of Marriage (Julian)
                            }
                            $parentlinks .= "'" . ($wife->getBirthDate()->minJD() + $wife->getBirthDate()->maxJD()) / 2 . "',";
                            // dob = Date of Birth
                            if ($wife->getbirthyear() >= 1) {
                                $parentlinks .= "'" . ($censyear - $wife->getbirthyear()) . "',";
                                // age =  Census Year - Year of Birth
                            } else {
                                $parentlinks .= "''" . ",";
                                // age =  Undefined
                            }
                            $parentlinks .= "'" . ($wife->getDeathDate()->minJD() + $wife->getDeathDate()->maxJD()) / 2 . "',";
                            // dod = Date of Death
                            $parentlinks .= "''" . ",";
                            // occu  = Occupation
                            $parentlinks .= "'" . WT_Filter::escapeHtml($wife->getBirthPlace()) . "'" . ",";
                            // birthpl = Individuals Birthplace
                            if (isset($pWifeFBP)) {
                                $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeFBP) . "'" . ",";
                                // fbirthpl = Fathers Birthplace
                            } else {
                                $parentlinks .= "'UNK, UNK, UNK, UNK'" . ",";
                                // fbirthpl = Fathers Birthplace Not Known
                            }
                            if (isset($pWifeMBP)) {
                                $parentlinks .= "'" . WT_Filter::escapeHtml($pWifeMBP) . "'" . ",";
                                // mbirthpl = Mothers Birthplace
                            } else {
                                $parentlinks .= "'UNK, UNK, UNK, UNK'" . ",";
                                // mbirthpl = Mothers Birthplace Not Known
                            }
                            if (isset($chBLDarray) && $wife->getSex() == "F") {
                                $chBLDarray = implode("::", $chBLDarray);
                                $parentlinks .= "'" . $chBLDarray . "'";
                                // Array of Children (name, birthdate, deathdate)
                            } else {
                                $parentlinks .= "''";
                            }
                            $parentlinks .= ");\">";
                            $parentlinks .= $wife->getFullName();
                            // Full Name (Link)
                            $parentlinks .= "</a>";
                        } else {
                            $parentlinks .= WT_I18N::translate('Private');
                        }
                    }
                }
            }
        }
        // Spouse Families ------------------------------------------
        foreach ($person->getSpouseFamilies() as $family) {
            $spouse = $family->getSpouse($person);
            $children = $family->getChildren();
            $num = count($children);
            $marrdate = $family->getMarriageDate();
            $is_wife = $family->getWife();
            //-- Get Spouse’s Children’s Name, DOB, DOD --------------------------
            if (isset($children)) {
                $chBLDarray = array();
                foreach ($children as $child) {
                    $chnam = $child->getAllNames();
                    $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname'];
                    $chfulln = str_replace('"', "", $chfulln);
                    // Must remove quotes completely here
                    $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln);
                    $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln);
                    // Child’s Full Name
                    $chdob = ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2;
                    // Child’s Date of Birth (Julian)
                    $chdod = ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2;
                    // Child’s Date of Death (Julian)
                    $chBLD = $chfulln . ", " . $chdob . ", " . $chdod;
                    array_push($chBLDarray, $chBLD);
                }
            }
            //-- Spouse -----------------------------------------
            if ($spouse || $num > 0) {
                if ($spouse) {
                    //-- Spouse Parents -----------------------------
                    $gparent = WT_Individual::getInstance($spouse->getXref());
                    $spousefams = $gparent->getChildFamilies();
                    foreach ($spousefams as $pfamily) {
                        $phusb = $pfamily->getHusband();
                        $pwife = $pfamily->getWife();
                        if ($phusb) {
                            $pSpouseFBP = $phusb->getBirthPlace();
                        }
                        if ($pwife) {
                            $pSpouseMBP = $pwife->getBirthPlace();
                        }
                    }
                    //-- Spouse Details -----------------------------
                    if ($spouse->canShowName()) {
                        $nam = $spouse->getAllNames();
                        $fulln = rtrim($nam[0]['givn'], '*') . "&nbsp;" . $nam[0]['surname'];
                        $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                        $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                        // If spouse is a wife, then get her married name or default to her birth name
                        for ($i = 0; $i < count($nam); $i++) {
                            if ($nam[$i]['type'] == '_MARNM' && $is_wife) {
                                $fulmn = rtrim($nam[$i]['givn'], '*') . "&nbsp;" . $nam[$i]['surname'];
                            } else {
                                $fulmn = $fulln;
                            }
                        }
                        $spouselinks .= "<a href=\"#\" onclick=\"insertRowToTable(";
                        $spouselinks .= "'" . $spouse->getXref() . "',";
                        // pid = PID
                        $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                        // nam = Name
                        if (isset($fulmn)) {
                            $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulmn)) . "',";
                            // mnam = Full Married Name
                        } else {
                            $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                            // mnam = Full Name
                        }
                        if ($currpid == "Son" || $currpid == "Daughter") {
                            if ($spouse->getSex() == "M") {
                                $spouselinks .= "'Son in Law',";
                                // label = Male Relationship
                            } else {
                                $spouselinks .= "'Daughter in Law',";
                                // label = Female Relationship
                            }
                        } else {
                            if ($spouse->getSex() == "M") {
                                $spouselinks .= "'Brother in Law',";
                                // label = Male Relationship
                            } else {
                                $spouselinks .= "'Sister in Law',";
                                // label = Female Relationship
                            }
                        }
                        $spouselinks .= "'" . $spouse->getSex() . "',";
                        // sex = Gender
                        $spouselinks .= "''" . ",";
                        // cond = Condition (Married etc)
                        if ($marrdate) {
                            $spouselinks .= "'" . ($marrdate->minJD() + $marrdate->maxJD()) / 2 . "',";
                            // dom = Date of Marriage (Julian)
                        }
                        $spouselinks .= "'" . ($spouse->getBirthDate()->minJD() + $spouse->getBirthDate()->maxJD()) / 2 . "',";
                        // dob = Date of Birth
                        if ($spouse->getbirthyear() >= 1) {
                            $spouselinks .= "'" . ($censyear - $spouse->getbirthyear()) . "',";
                            // age =  Census Year - Year of Birth
                        } else {
                            $spouselinks .= "''" . ",";
                            // age =  Undefined
                        }
                        $spouselinks .= "'" . ($spouse->getDeathDate()->minJD() + $spouse->getDeathDate()->maxJD()) / 2 . "',";
                        // dod = Date of Death
                        $spouselinks .= "''" . ",";
                        // occu  = Occupation
                        $spouselinks .= "'" . WT_Filter::escapeHtml($spouse->getBirthPlace()) . "'" . ",";
                        // birthpl = Individuals Birthplace
                        if (isset($pSpouseFBP)) {
                            $spouselinks .= "'" . WT_Filter::escapeHtml($pSpouseFBP) . "'" . ",";
                            // fbirthpl = Fathers Birthplace
                        } else {
                            $spouselinks .= "'UNK, UNK, UNK, UNK'" . ",";
                            // fbirthpl = Fathers Birthplace Not Known
                        }
                        if (isset($pSpouseMBP)) {
                            $spouselinks .= "'" . WT_Filter::escapeHtml($pSpouseMBP) . "'" . ",";
                            // mbirthpl = Mothers Birthplace
                        } else {
                            $spouselinks .= "'UNK, UNK, UNK, UNK'" . ",";
                            // mbirthpl = Mothers Birthplace Not Known
                        }
                        if (isset($chBLDarray) && $spouse->getSex() == "F") {
                            $chBLDarray = implode("::", $chBLDarray);
                            $spouselinks .= "'" . $chBLDarray . "'";
                            // Array of Children (name, birthdate, deathdate)
                        } else {
                            $spouselinks .= "''";
                        }
                        $spouselinks .= ");\">";
                        $spouselinks .= $spouse->getFullName();
                        // Full Name (Link)
                        $spouselinks .= "</a>";
                    } else {
                        $spouselinks .= WT_I18N::translate('Private');
                    }
                    $spouselinks .= "</a>";
                    if ($spouse->getFullName() != "") {
                        $persons = "Yes";
                    }
                }
            }
            // Children -------------------------------------
            $spouselinks .= "<ul class=\"clist\">";
            foreach ($children as $child) {
                if ($child) {
                    $persons = "Yes";
                    //-- Childs Parents ---------------------
                    $gparent = WT_Individual::getInstance($child->getXref());
                    foreach ($gparent->getChildFamilies() as $family) {
                        $husb = $family->getHusband();
                        $wife = $family->getWife();
                        if ($husb) {
                            $ChildFBP = $husb->getBirthPlace();
                        }
                        if ($wife) {
                            $ChildMBP = $wife->getBirthPlace();
                        }
                    }
                    // Get Child’s Children
                    $chBLDarray = array();
                    foreach ($child->getSpouseFamilies() as $childfamily) {
                        $chchildren = $childfamily->getChildren();
                        foreach ($chchildren as $chchild) {
                            $chnam = $chchild->getAllNames();
                            $chfulln = rtrim($chnam[0]['givn'], '*') . " " . $chnam[0]['surname'];
                            $chfulln = str_replace('"', "", $chfulln);
                            // Must remove quotes completely here
                            $chfulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln);
                            $chfulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $chfulln);
                            // Child’s Full Name
                            $chdob = ($chchild->getBirthDate()->minJD() + $chchild->getBirthDate()->maxJD()) / 2;
                            // Child’s Date of Birth (Julian)
                            $chdod = ($chchild->getDeathDate()->minJD() + $chchild->getDeathDate()->maxJD()) / 2;
                            // Child’s Date of Death (Julian)
                            $chBLD = $chfulln . ", " . $chdob . ", " . $chdod;
                            array_push($chBLDarray, $chBLD);
                        }
                    }
                    // Get Childs marriage status ------------
                    $marrdate = "";
                    $chhusbnam = null;
                    foreach ($child->getSpouseFamilies() as $childfamily) {
                        $marrdate = $childfamily->getMarriageDate();
                        if ($childfamily->getHusband()) {
                            $chhusbnam = $childfamily->getHusband()->getAllNames();
                        }
                    }
                    // Childs Details -------------------------
                    $spouselinks .= "<li>";
                    if ($child->canShowName()) {
                        $nam = $child->getAllNames();
                        $fulln = rtrim($nam[0]['givn'], '*') . "&nbsp;" . $nam[0]['surname'];
                        $fulln = str_replace("@N.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                        $fulln = str_replace("@P.N.", "(" . WT_I18N::translate('unknown') . ")", $fulln);
                        $husbnam = null;
                        // Get childs married name if available
                        $chfulmn = null;
                        $chnam = $child->getAllNames();
                        if ($chhusbnam[0]['surname'] == "@N.N." || $chhusbnam[0]['surname'] == "") {
                            // if Husband or his name is not known then use wifes birth name
                            $husbnam = $nam[0]['surname'];
                        } else {
                            $husbnam = $chhusbnam[0]['surname'];
                        }
                        for ($i = 0; $i < count($nam); $i++) {
                            if ($chnam[$i]['type'] == '_MARNM') {
                                $chfulmn = rtrim($chnam[$i]['givn'], '*') . "&nbsp;" . $husbnam;
                            }
                        }
                        $spouselinks .= "<a href=\"#\" onclick=\"insertRowToTable(";
                        $spouselinks .= "'" . $child->getXref() . "',";
                        // pid = PID
                        $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                        // nam = Name
                        if (isset($chfulmn)) {
                            $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($chfulmn)) . "',";
                            // mnam = Full Married Name
                        } else {
                            $spouselinks .= "'" . WT_Filter::escapeHtml(strip_tags($fulln)) . "',";
                            // mnam = Full Name
                        }
                        if ($currpid == "Son" || $currpid == "Daughter") {
                            if ($child->getSex() == "M") {
                                $spouselinks .= "'Grand-Son',";
                                // label = Male Relationship
                            } else {
                                $spouselinks .= "'Grand-Daughter',";
                                // label = Female Relationship
                            }
                        } else {
                            if ($child->getSex() == "M") {
                                $spouselinks .= "'Nephew',";
                                // label = Male Relationship
                            } else {
                                $spouselinks .= "'Niece',";
                                // label = Female Relationship
                            }
                        }
                        $spouselinks .= "'" . $child->getSex() . "',";
                        // sex = Gender
                        $spouselinks .= "''" . ",";
                        // cond = Condition (Married etc)
                        if ($marrdate) {
                            $spouselinks .= "'" . ($marrdate->minJD() + $marrdate->maxJD()) / 2 . "',";
                            // dom = Date of Marriage (Julian)
                        } else {
                            $spouselinks .= "'nm'" . ",";
                        }
                        $spouselinks .= "'" . ($child->getBirthDate()->minJD() + $child->getBirthDate()->maxJD()) / 2 . "',";
                        // dob = Date of Birth
                        if ($child->getbirthyear() >= 1) {
                            $spouselinks .= "'" . ($censyear - $child->getbirthyear()) . "',";
                            // age =  Census Year - Year of Birth
                        } else {
                            $spouselinks .= "''" . ",";
                            // age =  Undefined
                        }
                        $spouselinks .= "'" . ($child->getDeathDate()->minJD() + $child->getDeathDate()->maxJD()) / 2 . "',";
                        // dod = Date of Death
                        $spouselinks .= "''" . ",";
                        // occu  = Occupation
                        $spouselinks .= "'" . WT_Filter::escapeHtml($child->getBirthPlace()) . "'" . ",";
                        // birthpl = Individuals Birthplace
                        if (isset($ChildFBP)) {
                            $spouselinks .= "'" . WT_Filter::escapeHtml($ChildFBP) . "'" . ",";
                            // fbirthpl = Fathers Birthplace
                        } else {
                            $spouselinks .= "'UNK, UNK, UNK, UNK'" . ",";
                            // fbirthpl = Fathers Birthplace Not Known
                        }
                        if (isset($ChildMBP)) {
                            $spouselinks .= "'" . WT_Filter::escapeHtml($ChildMBP) . "'" . ",";
                            // mbirthpl = Mothers Birthplace
                        } else {
                            $spouselinks .= "'UNK, UNK, UNK, UNK'" . ",";
                            // mbirthpl = Mothers Birthplace Not Known
                        }
                        if (isset($chBLDarray) && $child->getSex() == "F") {
                            $chBLDarray = implode("::", $chBLDarray);
                            $spouselinks .= "'" . $chBLDarray . "'";
                            // Array of Children (name, birthdate, deathdate)
                        } else {
                            $spouselinks .= "''";
                        }
                        $spouselinks .= ");\">";
                        $spouselinks .= $child->getFullName();
                        // Full Name (Link)
                        $spouselinks .= "</a>";
                        $spouselinks .= "</li>";
                    } else {
                        $spouselinks .= WT_I18N::translate('Private');
                    }
                }
            }
            $spouselinks .= "</ul>";
        }
        if ($persons != "Yes") {
            $spouselinks .= "(" . WT_I18N::translate('none') . ")</td></tr></table>";
        } else {
            $spouselinks .= "</td></tr></table>";
        }
        if ($person_parent != "Yes") {
            $parentlinks .= "(" . WT_I18N::translate_c('unknown family', 'unknown') . ")</td></tr></table>";
        } else {
            $parentlinks .= "</td></tr></table>";
        }
        if ($person_step != "Yes") {
            $step_parentlinks .= "(" . WT_I18N::translate_c('unknown family', 'unknown') . ")</td></tr></table>";
        } else {
            $step_parentlinks .= "</td></tr></table>";
        }
    }
}