/**
  * The sortname is used in the pdf index
  *
  * @param type $person
  * @return type
  */
 private function getSortName($person)
 {
     $sortname = $person->getSortName();
     $text1 = I18N::translateContext('Unknown given name', '…');
     $text2 = I18N::translateContext('Unknown surname', '…');
     $search = array(',', '@P.N.', '@N.N.');
     $replace = array(', ', $text1, $text2);
     return str_replace($search, $replace, $sortname);
 }
Beispiel #2
0
 /**
  * Translate a code, for an optional record
  *
  * @param string            $type
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getValue($type, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'birth':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Birth');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Birth');
                 default:
                     return I18N::translateContext('Pedigree', 'Birth');
             }
         case 'adopted':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Adopted');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Adopted');
                 default:
                     return I18N::translateContext('Pedigree', 'Adopted');
             }
         case 'foster':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Foster');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Foster');
                 default:
                     return I18N::translateContext('Pedigree', 'Foster');
             }
         case 'sealing':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Sealing');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Sealing');
                 default:
                     return I18N::translateContext('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 I18N::translate('Rada');
         default:
             return $type;
     }
 }
 /**
  * Process <var var="">
  *
  * @param string[] $attrs
  */
 protected function varStartHandler($attrs)
 {
     if (preg_match('/^I18N::number\\((.+)\\)$/', $attrs['var'], $match)) {
         $this->text .= I18N::number($match[1]);
     } elseif (preg_match('/^I18N::translate\\(\'(.+)\'\\)$/', $attrs['var'], $match)) {
         $this->text .= I18N::translate($match[1]);
     } elseif (preg_match('/^I18N::translateContext\\(\'(.+)\', *\'(.+)\'\\)$/', $attrs['var'], $match)) {
         $this->text .= I18N::translateContext($match[1], $match[2]);
     } else {
         $this->text .= $attrs['var'];
     }
 }
Beispiel #4
0
 /**
  * Translate a code, for an (optional) record
  *
  * @param string               $type
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getValue($type, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'BOTH':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by both parents');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by both parents');
                 default:
                     return I18N::translate('Adopted by both parents');
             }
         case 'HUSB':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by father');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by father');
                 default:
                     return I18N::translate('Adopted by father');
             }
         case 'WIFE':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by mother');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by mother');
                 default:
                     return I18N::translate('Adopted by mother');
             }
         default:
             return $type;
     }
 }
Beispiel #5
0
/**
 * Format a list of facts for display
 *
 * @param Fact[] $list
 * @param string $tag1
 * @param string $tag2
 * @param bool   $show_sex_symbols
 *
 * @return string
 */
function calendar_list_text($list, $tag1, $tag2, $show_sex_symbols)
{
    global $males, $females, $WT_TREE;
    $html = '';
    foreach ($list as $id => $facts) {
        $tmp = GedcomRecord::getInstance($id, $WT_TREE);
        $html .= $tag1 . '<a href="' . $tmp->getHtmlUrl() . '">' . $tmp->getFullName() . '</a> ';
        if ($show_sex_symbols && $tmp instanceof Individual) {
            switch ($tmp->getSex()) {
                case 'M':
                    $html .= '<i class="icon-sex_m_9x9" title="' . I18N::translate('Male') . '"></i>';
                    ++$males;
                    break;
                case 'F':
                    $html .= '<i class="icon-sex_f_9x9" title="' . I18N::translate('Female') . '"></i>';
                    ++$females;
                    break;
                default:
                    $html .= '<i class="icon-sex_u_9x9" title="' . I18N::translateContext('unknown gender', 'Unknown') . '"></i>';
                    break;
            }
        }
        $html .= '<div class="indent">' . $facts . '</div>' . $tag2;
    }
    return $html;
}
Beispiel #6
0
 /**
  * A list of known surname traditions, with their descriptions
  *
  * @return string[]
  */
 public static function allDescriptions()
 {
     return array('paternal' => I18N::translateContext('Surname tradition', 'paternal') . ' — ' . I18N::translate('Children take their father’s surname.') . ' ' . I18N::translate('Wives take their husband’s surname.'), 'patrilineal' => I18N::translate('patrilineal') . ' — ' . I18N::translate('Children take their father’s surname.'), 'matrilineal' => I18N::translate('matrilineal') . ' — ' . I18N::translate('Children take their mother’s surname.'), 'spanish' => I18N::translateContext('Surname tradition', 'Spanish') . ' — ' . I18N::translate('Children take one surname from the father and one surname from the mother.'), 'portuguese' => I18N::translateContext('Surname tradition', 'Portuguese') . ' — ' . I18N::translate('Children take one surname from the mother and one surname from the father.'), 'icelandic' => I18N::translateContext('Surname tradition', 'Icelandic') . ' — ' . I18N::translate('Children take a patronym instead of a surname.'), 'polish' => I18N::translateContext('Surname tradition', 'Polish') . ' — ' . I18N::translate('Children take their father’s surname.') . ' ' . I18N::translate('Wives take their husband’s surname.') . ' ' . I18N::translate('Surnames are inflected to indicate an individual’s gender.'), 'lithuanian' => I18N::translateContext('Surname tradition', 'Lithuanian') . ' — ' . I18N::translate('Children take their father’s surname.') . ' ' . I18N::translate('Wives take their husband’s surname.') . ' ' . I18N::translate('Surnames are inflected to indicate an individual’s gender and marital status.'), 'none' => I18N::translateContext('Surname tradition', 'none'));
 }
    /**
     * Load this sidebar synchronously.
     *
     * @return string
     */
    public function getSidebarContent()
    {
        global $controller, $WT_TREE;
        // Fetch a list of the initial letters of all surnames in the database
        $initials = QueryName::surnameAlpha($WT_TREE, true, false, false);
        $controller->addInlineJavascript('
			var loadedNames = new Array();

			function isearchQ() {
				var query = jQuery("#sb_indi_name").val();
				if (query.length>1) {
					jQuery("#sb_indi_content").load("module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=individuals&search="+query);
				}
			}

			var timerid = null;
			jQuery("#sb_indi_name").keyup(function(e) {
				if (timerid) window.clearTimeout(timerid);
				timerid = window.setTimeout("isearchQ()", 500);
			});
			jQuery("#sb_content_individuals").on("click", ".sb_indi_letter", function() {
				jQuery("#sb_indi_content").load(this.href);
				return false;
			});
			jQuery("#sb_content_individuals").on("click", ".sb_indi_surname", function() {
				var element = jQuery(this);
				var surname = element.data("surname");
				var alpha   = element.data("alpha");

				if (!loadedNames[surname]) {
					jQuery.ajax({
					  url: "module.php?mod=' . $this->getName() . '&mod_action=ajax&sb_action=individuals&alpha=" + encodeURIComponent(alpha) + "&surname=" + encodeURIComponent(surname),
					  cache: false,
					  success: function(html) {
					    jQuery("div.name_tree_div", element.closest("li"))
					    .html(html)
					    .show("fast")
					    .css("list-style-image", "url(' . Theme::theme()->parameter('image-minus') . ')");
					    loadedNames[surname]=2;
					  }
					});
				} else if (loadedNames[surname]==1) {
					loadedNames[surname]=2;
					jQuery("div.name_tree_div", jQuery(this).closest("li"))
					.show()
					.css("list-style-image", "url(' . Theme::theme()->parameter('image-minus') . ')");
				} else {
					loadedNames[surname]=1;
					jQuery("div.name_tree_div", jQuery(this).closest("li"))
					.hide("fast")
					.css("list-style-image", "url(' . Theme::theme()->parameter('image-plus') . ')");
				}
				return false;
			});
		');
        $out = '<form method="post" action="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax" onsubmit="return false;"><input type="search" name="sb_indi_name" id="sb_indi_name" placeholder="' . I18N::translate('Search') . '"><p>';
        foreach ($initials as $letter => $count) {
            switch ($letter) {
                case '@':
                    $html = I18N::translateContext('Unknown surname', '…');
                    break;
                case ',':
                    $html = I18N::translate('None');
                    break;
                case ' ':
                    $html = '&nbsp;';
                    break;
                default:
                    $html = $letter;
                    break;
            }
            $html = '<a href="module.php?mod=' . $this->getName() . '&amp;mod_action=ajax&amp;sb_action=individuals&amp;alpha=' . urlencode($letter) . '" class="sb_indi_letter">' . $html . '</a>';
            $out .= $html . " ";
        }
        $out .= '</p>';
        $out .= '<div id="sb_indi_content">';
        $out .= '</div></form>';
        return $out;
    }
Beispiel #8
0
 /**
  * Century name, English => 21st, Polish => XXI, etc.
  *
  * @param int $century
  *
  * @return string
  */
 private function centuryName($century)
 {
     if ($century < 0) {
         return str_replace(-$century, self::centuryName(-$century), I18N::translate('%s BCE', I18N::number(-$century)));
     }
     // The current chart engine (Google charts) can't handle <sup></sup> markup
     switch ($century) {
         case 21:
             return strip_tags(I18N::translateContext('CENTURY', '21st'));
         case 20:
             return strip_tags(I18N::translateContext('CENTURY', '20th'));
         case 19:
             return strip_tags(I18N::translateContext('CENTURY', '19th'));
         case 18:
             return strip_tags(I18N::translateContext('CENTURY', '18th'));
         case 17:
             return strip_tags(I18N::translateContext('CENTURY', '17th'));
         case 16:
             return strip_tags(I18N::translateContext('CENTURY', '16th'));
         case 15:
             return strip_tags(I18N::translateContext('CENTURY', '15th'));
         case 14:
             return strip_tags(I18N::translateContext('CENTURY', '14th'));
         case 13:
             return strip_tags(I18N::translateContext('CENTURY', '13th'));
         case 12:
             return strip_tags(I18N::translateContext('CENTURY', '12th'));
         case 11:
             return strip_tags(I18N::translateContext('CENTURY', '11th'));
         case 10:
             return strip_tags(I18N::translateContext('CENTURY', '10th'));
         case 9:
             return strip_tags(I18N::translateContext('CENTURY', '9th'));
         case 8:
             return strip_tags(I18N::translateContext('CENTURY', '8th'));
         case 7:
             return strip_tags(I18N::translateContext('CENTURY', '7th'));
         case 6:
             return strip_tags(I18N::translateContext('CENTURY', '6th'));
         case 5:
             return strip_tags(I18N::translateContext('CENTURY', '5th'));
         case 4:
             return strip_tags(I18N::translateContext('CENTURY', '4th'));
         case 3:
             return strip_tags(I18N::translateContext('CENTURY', '3rd'));
         case 2:
             return strip_tags(I18N::translateContext('CENTURY', '2nd'));
         case 1:
             return strip_tags(I18N::translateContext('CENTURY', '1st'));
         default:
             return $century - 1 . '01-' . $century . '00';
     }
 }
Beispiel #9
0
 /**
  * Full month name in instrumental case.
  *
  * @param int  $month_number
  * @param bool $leap_year    Some calendars use leap months
  *
  * @return string
  */
 protected function monthNameInstrumentalCase($month_number, $leap_year)
 {
     static $translated_month_names;
     if ($translated_month_names === null) {
         $translated_month_names = array(0 => '', 1 => I18N::translateContext('INSTRUMENTAL', 'Muharram'), 2 => I18N::translateContext('INSTRUMENTAL', 'Safar'), 3 => I18N::translateContext('INSTRUMENTAL', 'Rabi’ al-awwal'), 4 => I18N::translateContext('INSTRUMENTAL', 'Rabi’ al-thani'), 5 => I18N::translateContext('INSTRUMENTAL', 'Jumada al-awwal'), 6 => I18N::translateContext('INSTRUMENTAL', 'Jumada al-thani'), 7 => I18N::translateContext('INSTRUMENTAL', 'Rajab'), 8 => I18N::translateContext('INSTRUMENTAL', 'Sha’aban'), 9 => I18N::translateContext('INSTRUMENTAL', 'Ramadan'), 10 => I18N::translateContext('INSTRUMENTAL', 'Shawwal'), 11 => I18N::translateContext('INSTRUMENTAL', 'Dhu al-Qi’dah'), 12 => I18N::translateContext('INSTRUMENTAL', 'Dhu al-Hijjah'));
     }
     return $translated_month_names[$month_number];
 }
Beispiel #10
0
     echo '<input type="checkbox" name="vars[', Filter::escapeHtml($input['name']), ']" id="', Filter::escapeHtml($input['name']), '" value="1" ';
     echo $input['default'] == '1' ? 'checked' : '';
     echo '>';
 }
 if ($input['type'] == 'select') {
     echo '<select name="vars[', Filter::escapeHtml($input['name']), ']" id="', Filter::escapeHtml($input['name']), '_var">';
     $options = preg_split('/[|]+/', $input['options']);
     foreach ($options as $option) {
         $opt = explode('=>', $option);
         list($value, $display) = $opt;
         if (preg_match('/^I18N::number\\((.+)\\)$/', $display, $match)) {
             $display = I18N::number($match[1]);
         } elseif (preg_match('/^I18N::translate\\(\'(.+)\'\\)$/', $display, $match)) {
             $display = I18N::translate($match[1]);
         } elseif (preg_match('/^I18N::translateContext\\(\'(.+)\', *\'(.+)\'\\)$/', $display, $match)) {
             $display = I18N::translateContext($match[1], $match[2]);
         }
         echo '<option value="', Filter::escapeHtml($value), '" ';
         if ($opt[0] == $input['default']) {
             echo 'selected';
         }
         echo '>', Filter::escapeHtml($display), '</option>';
     }
     echo '</select>';
 }
 if (isset($input['lookup'])) {
     echo '<input type="hidden" name="type[', Filter::escapeHtml($input['name']), ']" value="', Filter::escapeHtml($input['lookup']), '">';
     if ($input['lookup'] == 'INDI') {
         echo FunctionsPrint::printFindIndividualLink('pid');
     } elseif ($input['lookup'] == 'PLAC') {
         echo FunctionsPrint::printFindPlaceLink($input['name']);
Beispiel #11
0
 /**
  * Abbreviated month name
  *
  * @param int  $month_number
  * @param bool $leap_year    Some calendars use leap months
  *
  * @return string
  */
 protected function monthNameAbbreviated($month_number, $leap_year)
 {
     static $translated_month_names;
     if ($translated_month_names === null) {
         $translated_month_names = array(0 => '', 1 => I18N::translateContext('Abbreviation for January', 'Jan'), 2 => I18N::translateContext('Abbreviation for February', 'Feb'), 3 => I18N::translateContext('Abbreviation for March', 'Mar'), 4 => I18N::translateContext('Abbreviation for April', 'Apr'), 5 => I18N::translateContext('Abbreviation for May', 'May'), 6 => I18N::translateContext('Abbreviation for June', 'Jun'), 7 => I18N::translateContext('Abbreviation for July', 'Jul'), 8 => I18N::translateContext('Abbreviation for August', 'Aug'), 9 => I18N::translateContext('Abbreviation for September', 'Sep'), 10 => I18N::translateContext('Abbreviation for October', 'Oct'), 11 => I18N::translateContext('Abbreviation for November', 'Nov'), 12 => I18N::translateContext('Abbreviation for December', 'Dec'));
     }
     return $translated_month_names[$month_number];
 }
Beispiel #12
0
use Fisharebest\Webtrees\Functions\FunctionsCharts;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
define('WT_SCRIPT_NAME', 'family.php');
require './includes/session.php';
$record = Family::getInstance(Filter::get('famid', WT_REGEX_XREF), $WT_TREE);
$controller = new FamilyController($record);
if ($controller->record && $controller->record->canShow()) {
    if ($controller->record->isPendingDeletion()) {
        if (Auth::isModerator($controller->record->getTree())) {
            FlashMessages::addMessage(I18N::translate('This family has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes'), 'warning');
        } elseif (Auth::isEditor($controller->record->getTree())) {
            FlashMessages::addMessage(I18N::translate('This family has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes'), 'warning');
        }
    } elseif ($controller->record->isPendingAddtion()) {
        if (Auth::isModerator($controller->record->getTree())) {
            FlashMessages::addMessage(I18N::translate('This family has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes'), 'warning');
        } elseif (Auth::isEditor($controller->record->getTree())) {
            FlashMessages::addMessage(I18N::translate('This family has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes'), 'warning');
        }
    }
    $controller->pageHeader();
} elseif ($controller->record && $controller->record->getTree()->getPreference('SHOW_PRIVATE_RELATIONSHIPS')) {
    $controller->pageHeader();
    // Continue - to display the children/parents/grandparents.
    // We'll check for showing the details again later
} else {
    FlashMessages::addMessage(I18N::translate('This family does not exist or you do not have permission to view it.'), 'danger');
    http_response_code(404);
    $controller->pageHeader();
    return;
}
 /**
  * {@inheritDoc}
  * @see \MyArtJaub\Webtrees\Mvc\Controller\MvcController::__construct(AbstractModule $module)
  */
 public function __construct(AbstractModule $module)
 {
     global $WT_TREE;
     parent::__construct($module);
     $this->surname = Filter::get('surname');
     $this->alpha = Filter::get('alpha');
     // All surnames beginning with this letter where "@"=unknown and ","=none
     $this->show_all = Filter::get('show_all', 'no|yes', 'no');
     // All indis
     // Make sure selections are consistent.
     // i.e. can’t specify show_all and surname at the same time.
     if ($this->show_all === 'yes') {
         $this->alpha = '';
         $this->surname = '';
         $this->legend = I18N::translate('All');
         $this->show = Filter::get('show', 'surn|lineage', 'surn');
     } elseif ($this->surname) {
         $this->alpha = QueryName::initialLetter($this->surname);
         // so we can highlight the initial letter
         $this->show_all = 'no';
         if ($this->surname === '@N.N.') {
             $this->legend = I18N::translateContext('Unknown surname', '…');
         } else {
             $this->legend = Filter::escapeHtml($this->surname);
             // The surname parameter is a root/canonical form.
             // Display it as the actual surname
             foreach (QueryName::surnames($WT_TREE, $this->surname, $this->alpha, false, false) as $details) {
                 $this->legend = implode('/', array_keys($details));
             }
         }
         $this->show = 'lineage';
         // SURN list makes no sense here
     } elseif ($this->alpha === '@') {
         $this->show_all = 'no';
         $this->legend = I18N::translateContext('Unknown surname', '…');
         $this->show = 'lineage';
         // SURN list makes no sense here
     } elseif ($this->alpha === ',') {
         $this->show_all = 'no';
         $this->legend = I18N::translate('None');
         $this->show = 'lineage';
         // SURN list makes no sense here
     } elseif ($this->alpha) {
         $this->show_all = 'no';
         $this->legend = Filter::escapeHtml($this->alpha) . '…';
         $this->show = Filter::get('show', 'surn|lineage', 'surn');
     } else {
         $this->show_all = 'no';
         $this->legend = '…';
         $this->show = 'none';
         // Don't show lists until something is chosen
     }
     $this->legend = '<span dir="auto">' . $this->legend . '</span>';
 }
 /**
  * Forat the parents of an individual.
  *
  * @param Individual $person
  *
  * @return string
  */
 private function getParents(Individual $person)
 {
     $father = null;
     $mother = null;
     $html = sprintf(self::TTL, I18N::translate('Parents'));
     $family = $person->getPrimaryChildFamily();
     if ($person->canShowName() && $family !== null) {
         $father = $family->getHusband();
         $mother = $family->getWife();
         $html .= $this->getHTML($father) . $this->getHTML($mother);
         // Can only have a step parent if one & only one parent found at this point
         if ($father instanceof Individual xor $mother instanceof Individual) {
             $stepParents = '';
             foreach ($person->getChildStepFamilies() as $family) {
                 if (!$father instanceof Individual) {
                     $stepParents .= $this->getHTML($family->getHusband());
                 } else {
                     $stepParents .= $this->getHTML($family->getWife());
                 }
             }
             if ($stepParents) {
                 $relationship = $father instanceof Individual ? I18N::translateContext("father’s wife", "step-mother") : I18N::translateContext("mother’s husband", "step-father");
                 $html .= sprintf(self::TTL, $relationship) . $stepParents;
             }
         }
     }
     if (!($father instanceof Individual || $mother instanceof Individual)) {
         $html .= sprintf(self::MSG, I18N::translateContext('unknown family', 'unknown'));
     }
     return $html;
 }
 /**
  * Setting upp or changing variables in the XML
  * The XML variable name and value is stored in $this->vars
  *
  * @param array $attrs an array of key value pairs for the attributes
  */
 private function setVarStartHandler($attrs)
 {
     if (empty($attrs['name'])) {
         throw new \DomainException('REPORT ERROR var: The attribute "name" is missing or not set in the XML file');
     }
     $name = $attrs['name'];
     $value = $attrs['value'];
     $match = array();
     // Current GEDCOM record strings
     if ($value == "@ID") {
         if (preg_match("/0 @(.+)@/", $this->gedrec, $match)) {
             $value = $match[1];
         }
     } elseif ($value == "@fact") {
         $value = $this->fact;
     } elseif ($value == "@desc") {
         $value = $this->desc;
     } elseif ($value == "@generation") {
         $value = $this->generation;
     } elseif (preg_match("/@(\\w+)/", $value, $match)) {
         $gmatch = array();
         if (preg_match("/\\d {$match['1']} (.+)/", $this->gedrec, $gmatch)) {
             $value = str_replace("@", "", trim($gmatch[1]));
         }
     }
     if (preg_match("/\\\$(\\w+)/", $name, $match)) {
         $name = $this->vars["'" . $match[1] . "'"]['id'];
     }
     $count = preg_match_all("/\\\$(\\w+)/", $value, $match, PREG_SET_ORDER);
     $i = 0;
     while ($i < $count) {
         $t = $this->vars[$match[$i][1]]['id'];
         $value = preg_replace("/\\\$" . $match[$i][1] . "/", $t, $value, 1);
         $i++;
     }
     if (preg_match('/^I18N::number\\((.+)\\)$/', $value, $match)) {
         $value = I18N::number($match[1]);
     } elseif (preg_match('/^I18N::translate\\(\'(.+)\'\\)$/', $value, $match)) {
         $value = I18N::translate($match[1]);
     } elseif (preg_match('/^I18N::translateContext\\(\'(.+)\', *\'(.+)\'\\)$/', $value, $match)) {
         $value = I18N::translateContext($match[1], $match[2]);
     }
     // Arithmetic functions
     if (preg_match("/(\\d+)\\s*([\\-\\+\\*\\/])\\s*(\\d+)/", $value, $match)) {
         switch ($match[2]) {
             case "+":
                 $t = $match[1] + $match[3];
                 $value = preg_replace("/" . $match[1] . "\\s*([\\-\\+\\*\\/])\\s*" . $match[3] . "/", $t, $value);
                 break;
             case "-":
                 $t = $match[1] - $match[3];
                 $value = preg_replace("/" . $match[1] . "\\s*([\\-\\+\\*\\/])\\s*" . $match[3] . "/", $t, $value);
                 break;
             case "*":
                 $t = $match[1] * $match[3];
                 $value = preg_replace("/" . $match[1] . "\\s*([\\-\\+\\*\\/])\\s*" . $match[3] . "/", $t, $value);
                 break;
             case "/":
                 $t = $match[1] / $match[3];
                 $value = preg_replace("/" . $match[1] . "\\s*([\\-\\+\\*\\/])\\s*" . $match[3] . "/", $t, $value);
                 break;
         }
     }
     if (strpos($value, "@") !== false) {
         $value = "";
     }
     $this->vars[$name]['id'] = $value;
 }
Beispiel #16
0
 /**
  * Translate a code, for an (optional) record.
  * We need the record to translate the sex (godfather/godmother) but
  * we won’t have this when adding data for new individuals.
  *
  * @param string            $type
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getValue($type, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'attendant':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Attendant');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Attendant');
                 default:
                     return I18N::translate('Attendant');
             }
         case 'attending':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Attending');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Attending');
                 default:
                     return I18N::translate('Attending');
             }
         case 'best_man':
             // always male
             return I18N::translate('Best man');
         case 'bridesmaid':
             // always female
             return I18N::translate('Bridesmaid');
         case 'buyer':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Buyer');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Buyer');
                 default:
                     return I18N::translate('Buyer');
             }
         case 'circumciser':
             // always male
             return I18N::translate('Circumciser');
         case 'civil_registrar':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Civil registrar');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Civil registrar');
                 default:
                     return I18N::translate('Civil registrar');
             }
         case 'employee':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Employee');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Employee');
                 default:
                     return I18N::translate('Employee');
             }
         case 'employer':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Employer');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Employer');
                 default:
                     return I18N::translate('Employer');
             }
         case 'foster_child':
             // no sex implied
             return I18N::translate('Foster child');
         case 'foster_father':
             // always male
             return I18N::translate('Foster father');
         case 'foster_mother':
             // always female
             return I18N::translate('Foster mother');
         case 'friend':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Friend');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Friend');
                 default:
                     return I18N::translate('Friend');
             }
         case 'godfather':
             // always male
             return I18N::translate('Godfather');
         case 'godmother':
             // always female
             return I18N::translate('Godmother');
         case 'godparent':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Godfather');
                 case 'F':
                     return I18N::translate('Godmother');
                 default:
                     return I18N::translate('Godparent');
             }
         case 'godson':
             // always male
             return I18N::translate('Godson');
         case 'goddaughter':
             // always female
             return I18N::translate('Goddaughter');
         case 'godchild':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Godson');
                 case 'F':
                     return I18N::translate('Goddaughter');
                 default:
                     return I18N::translate('Godchild');
             }
         case 'guardian':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Guardian');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Guardian');
                 default:
                     return I18N::translate('Guardian');
             }
         case 'informant':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Informant');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Informant');
                 default:
                     return I18N::translate('Informant');
             }
         case 'lodger':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Lodger');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Lodger');
                 default:
                     return I18N::translate('Lodger');
             }
         case 'nanny':
             // no sex implied
             return I18N::translate('Nanny');
         case 'nurse':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Nurse');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Nurse');
                 default:
                     return I18N::translate('Nurse');
             }
         case 'owner':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Owner');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Owner');
                 default:
                     return I18N::translate('Owner');
             }
         case 'priest':
             // no sex implied
             return I18N::translate('Priest');
         case 'rabbi':
             // always male
             return I18N::translate('Rabbi');
         case 'registry_officer':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Registry officer');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Registry officer');
                 default:
                     return I18N::translate('Registry officer');
             }
         case 'seller':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Seller');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Seller');
                 default:
                     return I18N::translate('Seller');
             }
         case 'servant':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Servant');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Servant');
                 default:
                     return I18N::translate('Servant');
             }
         case 'slave':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Slave');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Slave');
                 default:
                     return I18N::translate('Slave');
             }
         case 'ward':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Ward');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Ward');
                 default:
                     return I18N::translate('Ward');
             }
         case 'witness':
             // Do we need separate male/female translations for this?
             return I18N::translate('Witness');
         default:
             return $type;
     }
 }
Beispiel #17
0
 /**
  * Get the list of initial letters
  * 
  * @return string[]
  */
 private function getInitialLettersList()
 {
     $list = array();
     /** @var \Fisharebest\Webtrees\Tree $tree */
     $tree = $this->data->get('tree');
     $script_base_url = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage';
     foreach (QueryName::surnameAlpha($tree, false, false) as $letter => $count) {
         switch ($letter) {
             case '@':
                 $html = I18N::translateContext('Unknown surname', '…');
                 break;
             case ',':
                 $html = I18N::translate('None');
                 break;
             default:
                 $html = Filter::escapeHtml($letter);
                 break;
         }
         if ($count) {
             if ($letter == $this->data->get('alpha')) {
                 $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&amp;ged=' . $tree->getNameUrl() . '" class="warning" title="' . I18N::number($count) . '">' . $html . '</a>';
             } else {
                 $list[] = '<a href="' . $script_base_url . '&alpha=' . rawurlencode($letter) . '&amp;ged=' . $tree->getNameUrl() . '" title="' . I18N::number($count) . '">' . $html . '</a>';
             }
         } else {
             $list[] = $html;
         }
     }
     // Search spiders don't get the "show all" option as the other links give them everything.
     if (!Auth::isSearchEngine()) {
         if ($this->data->get('show_all') === 'yes') {
             $list[] = '<span class="warning">' . I18N::translate('All') . '</span>';
         } else {
             $list[] = '<a href="' . $script_base_url . '&show_all=yes' . '&amp;ged=' . $tree->getNameUrl() . '">' . I18N::translate('All') . '</a>';
         }
     }
     return $list;
 }
Beispiel #18
0
 /**
  * Draw a person name preceded by sex icon, with parents as tooltip
  *
  * @param Individual $individual an individual
  * @param string        $dashed     if = 'dashed' print dashed top border to separate multiple spuses
  *
  * @return string
  */
 private function drawPersonName(Individual $individual, $dashed = '')
 {
     if ($this->all_partners === 'true') {
         $family = $individual->getPrimaryChildFamily();
         if ($family) {
             $family_name = strip_tags($family->getFullName());
         } else {
             $family_name = I18N::translateContext('unknown family', 'unknown');
         }
         switch ($individual->getSex()) {
             case 'M':
                 $title = ' title="' . I18N::translate('Son of %s', $family_name) . '"';
                 break;
             case 'F':
                 $title = ' title="' . I18N::translate('Daughter of %s', $family_name) . '"';
                 break;
             default:
                 $title = ' title="' . I18N::translate('Child of %s', $family_name) . '"';
                 break;
         }
     } else {
         $title = '';
     }
     $sex = $individual->getSex();
     return '<div class="tv' . $sex . ' ' . $dashed . '"' . $title . '><a href="' . $individual->getHtmlUrl() . '"></a>' . $individual->getFullName() . ' <span class="dates">' . $individual->getLifeSpan() . '</span></div>';
 }
Beispiel #19
0
 /**
  * Convert a relationship path into a relationship name.
  *
  * @param string $path
  * @param Individual $person1
  * @param Individual $person2
  *
  * @return string
  */
 public static function getRelationshipNameFromPath($path, Individual $person1 = null, 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 from 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 I18N::translate('self');
             //  Level One relationships
         //  Level One relationships
         case 'mot':
             return I18N::translate('mother');
         case 'fat':
             return I18N::translate('father');
         case 'par':
             return I18N::translate('parent');
         case 'hus':
             if ($person1 && $person2) {
                 foreach ($person1->getSpouseFamilies() as $family) {
                     if ($person2 === $family->getSpouse($person1)) {
                         if ($family->getFacts('_NMR')) {
                             if ($family->getFacts(WT_EVENTS_DIV)) {
                                 return I18N::translateContext('MALE', 'ex-partner');
                             } else {
                                 return I18N::translateContext('MALE', 'partner');
                             }
                         } elseif ($family->getFacts(WT_EVENTS_DIV)) {
                             return I18N::translate('ex-husband');
                         }
                     }
                 }
             }
             return I18N::translate('husband');
         case 'wif':
             if ($person1 && $person1) {
                 foreach ($person1->getSpouseFamilies() as $family) {
                     if ($person2 === $family->getSpouse($person1)) {
                         if ($family->getFacts('_NMR')) {
                             if ($family->getFacts(WT_EVENTS_DIV)) {
                                 return I18N::translateContext('FEMALE', 'ex-partner');
                             } else {
                                 return I18N::translateContext('FEMALE', 'partner');
                             }
                         } elseif ($family->getFacts(WT_EVENTS_DIV)) {
                             return I18N::translate('ex-wife');
                         }
                     }
                 }
             }
             return I18N::translate('wife');
         case 'spo':
             if ($person1 && $person2) {
                 foreach ($person1->getSpouseFamilies() as $family) {
                     if ($person2 === $family->getSpouse($person1)) {
                         if ($family->getFacts('_NMR')) {
                             if ($family->getFacts(WT_EVENTS_DIV)) {
                                 return I18N::translateContext('MALE/FEMALE', 'ex-partner');
                             } else {
                                 return I18N::translateContext('MALE/FEMALE', 'partner');
                             }
                         } elseif ($family->getFacts(WT_EVENTS_DIV)) {
                             return I18N::translate('ex-spouse');
                         }
                     }
                 }
             }
             return I18N::translate('spouse');
         case 'son':
             return I18N::translate('son');
         case 'dau':
             return I18N::translate('daughter');
         case 'chi':
             return I18N::translate('child');
         case 'bro':
             if ($person1 && $person2) {
                 $dob1 = $person1->getBirthDate();
                 $dob2 = $person2->getBirthDate();
                 if ($dob1->isOK() && $dob2->isOK()) {
                     if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
                         // Exclude BEF, AFT, etc.
                         return I18N::translate('twin brother');
                     } elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
                         return I18N::translate('younger brother');
                     } elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
                         return I18N::translate('elder brother');
                     }
                 }
             }
             return I18N::translate('brother');
         case 'sis':
             if ($person1 && $person2) {
                 $dob1 = $person1->getBirthDate();
                 $dob2 = $person2->getBirthDate();
                 if ($dob1->isOK() && $dob2->isOK()) {
                     if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
                         // Exclude BEF, AFT, etc.
                         return I18N::translate('twin sister');
                     } elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
                         return I18N::translate('younger sister');
                     } elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
                         return I18N::translate('elder sister');
                     }
                 }
             }
             return I18N::translate('sister');
         case 'sib':
             if ($person1 && $person2) {
                 $dob1 = $person1->getBirthDate();
                 $dob2 = $person2->getBirthDate();
                 if ($dob1->isOK() && $dob2->isOK()) {
                     if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
                         // Exclude BEF, AFT, etc.
                         return I18N::translate('twin sibling');
                     } elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
                         return I18N::translate('younger sibling');
                     } elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
                         return I18N::translate('elder sibling');
                     }
                 }
             }
             return I18N::translate('sibling');
             // Level Two relationships
         // Level Two relationships
         case 'brochi':
             return I18N::translateContext('brother’s child', 'nephew/niece');
         case 'brodau':
             return I18N::translateContext('brother’s daughter', 'niece');
         case 'broson':
             return I18N::translateContext('brother’s son', 'nephew');
         case 'browif':
             return I18N::translateContext('brother’s wife', 'sister-in-law');
         case 'chichi':
             return I18N::translateContext('child’s child', 'grandchild');
         case 'chidau':
             return I18N::translateContext('child’s daughter', 'granddaughter');
         case 'chihus':
             return I18N::translateContext('child’s husband', 'son-in-law');
         case 'chison':
             return I18N::translateContext('child’s son', 'grandson');
         case 'chispo':
             return I18N::translateContext('child’s spouse', 'son/daughter-in-law');
         case 'chiwif':
             return I18N::translateContext('child’s wife', 'daughter-in-law');
         case 'dauchi':
             return I18N::translateContext('daughter’s child', 'grandchild');
         case 'daudau':
             return I18N::translateContext('daughter’s daughter', 'granddaughter');
         case 'dauhus':
             return I18N::translateContext('daughter’s husband', 'son-in-law');
         case 'dauson':
             return I18N::translateContext('daughter’s son', 'grandson');
         case 'fatbro':
             return I18N::translateContext('father’s brother', 'uncle');
         case 'fatchi':
             return I18N::translateContext('father’s child', 'half-sibling');
         case 'fatdau':
             return I18N::translateContext('father’s daughter', 'half-sister');
         case 'fatfat':
             return I18N::translateContext('father’s father', 'paternal grandfather');
         case 'fatmot':
             return I18N::translateContext('father’s mother', 'paternal grandmother');
         case 'fatpar':
             return I18N::translateContext('father’s parent', 'paternal grandparent');
         case 'fatsib':
             return I18N::translateContext('father’s sibling', 'aunt/uncle');
         case 'fatsis':
             return I18N::translateContext('father’s sister', 'aunt');
         case 'fatson':
             return I18N::translateContext('father’s son', 'half-brother');
         case 'fatwif':
             return I18N::translateContext('father’s wife', 'step-mother');
         case 'husbro':
             return I18N::translateContext('husband’s brother', 'brother-in-law');
         case 'huschi':
             return I18N::translateContext('husband’s child', 'step-child');
         case 'husdau':
             return I18N::translateContext('husband’s daughter', 'step-daughter');
         case 'husfat':
             return I18N::translateContext('husband’s father', 'father-in-law');
         case 'husmot':
             return I18N::translateContext('husband’s mother', 'mother-in-law');
         case 'hussib':
             return I18N::translateContext('husband’s sibling', 'brother/sister-in-law');
         case 'hussis':
             return I18N::translateContext('husband’s sister', 'sister-in-law');
         case 'husson':
             return I18N::translateContext('husband’s son', 'step-son');
         case 'motbro':
             return I18N::translateContext('mother’s brother', 'uncle');
         case 'motchi':
             return I18N::translateContext('mother’s child', 'half-sibling');
         case 'motdau':
             return I18N::translateContext('mother’s daughter', 'half-sister');
         case 'motfat':
             return I18N::translateContext('mother’s father', 'maternal grandfather');
         case 'mothus':
             return I18N::translateContext('mother’s husband', 'step-father');
         case 'motmot':
             return I18N::translateContext('mother’s mother', 'maternal grandmother');
         case 'motpar':
             return I18N::translateContext('mother’s parent', 'maternal grandparent');
         case 'motsib':
             return I18N::translateContext('mother’s sibling', 'aunt/uncle');
         case 'motsis':
             return I18N::translateContext('mother’s sister', 'aunt');
         case 'motson':
             return I18N::translateContext('mother’s son', 'half-brother');
         case 'parbro':
             return I18N::translateContext('parent’s brother', 'uncle');
         case 'parchi':
             return I18N::translateContext('parent’s child', 'half-sibling');
         case 'pardau':
             return I18N::translateContext('parent’s daughter', 'half-sister');
         case 'parfat':
             return I18N::translateContext('parent’s father', 'grandfather');
         case 'parmot':
             return I18N::translateContext('parent’s mother', 'grandmother');
         case 'parpar':
             return I18N::translateContext('parent’s parent', 'grandparent');
         case 'parsib':
             return I18N::translateContext('parent’s sibling', 'aunt/uncle');
         case 'parsis':
             return I18N::translateContext('parent’s sister', 'aunt');
         case 'parson':
             return I18N::translateContext('parent’s son', 'half-brother');
         case 'parspo':
             return I18N::translateContext('parent’s spouse', 'step-parent');
         case 'sibchi':
             return I18N::translateContext('sibling’s child', 'nephew/niece');
         case 'sibdau':
             return I18N::translateContext('sibling’s daughter', 'niece');
         case 'sibson':
             return I18N::translateContext('sibling’s son', 'nephew');
         case 'sibspo':
             return I18N::translateContext('sibling’s spouse', 'brother/sister-in-law');
         case 'sischi':
             return I18N::translateContext('sister’s child', 'nephew/niece');
         case 'sisdau':
             return I18N::translateContext('sister’s daughter', 'niece');
         case 'sishus':
             return I18N::translateContext('sister’s husband', 'brother-in-law');
         case 'sisson':
             return I18N::translateContext('sister’s son', 'nephew');
         case 'sonchi':
             return I18N::translateContext('son’s child', 'grandchild');
         case 'sondau':
             return I18N::translateContext('son’s daughter', 'granddaughter');
         case 'sonson':
             return I18N::translateContext('son’s son', 'grandson');
         case 'sonwif':
             return I18N::translateContext('son’s wife', 'daughter-in-law');
         case 'spobro':
             return I18N::translateContext('spouse’s brother', 'brother-in-law');
         case 'spochi':
             return I18N::translateContext('spouse’s child', 'step-child');
         case 'spodau':
             return I18N::translateContext('spouse’s daughter', 'step-daughter');
         case 'spofat':
             return I18N::translateContext('spouse’s father', 'father-in-law');
         case 'spomot':
             return I18N::translateContext('spouse’s mother', 'mother-in-law');
         case 'sposis':
             return I18N::translateContext('spouse’s sister', 'sister-in-law');
         case 'sposon':
             return I18N::translateContext('spouse’s son', 'step-son');
         case 'spopar':
             return I18N::translateContext('spouse’s parent', 'mother/father-in-law');
         case 'sposib':
             return I18N::translateContext('spouse’s sibling', 'brother/sister-in-law');
         case 'wifbro':
             return I18N::translateContext('wife’s brother', 'brother-in-law');
         case 'wifchi':
             return I18N::translateContext('wife’s child', 'step-child');
         case 'wifdau':
             return I18N::translateContext('wife’s daughter', 'step-daughter');
         case 'wiffat':
             return I18N::translateContext('wife’s father', 'father-in-law');
         case 'wifmot':
             return I18N::translateContext('wife’s mother', 'mother-in-law');
         case 'wifsib':
             return I18N::translateContext('wife’s sibling', 'brother/sister-in-law');
         case 'wifsis':
             return I18N::translateContext('wife’s sister', 'sister-in-law');
         case 'wifson':
             return I18N::translateContext('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 I18N::translateContext('(a man’s) brother’s child’s child', 'great-nephew/niece');
             } else {
                 return I18N::translateContext('(a woman’s) brother’s child’s child', 'great-nephew/niece');
             }
         case 'brochidau':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) brother’s child’s daughter', 'great-niece');
             } else {
                 return I18N::translateContext('(a woman’s) brother’s child’s daughter', 'great-niece');
             }
         case 'brochison':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) brother’s child’s son', 'great-nephew');
             } else {
                 return I18N::translateContext('(a woman’s) brother’s child’s son', 'great-nephew');
             }
         case 'brodauchi':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) brother’s daughter’s child', 'great-nephew/niece');
             } else {
                 return I18N::translateContext('(a woman’s) brother’s daughter’s child', 'great-nephew/niece');
             }
         case 'brodaudau':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) brother’s daughter’s daughter', 'great-niece');
             } else {
                 return I18N::translateContext('(a woman’s) brother’s daughter’s daughter', 'great-niece');
             }
         case 'brodauhus':
             return I18N::translateContext('brother’s daughter’s husband', 'nephew-in-law');
         case 'brodauson':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) brother’s daughter’s son', 'great-nephew');
             } else {
                 return I18N::translateContext('(a woman’s) brother’s daughter’s son', 'great-nephew');
             }
         case 'brosonchi':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) brother’s son’s child', 'great-nephew/niece');
             } else {
                 return I18N::translateContext('(a woman’s) brother’s son’s child', 'great-nephew/niece');
             }
         case 'brosondau':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) brother’s son’s daughter', 'great-niece');
             } else {
                 return I18N::translateContext('(a woman’s) brother’s son’s daughter', 'great-niece');
             }
         case 'brosonson':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) brother’s son’s son', 'great-nephew');
             } else {
                 return I18N::translateContext('(a woman’s) brother’s son’s son', 'great-nephew');
             }
         case 'brosonwif':
             return I18N::translateContext('brother’s son’s wife', 'niece-in-law');
         case 'browifbro':
             return I18N::translateContext('brother’s wife’s brother', 'brother-in-law');
         case 'browifsib':
             return I18N::translateContext('brother’s wife’s sibling', 'brother/sister-in-law');
         case 'browifsis':
             return I18N::translateContext('brother’s wife’s sister', 'sister-in-law');
         case 'chichichi':
             return I18N::translateContext('child’s child’s child', 'great-grandchild');
         case 'chichidau':
             return I18N::translateContext('child’s child’s daughter', 'great-granddaughter');
         case 'chichison':
             return I18N::translateContext('child’s child’s son', 'great-grandson');
         case 'chidauchi':
             return I18N::translateContext('child’s daughter’s child', 'great-grandchild');
         case 'chidaudau':
             return I18N::translateContext('child’s daughter’s daughter', 'great-granddaughter');
         case 'chidauhus':
             return I18N::translateContext('child’s daughter’s husband', 'granddaughter’s husband');
         case 'chidauson':
             return I18N::translateContext('child’s daughter’s son', 'great-grandson');
         case 'chisonchi':
             return I18N::translateContext('child’s son’s child', 'great-grandchild');
         case 'chisondau':
             return I18N::translateContext('child’s son’s daughter', 'great-granddaughter');
         case 'chisonson':
             return I18N::translateContext('child’s son’s son', 'great-grandson');
         case 'chisonwif':
             return I18N::translateContext('child’s son’s wife', 'grandson’s wife');
         case 'dauchichi':
             return I18N::translateContext('daughter’s child’s child', 'great-grandchild');
         case 'dauchidau':
             return I18N::translateContext('daughter’s child’s daughter', 'great-granddaughter');
         case 'dauchison':
             return I18N::translateContext('daughter’s child’s son', 'great-grandson');
         case 'daudauchi':
             return I18N::translateContext('daughter’s daughter’s child', 'great-grandchild');
         case 'daudaudau':
             return I18N::translateContext('daughter’s daughter’s daughter', 'great-granddaughter');
         case 'daudauhus':
             return I18N::translateContext('daughter’s daughter’s husband', 'granddaughter’s husband');
         case 'daudauson':
             return I18N::translateContext('daughter’s daughter’s son', 'great-grandson');
         case 'dauhusfat':
             return I18N::translateContext('daughter’s husband’s father', 'son-in-law’s father');
         case 'dauhusmot':
             return I18N::translateContext('daughter’s husband’s mother', 'son-in-law’s mother');
         case 'dauhuspar':
             return I18N::translateContext('daughter’s husband’s parent', 'son-in-law’s parent');
         case 'dausonchi':
             return I18N::translateContext('daughter’s son’s child', 'great-grandchild');
         case 'dausondau':
             return I18N::translateContext('daughter’s son’s daughter', 'great-granddaughter');
         case 'dausonson':
             return I18N::translateContext('daughter’s son’s son', 'great-grandson');
         case 'dausonwif':
             return I18N::translateContext('daughter’s son’s wife', 'grandson’s wife');
         case 'fatbrochi':
             return I18N::translateContext('father’s brother’s child', 'first cousin');
         case 'fatbrodau':
             return I18N::translateContext('father’s brother’s daughter', 'first cousin');
         case 'fatbroson':
             return I18N::translateContext('father’s brother’s son', 'first cousin');
         case 'fatbrowif':
             return I18N::translateContext('father’s brother’s wife', 'aunt');
         case 'fatfatbro':
             return I18N::translateContext('father’s father’s brother', 'great-uncle');
         case 'fatfatfat':
             return I18N::translateContext('father’s father’s father', 'great-grandfather');
         case 'fatfatmot':
             return I18N::translateContext('father’s father’s mother', 'great-grandmother');
         case 'fatfatpar':
             return I18N::translateContext('father’s father’s parent', 'great-grandparent');
         case 'fatfatsib':
             return I18N::translateContext('father’s father’s sibling', 'great-aunt/uncle');
         case 'fatfatsis':
             return I18N::translateContext('father’s father’s sister', 'great-aunt');
         case 'fatmotbro':
             return I18N::translateContext('father’s mother’s brother', 'great-uncle');
         case 'fatmotfat':
             return I18N::translateContext('father’s mother’s father', 'great-grandfather');
         case 'fatmotmot':
             return I18N::translateContext('father’s mother’s mother', 'great-grandmother');
         case 'fatmotpar':
             return I18N::translateContext('father’s mother’s parent', 'great-grandparent');
         case 'fatmotsib':
             return I18N::translateContext('father’s mother’s sibling', 'great-aunt/uncle');
         case 'fatmotsis':
             return I18N::translateContext('father’s mother’s sister', 'great-aunt');
         case 'fatparbro':
             return I18N::translateContext('father’s parent’s brother', 'great-uncle');
         case 'fatparfat':
             return I18N::translateContext('father’s parent’s father', 'great-grandfather');
         case 'fatparmot':
             return I18N::translateContext('father’s parent’s mother', 'great-grandmother');
         case 'fatparpar':
             return I18N::translateContext('father’s parent’s parent', 'great-grandparent');
         case 'fatparsib':
             return I18N::translateContext('father’s parent’s sibling', 'great-aunt/uncle');
         case 'fatparsis':
             return I18N::translateContext('father’s parent’s sister', 'great-aunt');
         case 'fatsischi':
             return I18N::translateContext('father’s sister’s child', 'first cousin');
         case 'fatsisdau':
             return I18N::translateContext('father’s sister’s daughter', 'first cousin');
         case 'fatsishus':
             return I18N::translateContext('father’s sister’s husband', 'uncle');
         case 'fatsisson':
             return I18N::translateContext('father’s sister’s son', 'first cousin');
         case 'fatwifchi':
             return I18N::translateContext('father’s wife’s child', 'step-sibling');
         case 'fatwifdau':
             return I18N::translateContext('father’s wife’s daughter', 'step-sister');
         case 'fatwifson':
             return I18N::translateContext('father’s wife’s son', 'step-brother');
         case 'husbrowif':
             return I18N::translateContext('husband’s brother’s wife', 'sister-in-law');
         case 'hussishus':
             return I18N::translateContext('husband’s sister’s husband', 'brother-in-law');
         case 'motbrochi':
             return I18N::translateContext('mother’s brother’s child', 'first cousin');
         case 'motbrodau':
             return I18N::translateContext('mother’s brother’s daughter', 'first cousin');
         case 'motbroson':
             return I18N::translateContext('mother’s brother’s son', 'first cousin');
         case 'motbrowif':
             return I18N::translateContext('mother’s brother’s wife', 'aunt');
         case 'motfatbro':
             return I18N::translateContext('mother’s father’s brother', 'great-uncle');
         case 'motfatfat':
             return I18N::translateContext('mother’s father’s father', 'great-grandfather');
         case 'motfatmot':
             return I18N::translateContext('mother’s father’s mother', 'great-grandmother');
         case 'motfatpar':
             return I18N::translateContext('mother’s father’s parent', 'great-grandparent');
         case 'motfatsib':
             return I18N::translateContext('mother’s father’s sibling', 'great-aunt/uncle');
         case 'motfatsis':
             return I18N::translateContext('mother’s father’s sister', 'great-aunt');
         case 'mothuschi':
             return I18N::translateContext('mother’s husband’s child', 'step-sibling');
         case 'mothusdau':
             return I18N::translateContext('mother’s husband’s daughter', 'step-sister');
         case 'mothusson':
             return I18N::translateContext('mother’s husband’s son', 'step-brother');
         case 'motmotbro':
             return I18N::translateContext('mother’s mother’s brother', 'great-uncle');
         case 'motmotfat':
             return I18N::translateContext('mother’s mother’s father', 'great-grandfather');
         case 'motmotmot':
             return I18N::translateContext('mother’s mother’s mother', 'great-grandmother');
         case 'motmotpar':
             return I18N::translateContext('mother’s mother’s parent', 'great-grandparent');
         case 'motmotsib':
             return I18N::translateContext('mother’s mother’s sibling', 'great-aunt/uncle');
         case 'motmotsis':
             return I18N::translateContext('mother’s mother’s sister', 'great-aunt');
         case 'motparbro':
             return I18N::translateContext('mother’s parent’s brother', 'great-uncle');
         case 'motparfat':
             return I18N::translateContext('mother’s parent’s father', 'great-grandfather');
         case 'motparmot':
             return I18N::translateContext('mother’s parent’s mother', 'great-grandmother');
         case 'motparpar':
             return I18N::translateContext('mother’s parent’s parent', 'great-grandparent');
         case 'motparsib':
             return I18N::translateContext('mother’s parent’s sibling', 'great-aunt/uncle');
         case 'motparsis':
             return I18N::translateContext('mother’s parent’s sister', 'great-aunt');
         case 'motsischi':
             return I18N::translateContext('mother’s sister’s child', 'first cousin');
         case 'motsisdau':
             return I18N::translateContext('mother’s sister’s daughter', 'first cousin');
         case 'motsishus':
             return I18N::translateContext('mother’s sister’s husband', 'uncle');
         case 'motsisson':
             return I18N::translateContext('mother’s sister’s son', 'first cousin');
         case 'parbrowif':
             return I18N::translateContext('parent’s brother’s wife', 'aunt');
         case 'parfatbro':
             return I18N::translateContext('parent’s father’s brother', 'great-uncle');
         case 'parfatfat':
             return I18N::translateContext('parent’s father’s father', 'great-grandfather');
         case 'parfatmot':
             return I18N::translateContext('parent’s father’s mother', 'great-grandmother');
         case 'parfatpar':
             return I18N::translateContext('parent’s father’s parent', 'great-grandparent');
         case 'parfatsib':
             return I18N::translateContext('parent’s father’s sibling', 'great-aunt/uncle');
         case 'parfatsis':
             return I18N::translateContext('parent’s father’s sister', 'great-aunt');
         case 'parmotbro':
             return I18N::translateContext('parent’s mother’s brother', 'great-uncle');
         case 'parmotfat':
             return I18N::translateContext('parent’s mother’s father', 'great-grandfather');
         case 'parmotmot':
             return I18N::translateContext('parent’s mother’s mother', 'great-grandmother');
         case 'parmotpar':
             return I18N::translateContext('parent’s mother’s parent', 'great-grandparent');
         case 'parmotsib':
             return I18N::translateContext('parent’s mother’s sibling', 'great-aunt/uncle');
         case 'parmotsis':
             return I18N::translateContext('parent’s mother’s sister', 'great-aunt');
         case 'parparbro':
             return I18N::translateContext('parent’s parent’s brother', 'great-uncle');
         case 'parparfat':
             return I18N::translateContext('parent’s parent’s father', 'great-grandfather');
         case 'parparmot':
             return I18N::translateContext('parent’s parent’s mother', 'great-grandmother');
         case 'parparpar':
             return I18N::translateContext('parent’s parent’s parent', 'great-grandparent');
         case 'parparsib':
             return I18N::translateContext('parent’s parent’s sibling', 'great-aunt/uncle');
         case 'parparsis':
             return I18N::translateContext('parent’s parent’s sister', 'great-aunt');
         case 'parsishus':
             return I18N::translateContext('parent’s sister’s husband', 'uncle');
         case 'parspochi':
             return I18N::translateContext('parent’s spouse’s child', 'step-sibling');
         case 'parspodau':
             return I18N::translateContext('parent’s spouse’s daughter', 'step-sister');
         case 'parsposon':
             return I18N::translateContext('parent’s spouse’s son', 'step-brother');
         case 'sibchichi':
             return I18N::translateContext('sibling’s child’s child', 'great-nephew/niece');
         case 'sibchidau':
             return I18N::translateContext('sibling’s child’s daughter', 'great-niece');
         case 'sibchison':
             return I18N::translateContext('sibling’s child’s son', 'great-nephew');
         case 'sibdauchi':
             return I18N::translateContext('sibling’s daughter’s child', 'great-nephew/niece');
         case 'sibdaudau':
             return I18N::translateContext('sibling’s daughter’s daughter', 'great-niece');
         case 'sibdauhus':
             return I18N::translateContext('sibling’s daughter’s husband', 'nephew-in-law');
         case 'sibdauson':
             return I18N::translateContext('sibling’s daughter’s son', 'great-nephew');
         case 'sibsonchi':
             return I18N::translateContext('sibling’s son’s child', 'great-nephew/niece');
         case 'sibsondau':
             return I18N::translateContext('sibling’s son’s daughter', 'great-niece');
         case 'sibsonson':
             return I18N::translateContext('sibling’s son’s son', 'great-nephew');
         case 'sibsonwif':
             return I18N::translateContext('sibling’s son’s wife', 'niece-in-law');
         case 'sischichi':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) sister’s child’s child', 'great-nephew/niece');
             } else {
                 return I18N::translateContext('(a woman’s) sister’s child’s child', 'great-nephew/niece');
             }
         case 'sischidau':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) sister’s child’s daughter', 'great-niece');
             } else {
                 return I18N::translateContext('(a woman’s) sister’s child’s daughter', 'great-niece');
             }
         case 'sischison':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) sister’s child’s son', 'great-nephew');
             } else {
                 return I18N::translateContext('(a woman’s) sister’s child’s son', 'great-nephew');
             }
         case 'sisdauchi':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) sister’s daughter’s child', 'great-nephew/niece');
             } else {
                 return I18N::translateContext('(a woman’s) sister’s daughter’s child', 'great-nephew/niece');
             }
         case 'sisdaudau':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) sister’s daughter’s daughter', 'great-niece');
             } else {
                 return I18N::translateContext('(a woman’s) sister’s daughter’s daughter', 'great-niece');
             }
         case 'sisdauhus':
             return I18N::translateContext('sisters’s daughter’s husband', 'nephew-in-law');
         case 'sisdauson':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) sister’s daughter’s son', 'great-nephew');
             } else {
                 return I18N::translateContext('(a woman’s) sister’s daughter’s son', 'great-nephew');
             }
         case 'sishusbro':
             return I18N::translateContext('sister’s husband’s brother', 'brother-in-law');
         case 'sishussib':
             return I18N::translateContext('sister’s husband’s sibling', 'brother/sister-in-law');
         case 'sishussis':
             return I18N::translateContext('sister’s husband’s sister', 'sister-in-law');
         case 'sissonchi':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) sister’s son’s child', 'great-nephew/niece');
             } else {
                 return I18N::translateContext('(a woman’s) sister’s son’s child', 'great-nephew/niece');
             }
         case 'sissondau':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) sister’s son’s daughter', 'great-niece');
             } else {
                 return I18N::translateContext('(a woman’s) sister’s son’s daughter', 'great-niece');
             }
         case 'sissonson':
             if ($sex1 === 'M') {
                 return I18N::translateContext('(a man’s) sister’s son’s son', 'great-nephew');
             } else {
                 return I18N::translateContext('(a woman’s) sister’s son’s son', 'great-nephew');
             }
         case 'sissonwif':
             return I18N::translateContext('sisters’s son’s wife', 'niece-in-law');
         case 'sonchichi':
             return I18N::translateContext('son’s child’s child', 'great-grandchild');
         case 'sonchidau':
             return I18N::translateContext('son’s child’s daughter', 'great-granddaughter');
         case 'sonchison':
             return I18N::translateContext('son’s child’s son', 'great-grandson');
         case 'sondauchi':
             return I18N::translateContext('son’s daughter’s child', 'great-grandchild');
         case 'sondaudau':
             return I18N::translateContext('son’s daughter’s daughter', 'great-granddaughter');
         case 'sondauhus':
             return I18N::translateContext('son’s daughter’s husband', 'granddaughter’s husband');
         case 'sondauson':
             return I18N::translateContext('son’s daughter’s son', 'great-grandson');
         case 'sonsonchi':
             return I18N::translateContext('son’s son’s child', 'great-grandchild');
         case 'sonsondau':
             return I18N::translateContext('son’s son’s daughter', 'great-granddaughter');
         case 'sonsonson':
             return I18N::translateContext('son’s son’s son', 'great-grandson');
         case 'sonsonwif':
             return I18N::translateContext('son’s son’s wife', 'grandson’s wife');
         case 'sonwiffat':
             return I18N::translateContext('son’s wife’s father', 'daughter-in-law’s father');
         case 'sonwifmot':
             return I18N::translateContext('son’s wife’s mother', 'daughter-in-law’s mother');
         case 'sonwifpar':
             return I18N::translateContext('son’s wife’s parent', 'daughter-in-law’s parent');
         case 'wifbrowif':
             return I18N::translateContext('wife’s brother’s wife', 'sister-in-law');
         case 'wifsishus':
             return I18N::translateContext('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 I18N::translateContext('father’s father’s brother’s wife', 'great-aunt');
         case 'fatfatsibspo':
             return I18N::translateContext('father’s father’s sibling’s spouse', 'great-aunt/uncle');
         case 'fatfatsishus':
             return I18N::translateContext('father’s father’s sister’s husband', 'great-uncle');
         case 'fatmotbrowif':
             return I18N::translateContext('father’s mother’s brother’s wife', 'great-aunt');
         case 'fatmotsibspo':
             return I18N::translateContext('father’s mother’s sibling’s spouse', 'great-aunt/uncle');
         case 'fatmotsishus':
             return I18N::translateContext('father’s mother’s sister’s husband', 'great-uncle');
         case 'fatparbrowif':
             return I18N::translateContext('father’s parent’s brother’s wife', 'great-aunt');
         case 'fatparsibspo':
             return I18N::translateContext('father’s parent’s sibling’s spouse', 'great-aunt/uncle');
         case 'fatparsishus':
             return I18N::translateContext('father’s parent’s sister’s husband', 'great-uncle');
         case 'motfatbrowif':
             return I18N::translateContext('mother’s father’s brother’s wife', 'great-aunt');
         case 'motfatsibspo':
             return I18N::translateContext('mother’s father’s sibling’s spouse', 'great-aunt/uncle');
         case 'motfatsishus':
             return I18N::translateContext('mother’s father’s sister’s husband', 'great-uncle');
         case 'motmotbrowif':
             return I18N::translateContext('mother’s mother’s brother’s wife', 'great-aunt');
         case 'motmotsibspo':
             return I18N::translateContext('mother’s mother’s sibling’s spouse', 'great-aunt/uncle');
         case 'motmotsishus':
             return I18N::translateContext('mother’s mother’s sister’s husband', 'great-uncle');
         case 'motparbrowif':
             return I18N::translateContext('mother’s parent’s brother’s wife', 'great-aunt');
         case 'motparsibspo':
             return I18N::translateContext('mother’s parent’s sibling’s spouse', 'great-aunt/uncle');
         case 'motparsishus':
             return I18N::translateContext('mother’s parent’s sister’s husband', 'great-uncle');
         case 'parfatbrowif':
             return I18N::translateContext('parent’s father’s brother’s wife', 'great-aunt');
         case 'parfatsibspo':
             return I18N::translateContext('parent’s father’s sibling’s spouse', 'great-aunt/uncle');
         case 'parfatsishus':
             return I18N::translateContext('parent’s father’s sister’s husband', 'great-uncle');
         case 'parmotbrowif':
             return I18N::translateContext('parent’s mother’s brother’s wife', 'great-aunt');
         case 'parmotsibspo':
             return I18N::translateContext('parent’s mother’s sibling’s spouse', 'great-aunt/uncle');
         case 'parmotsishus':
             return I18N::translateContext('parent’s mother’s sister’s husband', 'great-uncle');
         case 'parparbrowif':
             return I18N::translateContext('parent’s parent’s brother’s wife', 'great-aunt');
         case 'parparsibspo':
             return I18N::translateContext('parent’s parent’s sibling’s spouse', 'great-aunt/uncle');
         case 'parparsishus':
             return I18N::translateContext('parent’s parent’s sister’s husband', 'great-uncle');
         case 'fatfatbrodau':
             return I18N::translateContext('father’s father’s brother’s daughter', 'first cousin once removed ascending');
         case 'fatfatbroson':
             return I18N::translateContext('father’s father’s brother’s son', 'first cousin once removed ascending');
         case 'fatfatbrochi':
             return I18N::translateContext('father’s father’s brother’s child', 'first cousin once removed ascending');
         case 'fatfatsisdau':
             return I18N::translateContext('father’s father’s sister’s daughter', 'first cousin once removed ascending');
         case 'fatfatsisson':
             return I18N::translateContext('father’s father’s sister’s son', 'first cousin once removed ascending');
         case 'fatfatsischi':
             return I18N::translateContext('father’s father’s sister’s child', 'first cousin once removed ascending');
         case 'fatmotbrodau':
             return I18N::translateContext('father’s mother’s brother’s daughter', 'first cousin once removed ascending');
         case 'fatmotbroson':
             return I18N::translateContext('father’s mother’s brother’s son', 'first cousin once removed ascending');
         case 'fatmotbrochi':
             return I18N::translateContext('father’s mother’s brother’s child', 'first cousin once removed ascending');
         case 'fatmotsisdau':
             return I18N::translateContext('father’s mother’s sister’s daughter', 'first cousin once removed ascending');
         case 'fatmotsisson':
             return I18N::translateContext('father’s mother’s sister’s son', 'first cousin once removed ascending');
         case 'fatmotsischi':
             return I18N::translateContext('father’s mother’s sister’s child', 'first cousin once removed ascending');
         case 'motfatbrodau':
             return I18N::translateContext('mother’s father’s brother’s daughter', 'first cousin once removed ascending');
         case 'motfatbroson':
             return I18N::translateContext('mother’s father’s brother’s son', 'first cousin once removed ascending');
         case 'motfatbrochi':
             return I18N::translateContext('mother’s father’s brother’s child', 'first cousin once removed ascending');
         case 'motfatsisdau':
             return I18N::translateContext('mother’s father’s sister’s daughter', 'first cousin once removed ascending');
         case 'motfatsisson':
             return I18N::translateContext('mother’s father’s sister’s son', 'first cousin once removed ascending');
         case 'motfatsischi':
             return I18N::translateContext('mother’s father’s sister’s child', 'first cousin once removed ascending');
         case 'motmotbrodau':
             return I18N::translateContext('mother’s mother’s brother’s daughter', 'first cousin once removed ascending');
         case 'motmotbroson':
             return I18N::translateContext('mother’s mother’s brother’s son', 'first cousin once removed ascending');
         case 'motmotbrochi':
             return I18N::translateContext('mother’s mother’s brother’s child', 'first cousin once removed ascending');
         case 'motmotsisdau':
             return I18N::translateContext('mother’s mother’s sister’s daughter', 'first cousin once removed ascending');
         case 'motmotsisson':
             return I18N::translateContext('mother’s mother’s sister’s son', 'first cousin once removed ascending');
         case 'motmotsischi':
             return I18N::translateContext('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 I18N::translateContext('grandfather’s brother’s granddaughter', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)fatbro(son|dau|chi)son$/', $path)) {
         return I18N::translateContext('grandfather’s brother’s grandson', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)fatbro(son|dau|chi)chi$/', $path)) {
         return I18N::translateContext('grandfather’s brother’s grandchild', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)fatsis(son|dau|chi)dau$/', $path)) {
         return I18N::translateContext('grandfather’s sister’s granddaughter', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)fatsis(son|dau|chi)son$/', $path)) {
         return I18N::translateContext('grandfather’s sister’s grandson', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)fatsis(son|dau|chi)chi$/', $path)) {
         return I18N::translateContext('grandfather’s sister’s grandchild', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)fatsib(son|dau|chi)dau$/', $path)) {
         return I18N::translateContext('grandfather’s sibling’s granddaughter', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)fatsib(son|dau|chi)son$/', $path)) {
         return I18N::translateContext('grandfather’s sibling’s grandson', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)fatsib(son|dau|chi)chi$/', $path)) {
         return I18N::translateContext('grandfather’s sibling’s grandchild', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)motbro(son|dau|chi)dau$/', $path)) {
         return I18N::translateContext('grandmother’s brother’s granddaughter', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)motbro(son|dau|chi)son$/', $path)) {
         return I18N::translateContext('grandmother’s brother’s grandson', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)motbro(son|dau|chi)chi$/', $path)) {
         return I18N::translateContext('grandmother’s brother’s grandchild', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)motsis(son|dau|chi)dau$/', $path)) {
         return I18N::translateContext('grandmother’s sister’s granddaughter', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)motsis(son|dau|chi)son$/', $path)) {
         return I18N::translateContext('grandmother’s sister’s grandson', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)motsis(son|dau|chi)chi$/', $path)) {
         return I18N::translateContext('grandmother’s sister’s grandchild', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)motsib(son|dau|chi)dau$/', $path)) {
         return I18N::translateContext('grandmother’s sibling’s granddaughter', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)motsib(son|dau|chi)son$/', $path)) {
         return I18N::translateContext('grandmother’s sibling’s grandson', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)motsib(son|dau|chi)chi$/', $path)) {
         return I18N::translateContext('grandmother’s sibling’s grandchild', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)parbro(son|dau|chi)dau$/', $path)) {
         return I18N::translateContext('grandparent’s brother’s granddaughter', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)parbro(son|dau|chi)son$/', $path)) {
         return I18N::translateContext('grandparent’s brother’s grandson', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)parbro(son|dau|chi)chi$/', $path)) {
         return I18N::translateContext('grandparent’s brother’s grandchild', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)parsis(son|dau|chi)dau$/', $path)) {
         return I18N::translateContext('grandparent’s sister’s granddaughter', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)parsis(son|dau|chi)son$/', $path)) {
         return I18N::translateContext('grandparent’s sister’s grandson', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)parsis(son|dau|chi)chi$/', $path)) {
         return I18N::translateContext('grandparent’s sister’s grandchild', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)parsib(son|dau|chi)dau$/', $path)) {
         return I18N::translateContext('grandparent’s sibling’s granddaughter', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)parsib(son|dau|chi)son$/', $path)) {
         return I18N::translateContext('grandparent’s sibling’s grandson', 'second cousin');
     } elseif (preg_match('/^(mot|fat|par)parsib(son|dau|chi)chi$/', $path)) {
         return I18N::translateContext('grandparent’s sibling’s grandchild', 'second cousin');
     }
     // Look for generic/pattern relationships.
     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 I18N::translateContext('great-grandfather’s brother', 'great-great-uncle');
                         } elseif ($bef_last === 'mot') {
                             return I18N::translateContext('great-grandmother’s brother', 'great-great-uncle');
                         } else {
                             return I18N::translateContext('great-grandparent’s brother', 'great-great-uncle');
                         }
                     case 'F':
                         return I18N::translate('great-great-aunt');
                     default:
                         return I18N::translate('great-great-aunt/uncle');
                 }
             case 4:
                 switch ($sex2) {
                     case 'M':
                         if ($bef_last === 'fat') {
                             return I18N::translateContext('great-great-grandfather’s brother', 'great-great-great-uncle');
                         } elseif ($bef_last === 'mot') {
                             return I18N::translateContext('great-great-grandmother’s brother', 'great-great-great-uncle');
                         } else {
                             return I18N::translateContext('great-great-grandparent’s brother', 'great-great-great-uncle');
                         }
                     case 'F':
                         return I18N::translate('great-great-great-aunt');
                     default:
                         return I18N::translate('great-great-great-aunt/uncle');
                 }
             case 5:
                 switch ($sex2) {
                     case 'M':
                         if ($bef_last === 'fat') {
                             return I18N::translateContext('great-great-great-grandfather’s brother', 'great ×4 uncle');
                         } elseif ($bef_last === 'mot') {
                             return I18N::translateContext('great-great-great-grandmother’s brother', 'great ×4 uncle');
                         } else {
                             return I18N::translateContext('great-great-great-grandparent’s brother', 'great ×4 uncle');
                         }
                     case 'F':
                         return I18N::translate('great ×4 aunt');
                     default:
                         return I18N::translate('great ×4 aunt/uncle');
                 }
             case 6:
                 switch ($sex2) {
                     case 'M':
                         if ($bef_last === 'fat') {
                             return I18N::translateContext('great ×4 grandfather’s brother', 'great ×5 uncle');
                         } elseif ($bef_last === 'mot') {
                             return I18N::translateContext('great ×4 grandmother’s brother', 'great ×5 uncle');
                         } else {
                             return I18N::translateContext('great ×4 grandparent’s brother', 'great ×5 uncle');
                         }
                     case 'F':
                         return I18N::translate('great ×5 aunt');
                     default:
                         return I18N::translate('great ×5 aunt/uncle');
                 }
             case 7:
                 switch ($sex2) {
                     case 'M':
                         if ($bef_last === 'fat') {
                             return I18N::translateContext('great ×5 grandfather’s brother', 'great ×6 uncle');
                         } elseif ($bef_last === 'mot') {
                             return I18N::translateContext('great ×5 grandmother’s brother', 'great ×6 uncle');
                         } else {
                             return I18N::translateContext('great ×5 grandparent’s brother', 'great ×6 uncle');
                         }
                     case 'F':
                         return I18N::translate('great ×6 aunt');
                     default:
                         return I18N::translate('great ×6 aunt/uncle');
                 }
             case 8:
                 switch ($sex2) {
                     case 'M':
                         if ($bef_last === 'fat') {
                             return I18N::translateContext('great ×6 grandfather’s brother', 'great ×7 uncle');
                         } elseif ($bef_last === 'mot') {
                             return I18N::translateContext('great ×6 grandmother’s brother', 'great ×7 uncle');
                         } else {
                             return I18N::translateContext('great ×6 grandparent’s brother', 'great ×7 uncle');
                         }
                     case 'F':
                         return I18N::translate('great ×7 aunt');
                     default:
                         return I18N::translate('great ×7 aunt/uncle');
                 }
             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 I18N::translate('great ×%s uncle', I18N::number($up - 4));
                             case 'F':
                                 return I18N::translate('great ×%s aunt', I18N::number($up - 4));
                             default:
                                 return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 4));
                         }
                     case 'pl':
                         switch ($sex2) {
                             case 'M':
                                 if ($bef_last === 'fat') {
                                     return I18N::translateContext('great ×(%s-1) grandfather’s brother', 'great ×%s uncle', I18N::number($up - 2));
                                 } elseif ($bef_last === 'mot') {
                                     return I18N::translateContext('great ×(%s-1) grandmother’s brother', 'great ×%s uncle', I18N::number($up - 2));
                                 } else {
                                     return I18N::translateContext('great ×(%s-1) grandparent’s brother', 'great ×%s uncle', I18N::number($up - 2));
                                 }
                             case 'F':
                                 return I18N::translate('great ×%s aunt', I18N::number($up - 2));
                             default:
                                 return I18N::translate('great ×%s aunt/uncle', I18N::number($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 %s, contact the developers, as a code-change is required
                                 return I18N::translate('great ×%s uncle', I18N::number($up - 1));
                             case 'F':
                                 return I18N::translate('great ×%s aunt', I18N::number($up - 1));
                             default:
                                 return I18N::translate('great ×%s aunt/uncle', I18N::number($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 I18N::translateContext('(a man’s) brother’s great-grandson', 'great-great-nephew');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great-grandson', 'great-great-nephew');
                         } else {
                             return I18N::translateContext('(a woman’s) great-great-nephew', 'great-great-nephew');
                         }
                     case 'F':
                         if ($first === 'bro' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) brother’s great-granddaughter', 'great-great-niece');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great-granddaughter', 'great-great-niece');
                         } else {
                             return I18N::translateContext('(a woman’s) great-great-niece', 'great-great-niece');
                         }
                     default:
                         if ($first === 'bro' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) brother’s great-grandchild', 'great-great-nephew/niece');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great-grandchild', 'great-great-nephew/niece');
                         } else {
                             return I18N::translateContext('(a woman’s) great-great-nephew/niece', 'great-great-nephew/niece');
                         }
                 }
             case 5:
                 switch ($sex2) {
                     case 'M':
                         if ($first === 'bro' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) brother’s great-great-grandson', 'great-great-great-nephew');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great-great-grandson', 'great-great-great-nephew');
                         } else {
                             return I18N::translateContext('(a woman’s) great-great-great-nephew', 'great-great-great-nephew');
                         }
                     case 'F':
                         if ($first === 'bro' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) brother’s great-great-granddaughter', 'great-great-great-niece');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great-great-granddaughter', 'great-great-great-niece');
                         } else {
                             return I18N::translateContext('(a woman’s) great-great-great-niece', 'great-great-great-niece');
                         }
                     default:
                         if ($first === 'bro' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) brother’s great-great-grandchild', 'great-great-great-nephew/niece');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great-great-grandchild', 'great-great-great-nephew/niece');
                         } else {
                             return I18N::translateContext('(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 I18N::translateContext('(a man’s) brother’s great-great-great-grandson', 'great ×4 nephew');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great-great-great-grandson', 'great ×4 nephew');
                         } else {
                             return I18N::translateContext('(a woman’s) great ×4 nephew', 'great ×4 nephew');
                         }
                     case 'F':
                         if ($first === 'bro' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) brother’s great-great-great-granddaughter', 'great ×4 niece');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great-great-great-granddaughter', 'great ×4 niece');
                         } else {
                             return I18N::translateContext('(a woman’s) great ×4 niece', 'great ×4 niece');
                         }
                     default:
                         if ($first === 'bro' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) brother’s great-great-great-grandchild', 'great ×4 nephew/niece');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great-great-great-grandchild', 'great ×4 nephew/niece');
                         } else {
                             return I18N::translateContext('(a woman’s) great ×4 nephew/niece', 'great ×4 nephew/niece');
                         }
                 }
             case 7:
                 switch ($sex2) {
                     case 'M':
                         if ($first === 'bro' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) brother’s great ×4 grandson', 'great ×5 nephew');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great ×4 grandson', 'great ×5 nephew');
                         } else {
                             return I18N::translateContext('(a woman’s) great ×5 nephew', 'great ×5 nephew');
                         }
                     case 'F':
                         if ($first === 'bro' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) brother’s great ×4 granddaughter', 'great ×5 niece');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great ×4 granddaughter', 'great ×5 niece');
                         } else {
                             return I18N::translateContext('(a woman’s) great ×5 niece', 'great ×5 niece');
                         }
                     default:
                         if ($first === 'bro' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) brother’s great ×4 grandchild', 'great ×5 nephew/niece');
                         } elseif ($first === 'sis' && $sex1 === 'M') {
                             return I18N::translateContext('(a man’s) sister’s great ×4 grandchild', 'great ×5 nephew/niece');
                         } else {
                             return I18N::translateContext('(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 I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
                                 } elseif ($first === 'sis' && $sex1 === 'M') {
                                     return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
                                 } else {
                                     return I18N::translateContext('(a woman’s) great ×%s nephew', 'great ×%s nephew', I18N::number($down - 3));
                                 }
                             case 'F':
                                 if ($first === 'bro' && $sex1 === 'M') {
                                     return I18N::translateContext('(a man’s) brother’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
                                 } elseif ($first === 'sis' && $sex1 === 'M') {
                                     return I18N::translateContext('(a man’s) sister’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
                                 } else {
                                     return I18N::translateContext('(a woman’s) great ×%s niece', 'great ×%s niece', I18N::number($down - 3));
                                 }
                             default:
                                 if ($first === 'bro' && $sex1 === 'M') {
                                     return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandchild', 'great ×%s nephew/niece', I18N::number($down - 3));
                                 } elseif ($first === 'sis' && $sex1 === 'M') {
                                     return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandchild', 'great ×%s nephew/niece', I18N::number($down - 3));
                                 } else {
                                     return I18N::translateContext('(a woman’s) great ×%s nephew/niece', 'great ×%s nephew/niece', I18N::number($down - 3));
                                 }
                         }
                     case 'he':
                         // Source: Meliza Amity
                         switch ($sex2) {
                             case 'M':
                                 return I18N::translate('great ×%s nephew', I18N::number($down - 1));
                             case 'F':
                                 return I18N::translate('great ×%s niece', I18N::number($down - 1));
                             default:
                                 return I18N::translate('great ×%s nephew/niece', I18N::number($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 %s, contact the developers, as a code-change is required
                                 return I18N::translate('great ×%s nephew', I18N::number($down - 2));
                             case 'F':
                                 return I18N::translate('great ×%s niece', I18N::number($down - 2));
                             default:
                                 return I18N::translate('great ×%s nephew/niece', I18N::number($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 I18N::translate('great-great-grandfather');
                     case 'F':
                         return I18N::translate('great-great-grandmother');
                     default:
                         return I18N::translate('great-great-grandparent');
                 }
             case 5:
                 switch ($sex2) {
                     case 'M':
                         return I18N::translate('great-great-great-grandfather');
                     case 'F':
                         return I18N::translate('great-great-great-grandmother');
                     default:
                         return I18N::translate('great-great-great-grandparent');
                 }
             case 6:
                 switch ($sex2) {
                     case 'M':
                         return I18N::translate('great ×4 grandfather');
                     case 'F':
                         return I18N::translate('great ×4 grandmother');
                     default:
                         return I18N::translate('great ×4 grandparent');
                 }
             case 7:
                 switch ($sex2) {
                     case 'M':
                         return I18N::translate('great ×5 grandfather');
                     case 'F':
                         return I18N::translate('great ×5 grandmother');
                     default:
                         return I18N::translate('great ×5 grandparent');
                 }
             case 8:
                 switch ($sex2) {
                     case 'M':
                         return I18N::translate('great ×6 grandfather');
                     case 'F':
                         return I18N::translate('great ×6 grandmother');
                     default:
                         return I18N::translate('great ×6 grandparent');
                 }
             case 9:
                 switch ($sex2) {
                     case 'M':
                         return I18N::translate('great ×7 grandfather');
                     case 'F':
                         return I18N::translate('great ×7 grandmother');
                     default:
                         return I18N::translate('great ×7 grandparent');
                 }
             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 I18N::translate('great ×%s grandfather', I18N::number($up - 3));
                             case 'F':
                                 return I18N::translate('great ×%s grandmother', I18N::number($up - 3));
                             default:
                                 return I18N::translate('great ×%s grandparent', I18N::number($up - 3));
                         }
                     case 'it':
                         // Source: Michele Locati
                     // Source: Michele Locati
                     case 'es':
                         // Source: Wes Groleau
                         switch ($sex2) {
                             case 'M':
                                 return I18N::translate('great ×%s grandfather', I18N::number($up));
                             case 'F':
                                 return I18N::translate('great ×%s grandmother', I18N::number($up));
                             default:
                                 return I18N::translate('great ×%s grandparent', I18N::number($up));
                         }
                     case 'fr':
                         // Source: Jacqueline Tetreault
                     // Source: Jacqueline Tetreault
                     case 'fr_CA':
                         switch ($sex2) {
                             case 'M':
                                 return I18N::translate('great ×%s grandfather', I18N::number($up - 1));
                             case 'F':
                                 return I18N::translate('great ×%s grandmother', I18N::number($up - 1));
                             default:
                                 return I18N::translate('great ×%s grandparent', I18N::number($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 %s, contact the developers, as a code-change is required
                                 return I18N::translate('great ×%s grandfather', I18N::number($up - 3));
                             case 'F':
                                 return I18N::translate('great ×%s grandmother', I18N::number($up - 3));
                             default:
                                 return I18N::translate('great ×%s grandparent', I18N::number($up - 3));
                         }
                     case 'en_AU':
                     case 'en_GB':
                     case 'en_US':
                     default:
                         switch ($sex2) {
                             case 'M':
                                 // I18N: if you need a different number for %s, contact the developers, as a code-change is required
                                 return I18N::translate('great ×%s grandfather', I18N::number($up - 2));
                             case 'F':
                                 return I18N::translate('great ×%s grandmother', I18N::number($up - 2));
                             default:
                                 return I18N::translate('great ×%s grandparent', I18N::number($up - 2));
                         }
                 }
         }
     }
     if (preg_match('/^((?:son|dau|chi)*)$/', $path, $match)) {
         // direct descendants
         $up = strlen($match[1]) / 3;
         switch ($up) {
             case 4:
                 switch ($sex2) {
                     case 'M':
                         return I18N::translate('great-great-grandson');
                     case 'F':
                         return I18N::translate('great-great-granddaughter');
                     default:
                         return I18N::translate('great-great-grandchild');
                 }
             case 5:
                 switch ($sex2) {
                     case 'M':
                         return I18N::translate('great-great-great-grandson');
                     case 'F':
                         return I18N::translate('great-great-great-granddaughter');
                     default:
                         return I18N::translate('great-great-great-grandchild');
                 }
             case 6:
                 switch ($sex2) {
                     case 'M':
                         return I18N::translate('great ×4 grandson');
                     case 'F':
                         return I18N::translate('great ×4 granddaughter');
                     default:
                         return I18N::translate('great ×4 grandchild');
                 }
             case 7:
                 switch ($sex2) {
                     case 'M':
                         return I18N::translate('great ×5 grandson');
                     case 'F':
                         return I18N::translate('great ×5 granddaughter');
                     default:
                         return I18N::translate('great ×5 grandchild');
                 }
             case 8:
                 switch ($sex2) {
                     case 'M':
                         return I18N::translate('great ×6 grandson');
                     case 'F':
                         return I18N::translate('great ×6 granddaughter');
                     default:
                         return I18N::translate('great ×6 grandchild');
                 }
             case 9:
                 switch ($sex2) {
                     case 'M':
                         return I18N::translate('great ×7 grandson');
                     case 'F':
                         return I18N::translate('great ×7 granddaughter');
                     default:
                         return I18N::translate('great ×7 grandchild');
                 }
             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 I18N::translate('great ×%s grandson', I18N::number($up - 3));
                             case 'F':
                                 return I18N::translate('great ×%s granddaughter', I18N::number($up - 3));
                             default:
                                 return I18N::translate('great ×%s grandchild', I18N::number($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 %s, contact the developers, as a code-change is required
                                 return I18N::translate('great ×%s grandson', I18N::number($up - 2));
                             case 'F':
                                 return I18N::translate('great ×%s granddaughter', I18N::number($up - 2));
                             default:
                                 return I18N::translate('great ×%s grandchild', I18N::number($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 self::cousinName($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 self::cousinName($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 self::cousinName($cousin, $sex2);
                 } elseif ($down < $up) {
                     return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sib' . $descent, null, null));
                 } else {
                     switch ($sex2) {
                         case 'M':
                             return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('bro' . $descent, null, null));
                         case 'F':
                             return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sis' . $descent, null, null));
                         default:
                             return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('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 self::cousinName($cousin, $sex2);
                     case 1:
                         if ($up > $down) {
                             /* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
                             return I18N::translate('%s once removed ascending', self::cousinName($cousin, $sex2));
                         } else {
                             /* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
                             return I18N::translate('%s once removed descending', self::cousinName($cousin, $sex2));
                         }
                     case 2:
                         if ($up > $down) {
                             /* I18N: %s=“fifth cousin”, etc. */
                             return I18N::translate('%s twice removed ascending', self::cousinName($cousin, $sex2));
                         } else {
                             /* I18N: %s=“fifth cousin”, etc. */
                             return I18N::translate('%s twice removed descending', self::cousinName($cousin, $sex2));
                         }
                     case 3:
                         if ($up > $down) {
                             /* I18N: %s=“fifth cousin”, etc. */
                             return I18N::translate('%s three times removed ascending', self::cousinName($cousin, $sex2));
                         } else {
                             /* I18N: %s=“fifth cousin”, etc. */
                             return I18N::translate('%s three times removed descending', self::cousinName($cousin, $sex2));
                         }
                     default:
                         if ($up > $down) {
                             /* I18N: %1$s=“fifth cousin”, etc., %2$s>=4 */
                             return I18N::translate('%1$s %2$s times removed ascending', self::cousinName($cousin, $sex2), I18N::number($removed));
                         } else {
                             /* I18N: %1$s=“fifth cousin”, etc., %2$s>=4 */
                             return I18N::translate('%1$s %2$s times removed descending', self::cousinName($cousin, $sex2), I18N::number($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 = I18N::translate('%1$s’s %2$s', self::getRelationshipNameFromPath($path1, null, null), self::getRelationshipNameFromPath($path2, null, null));
         if (!$relationship || strlen($tmp) < strlen($relationship)) {
             $relationship = $tmp;
         }
         $path1 .= substr($path2, 0, 3);
         $path2 = substr($path2, 3);
     }
     return $relationship;
 }
Beispiel #20
0
 /**
  * Abbreviated month name
  *
  * @param int  $month_number
  * @param bool $leap_year    Some calendars use leap months
  *
  * @return string
  */
 protected function monthNameAbbreviated($month_number, $leap_year)
 {
     static $translated_month_names;
     if ($translated_month_names === null) {
         $translated_month_names = array(0 => '', 1 => I18N::translateContext('Abbreviation for Persian month: Farvardin', 'Far'), 2 => I18N::translateContext('Abbreviation for Persian month: Ordibehesht', 'Ord'), 3 => I18N::translateContext('Abbreviation for Persian month: Khordad', 'Khor'), 4 => I18N::translateContext('Abbreviation for Persian month: Tir', 'Tir'), 5 => I18N::translateContext('Abbreviation for Persian month: Mordad', 'Mor'), 6 => I18N::translateContext('Abbreviation for Persian month: Shahrivar', 'Shah'), 7 => I18N::translateContext('Abbreviation for Persian month: Mehr', 'Mehr'), 8 => I18N::translateContext('Abbreviation for Persian month: Aban', 'Aban'), 9 => I18N::translateContext('Abbreviation for Persian month: Azar', 'Azar'), 10 => I18N::translateContext('Abbreviation for Persian month: Dey', 'Dey'), 11 => I18N::translateContext('Abbreviation for Persian month: Bahman', 'Bah'), 12 => I18N::translateContext('Abbreviation for Persian month: Esfand', 'Esf'));
     }
     return $translated_month_names[$month_number];
 }
Beispiel #21
0
				<?php 
echo I18N::translate('Individual record');
?>
			</div>
			<div class="value">
				<?php 
if ($my_individual_record) {
    ?>
				<?php 
    echo $my_individual_record->formatList('span');
    ?>
				<?php 
} else {
    ?>
					<?php 
    echo I18N::translateContext('unknown people', 'Unknown');
    ?>
				<?php 
}
?>
				<p class="small text-muted">
					<?php 
echo I18N::translate('This is a link to your own record in the family tree. If this is the wrong individual, contact an administrator.');
?>
				</p>
			</div>

			<div class="label">
				<label for="form_rootid">
					<?php 
echo I18N::translate('Default individual');
				<?php 
    echo I18N::translate('first');
    ?>
 /<?php 
    echo I18N::translate('last');
    ?>
			</label>
			<label class="sr-only" for="SHOW_PEDIGREE_PLACES">
				<?php 
    echo I18N::translate('Abbreviate place names');
    ?>
			</label>
		</legend>
		<div class="col-sm-9">
			<?php 
    echo I18N::translate('Show the %1$s %2$s parts of a place name.', FunctionsEdit::selectEditControl('SHOW_PEDIGREE_PLACES_SUFFIX', array(false => I18N::translateContext('Show the [first/last] [N] parts of a place name.', 'first'), true => I18N::translateContext('Show the [first/last] [N] parts of a place name.', 'last')), null, $WT_TREE->getPreference('SHOW_PEDIGREE_PLACES_SUFFIX')), FunctionsEdit::selectEditControl('SHOW_PEDIGREE_PLACES', $one_to_nine, null, $WT_TREE->getPreference('SHOW_PEDIGREE_PLACES')));
    ?>
			<p class="small text-muted">
				<?php 
    echo I18N::translate('Place names are frequently too long to fit on charts, lists, etc. They can be abbreviated by showing just the first few parts of the name, such as <i>village, county</i>, or the last few part of it, such as <i>region, country</i>.');
    ?>
			</p>
		</div>
	</fieldset>

		<!-- GEONAMES_ACCOUNT -->
		<div class="form-group">
			<label class="control-label col-sm-3" for="GEONAMES_ACCOUNT">
				<?php 
    echo I18N::translate('Use the GeoNames database for autocomplete on places');
    ?>
Beispiel #23
0
    /**
     * javascript declaration for calendar popup
     */
    public static function initializeCalendarPopup()
    {
        global $controller;
        $controller->addInlineJavascript('
			cal_setMonthNames(
				"' . I18N::translateContext('NOMINATIVE', 'January') . '",
				"' . I18N::translateContext('NOMINATIVE', 'February') . '",
				"' . I18N::translateContext('NOMINATIVE', 'March') . '",
				"' . I18N::translateContext('NOMINATIVE', 'April') . '",
				"' . I18N::translateContext('NOMINATIVE', 'May') . '",
				"' . I18N::translateContext('NOMINATIVE', 'June') . '",
				"' . I18N::translateContext('NOMINATIVE', 'July') . '",
				"' . I18N::translateContext('NOMINATIVE', 'August') . '",
				"' . I18N::translateContext('NOMINATIVE', 'September') . '",
				"' . I18N::translateContext('NOMINATIVE', 'October') . '",
				"' . I18N::translateContext('NOMINATIVE', 'November') . '",
				"' . I18N::translateContext('NOMINATIVE', 'December') . '"
			)
			cal_setDayHeaders(
				"' . I18N::translate('Sun') . '",
				"' . I18N::translate('Mon') . '",
				"' . I18N::translate('Tue') . '",
				"' . I18N::translate('Wed') . '",
				"' . I18N::translate('Thu') . '",
				"' . I18N::translate('Fri') . '",
				"' . I18N::translate('Sat') . '"
			)
			cal_setWeekStart(' . I18N::firstDay() . ');
		');
    }
Beispiel #24
0
 }
 // Don't sublists short lists.
 if ($count < $WT_TREE->getPreference('SUBLIST_TRIGGER_I')) {
     $falpha = '';
     $show_all_firstnames = 'no';
 } else {
     $givn_initials = QueryName::givenAlpha($WT_TREE, $surname, $alpha, $show_marnm === 'yes', false);
     // Break long lists by initial letter of given name
     if ($surname || $show_all === 'yes') {
         // Don't show the list until we have some filter criteria
         $show = $falpha || $show_all_firstnames === 'yes' ? 'indi' : 'none';
         $list = array();
         foreach ($givn_initials as $givn_initial => $count) {
             switch ($givn_initial) {
                 case '@':
                     $html = I18N::translateContext('Unknown given name', '…');
                     break;
                 default:
                     $html = Filter::escapeHtml($givn_initial);
                     break;
             }
             if ($count) {
                 if ($show === 'indi' && $givn_initial === $falpha && $show_all_firstnames === 'no') {
                     $list[] = '<a class="warning" href="' . $url . '&amp;falpha=' . rawurlencode($givn_initial) . '" title="' . I18N::number($count) . '">' . $html . '</a>';
                 } else {
                     $list[] = '<a href="' . $url . '&amp;falpha=' . rawurlencode($givn_initial) . '" title="' . I18N::number($count) . '">' . $html . '</a>';
                 }
             } else {
                 $list[] = $html;
             }
         }
Beispiel #25
0
use Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
use Fisharebest\Webtrees\Functions\FunctionsPrintLists;
define('WT_SCRIPT_NAME', 'mediaviewer.php');
require './includes/session.php';
$controller = new MediaController();
if ($controller->record && $controller->record->canShow()) {
    $controller->pageHeader();
    if ($controller->record->isPendingDeletion()) {
        if (Auth::isModerator($controller->record->getTree())) {
            echo '<p class="ui-state-highlight">', I18N::translate('This media object has been deleted.  You should review the deletion and then %1$s or %2$s it.', '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>'), ' ', FunctionsPrint::helpLink('pending_changes'), '</p>';
        } elseif (Auth::isEditor($controller->record->getTree())) {
            echo '<p class="ui-state-highlight">', I18N::translate('This media object has been deleted.  The deletion will need to be reviewed by a moderator.'), ' ', FunctionsPrint::helpLink('pending_changes'), '</p>';
        }
    } elseif ($controller->record->isPendingAddtion()) {
        if (Auth::isModerator($controller->record->getTree())) {
            echo '<p class="ui-state-highlight">', I18N::translate('This media object has been edited.  You should review the changes and then %1$s or %2$s them.', '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>'), ' ', FunctionsPrint::helpLink('pending_changes'), '</p>';
        } elseif (Auth::isEditor($controller->record->getTree())) {
            echo '<p class="ui-state-highlight">', I18N::translate('This media object has been edited.  The changes need to be reviewed by a moderator.'), ' ', FunctionsPrint::helpLink('pending_changes'), '</p>';
        }
    }
} else {
    http_response_code(404);
    $controller->pageHeader();
    echo '<p class="ui-state-error">', I18N::translate('This media object does not exist or you do not have permission to view it.'), '</p>';
    return;
}
$controller->addInlineJavascript('
	jQuery("#media-tabs")
		.tabs({
			create: function(e, ui){
				jQuery(e.target).css("visibility", "visible");  // prevent FOUC
Beispiel #26
0
 /**
  * Create a short name for compact display on charts
  *
  * @return string
  */
 public function getShortName()
 {
     global $bwidth;
     // Estimate number of characters that can fit in box. Calulates to 28 characters in webtrees theme, or 34 if no thumbnail used.
     if ($this->tree->getPreference('SHOW_HIGHLIGHT_IMAGES')) {
         $char = intval(($bwidth - 40) / 6.5);
     } else {
         $char = $bwidth / 6.5;
     }
     if ($this->canShowName()) {
         $tmp = $this->getAllNames();
         $givn = $tmp[$this->getPrimaryName()]['givn'];
         $surn = $tmp[$this->getPrimaryName()]['surname'];
         $new_givn = explode(' ', $givn);
         $count_givn = count($new_givn);
         $len_givn = mb_strlen($givn);
         $len_surn = mb_strlen($surn);
         $len = $len_givn + $len_surn;
         $i = 1;
         while ($len > $char && $i <= $count_givn) {
             $new_givn[$count_givn - $i] = mb_substr($new_givn[$count_givn - $i], 0, 1);
             $givn = implode(' ', $new_givn);
             $len_givn = mb_strlen($givn);
             $len = $len_givn + $len_surn;
             $i++;
         }
         $max_surn = $char - $i * 2;
         if ($len_surn > $max_surn) {
             $surn = substr($surn, 0, $max_surn) . '…';
         }
         $shortname = str_replace(array('@P.N.', '@N.N.'), array(I18N::translateContext('Unknown given name', '…'), I18N::translateContext('Unknown surname', '…')), $givn . ' ' . $surn);
         return $shortname;
     } else {
         return I18N::translate('Private');
     }
 }
Beispiel #27
0
 /**
  * Translate a tag, for an (optional) record
  *
  * @param string               $tag
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getLabel($tag, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($tag) {
         case 'ABBR':
             return I18N::translate('Abbreviation');
         case 'ADDR':
             return I18N::translate('Address');
         case 'ADR1':
             return I18N::translate('Address line 1');
         case 'ADR2':
             return I18N::translate('Address line 2');
         case 'ADOP':
             return I18N::translate('Adoption');
         case 'ADOP:DATE':
             return I18N::translate('Date of adoption');
         case 'ADOP:PLAC':
             return I18N::translate('Place of adoption');
         case 'AFN':
             return I18N::translate('Ancestral file number');
         case 'AGE':
             return I18N::translate('Age');
         case 'AGNC':
             return I18N::translate('Agency');
         case 'ALIA':
             return I18N::translate('Alias');
         case 'ANCE':
             return I18N::translate('Generations of ancestors');
         case 'ANCI':
             return I18N::translate('Ancestors interest');
         case 'ANUL':
             return I18N::translate('Annulment');
         case 'ASSO':
             return I18N::translate('Associate');
             /* see also _ASSO */
         /* see also _ASSO */
         case 'AUTH':
             return I18N::translate('Author');
         case 'BAPL':
             return I18N::translate('LDS baptism');
         case 'BAPL:DATE':
             return I18N::translate('Date of LDS baptism');
         case 'BAPL:PLAC':
             return I18N::translate('Place of LDS baptism');
         case 'BAPM':
             return I18N::translate('Baptism');
         case 'BAPM:DATE':
             return I18N::translate('Date of baptism');
         case 'BAPM:PLAC':
             return I18N::translate('Place of baptism');
         case 'BARM':
             return I18N::translate('Bar mitzvah');
         case 'BARM:DATE':
             return I18N::translate('Date of bar mitzvah');
         case 'BARM:PLAC':
             return I18N::translate('Place of bar mitzvah');
         case 'BASM':
             return I18N::translate('Bat mitzvah');
         case 'BASM:DATE':
             return I18N::translate('Date of bat mitzvah');
         case 'BASM:PLAC':
             return I18N::translate('Place of bat mitzvah');
         case 'BIRT':
             return I18N::translate('Birth');
         case 'BIRT:DATE':
             return I18N::translate('Date of birth');
         case 'BIRT:PLAC':
             return I18N::translate('Place of birth');
         case 'BLES':
             return I18N::translate('Blessing');
         case 'BLES:DATE':
             return I18N::translate('Date of blessing');
         case 'BLES:PLAC':
             return I18N::translate('Place of blessing');
         case 'BLOB':
             return I18N::translate('Binary data object');
         case 'BURI':
             return I18N::translate('Burial');
         case 'BURI:DATE':
             return I18N::translate('Date of burial');
         case 'BURI:PLAC':
             return I18N::translate('Place of burial');
         case 'CALN':
             return I18N::translate('Call number');
         case 'CAST':
             return I18N::translate('Caste');
         case 'CAUS':
             return I18N::translate('Cause');
         case 'CEME':
             return I18N::translate('Cemetery');
         case 'CENS':
             return I18N::translate('Census');
         case 'CENS:DATE':
             return I18N::translate('Census date');
         case 'CENS:PLAC':
             return I18N::translate('Census place');
         case 'CHAN':
             return I18N::translate('Last change');
         case 'CHAN:DATE':
             return I18N::translate('Date of last change');
         case 'CHAN:_WT_USER':
             return I18N::translate('Author of last change');
         case 'CHAR':
             return I18N::translate('Character set');
         case 'CHIL':
             return I18N::translate('Child');
         case 'CHR':
             return I18N::translate('Christening');
         case 'CHR:DATE':
             return I18N::translate('Date of christening');
         case 'CHR:PLAC':
             return I18N::translate('Place of christening');
         case 'CHRA':
             return I18N::translate('Adult christening');
         case 'CITN':
             return I18N::translate('Citizenship');
         case 'CITY':
             return I18N::translate('City');
         case 'COMM':
             return I18N::translate('Comment');
         case 'CONC':
             return I18N::translate('Concatenation');
         case 'CONT':
             return I18N::translate('Continued');
         case 'CONF':
             return I18N::translate('Confirmation');
         case 'CONF:DATE':
             return I18N::translate('Date of confirmation');
         case 'CONF:PLAC':
             return I18N::translate('Place of confirmation');
         case 'CONL':
             return I18N::translate('LDS confirmation');
         case 'COPR':
             return I18N::translate('Copyright');
         case 'CORP':
             return I18N::translate('Corporation');
         case 'CREM':
             return I18N::translate('Cremation');
         case 'CREM:DATE':
             return I18N::translate('Date of cremation');
         case 'CREM:PLAC':
             return I18N::translate('Place of cremation');
         case 'CTRY':
             return I18N::translate('Country');
         case 'DATA':
             return I18N::translate('Data');
         case 'DATA:DATE':
             return I18N::translate('Date of entry in original source');
         case 'DATE':
             return I18N::translate('Date');
         case 'DEAT':
             return I18N::translate('Death');
         case 'DEAT:CAUS':
             return I18N::translate('Cause of death');
         case 'DEAT:DATE':
             return I18N::translate('Date of death');
         case 'DEAT:PLAC':
             return I18N::translate('Place of death');
         case 'DESC':
             return I18N::translate('Descendants');
         case 'DESI':
             return I18N::translate('Descendants interest');
         case 'DEST':
             return I18N::translate('Destination');
         case 'DIV':
             return I18N::translate('Divorce');
         case 'DIVF':
             return I18N::translate('Divorce filed');
         case 'DSCR':
             return I18N::translate('Description');
         case 'EDUC':
             return I18N::translate('Education');
         case 'EDUC:AGNC':
             return I18N::translate('School or college');
         case 'EMAI':
             return I18N::translate('Email address');
         case 'EMAIL':
             return I18N::translate('Email address');
         case 'EMAL':
             return I18N::translate('Email address');
         case 'EMIG':
             return I18N::translate('Emigration');
         case 'EMIG:DATE':
             return I18N::translate('Date of emigration');
         case 'EMIG:PLAC':
             return I18N::translate('Place of emigration');
         case 'ENDL':
             return I18N::translate('LDS endowment');
         case 'ENDL:DATE':
             return I18N::translate('Date of LDS endowment');
         case 'ENDL:PLAC':
             return I18N::translate('Place of LDS endowment');
         case 'ENGA':
             return I18N::translate('Engagement');
         case 'ENGA:DATE':
             return I18N::translate('Date of engagement');
         case 'ENGA:PLAC':
             return I18N::translate('Place of engagement');
         case 'EVEN':
             return I18N::translate('Event');
         case 'EVEN:DATE':
             return I18N::translate('Date of event');
         case 'EVEN:PLAC':
             return I18N::translate('Place of event');
         case 'FACT':
             return I18N::translate('Fact');
         case 'FAM':
             return I18N::translate('Family');
         case 'FAMC':
             return I18N::translate('Family as a child');
         case 'FAMF':
             return I18N::translate('Family file');
         case 'FAMS':
             return I18N::translate('Family as a spouse');
         case 'FAMS:CENS:DATE':
             return I18N::translate('Spouse census date');
         case 'FAMS:CENS:PLAC':
             return I18N::translate('Spouse census place');
         case 'FAMS:DIV:DATE':
             return I18N::translate('Date of divorce');
         case 'FAMS:MARR:DATE':
             return I18N::translate('Date of marriage');
         case 'FAMS:MARR:PLAC':
             return I18N::translate('Place of marriage');
         case 'FAMS:NOTE':
             return I18N::translate('Spouse note');
         case 'FAMS:SLGS:DATE':
             return I18N::translate('Date of LDS spouse sealing');
         case 'FAMS:SLGS:PLAC':
             return I18N::translate('Place of LDS spouse sealing');
         case 'FAX':
             return I18N::translate('Fax');
         case 'FCOM':
             return I18N::translate('First communion');
         case 'FCOM:DATE':
             return I18N::translate('Date of first communion');
         case 'FCOM:PLAC':
             return I18N::translate('Place of first communion');
         case 'FILE':
             return I18N::translate('Filename');
         case 'FONE':
             return I18N::translate('Phonetic');
         case 'FORM':
             return I18N::translate('Format');
         case 'GEDC':
             return I18N::translate('GEDCOM file');
         case 'GIVN':
             return I18N::translate('Given names');
         case 'GRAD':
             return I18N::translate('Graduation');
         case 'HEAD':
             return I18N::translate('Header');
         case 'HUSB':
             return I18N::translate('Husband');
         case 'IDNO':
             return I18N::translate('Identification number');
         case 'IMMI':
             return I18N::translate('Immigration');
         case 'IMMI:DATE':
             return I18N::translate('Date of immigration');
         case 'IMMI:PLAC':
             return I18N::translate('Place of immigration');
         case 'INDI':
             return I18N::translate('Individual');
         case 'INFL':
             return I18N::translate('Infant');
         case 'LANG':
             return I18N::translate('Language');
         case 'LATI':
             return I18N::translate('Latitude');
         case 'LEGA':
             return I18N::translate('Legatee');
         case 'LONG':
             return I18N::translate('Longitude');
         case 'MAP':
             return I18N::translate('Map');
         case 'MARB':
             return I18N::translate('Marriage banns');
         case 'MARB:DATE':
             return I18N::translate('Date of marriage banns');
         case 'MARB:PLAC':
             return I18N::translate('Place of marriage banns');
         case 'MARC':
             return I18N::translate('Marriage contract');
         case 'MARL':
             return I18N::translate('Marriage license');
         case 'MARR':
             return I18N::translate('Marriage');
         case 'MARR:DATE':
             return I18N::translate('Date of marriage');
         case 'MARR:PLAC':
             return I18N::translate('Place of marriage');
         case 'MARR_CIVIL':
             return I18N::translate('Civil marriage');
         case 'MARR_PARTNERS':
             return I18N::translate('Registered partnership');
         case 'MARR_RELIGIOUS':
             return I18N::translate('Religious marriage');
         case 'MARR_UNKNOWN':
             return I18N::translate('Marriage type unknown');
         case 'MARS':
             return I18N::translate('Marriage settlement');
         case 'MEDI':
             return I18N::translate('Media type');
         case 'NAME':
             if ($record instanceof Repository) {
                 return I18N::translateContext('Repository', 'Name');
             } else {
                 return I18N::translate('Name');
             }
         case 'NAME:FONE':
             return I18N::translate('Phonetic name');
         case 'NAME:_HEB':
             return I18N::translate('Name in Hebrew');
         case 'NATI':
             return I18N::translate('Nationality');
         case 'NATU':
             return I18N::translate('Naturalization');
         case 'NATU:DATE':
             return I18N::translate('Date of naturalization');
         case 'NATU:PLAC':
             return I18N::translate('Place of naturalization');
         case 'NCHI':
             return I18N::translate('Number of children');
         case 'NICK':
             return I18N::translate('Nickname');
         case 'NMR':
             return I18N::translate('Number of marriages');
         case 'NOTE':
             return I18N::translate('Note');
         case 'NPFX':
             return I18N::translate('Name prefix');
         case 'NSFX':
             return I18N::translate('Name suffix');
         case 'OBJE':
             return I18N::translate('Media object');
         case 'OCCU':
             return I18N::translate('Occupation');
         case 'OCCU:AGNC':
             return I18N::translate('Employer');
         case 'ORDI':
             return I18N::translate('Ordinance');
         case 'ORDN':
             return I18N::translate('Ordination');
         case 'ORDN:AGNC':
             return I18N::translate('Religious institution');
         case 'ORDN:DATE':
             return I18N::translate('Date of ordination');
         case 'ORDN:PLAC':
             return I18N::translate('Place of ordination');
         case 'PAGE':
             return I18N::translate('Citation details');
         case 'PEDI':
             return I18N::translate('Relationship to parents');
         case 'PHON':
             return I18N::translate('Phone');
         case 'PLAC':
             return I18N::translate('Place');
         case 'PLAC:FONE':
             return I18N::translate('Phonetic place');
         case 'PLAC:ROMN':
             return I18N::translate('Romanized place');
         case 'PLAC:_HEB':
             return I18N::translate('Place in Hebrew');
         case 'POST':
             return I18N::translate('Postal code');
         case 'PROB':
             return I18N::translate('Probate');
         case 'PROP':
             return I18N::translate('Property');
         case 'PUBL':
             return I18N::translate('Publication');
         case 'QUAY':
             return I18N::translate('Quality of data');
         case 'REFN':
             return I18N::translate('Reference number');
         case 'RELA':
             return I18N::translate('Relationship');
         case 'RELI':
             return I18N::translate('Religion');
         case 'REPO':
             return I18N::translate('Repository');
         case 'RESI':
             return I18N::translate('Residence');
         case 'RESI:DATE':
             return I18N::translate('Date of residence');
         case 'RESI:PLAC':
             return I18N::translate('Place of residence');
         case 'RESN':
             return I18N::translate('Restriction');
         case 'RETI':
             return I18N::translate('Retirement');
         case 'RETI:AGNC':
             return I18N::translate('Employer');
         case 'RFN':
             return I18N::translate('Record file number');
         case 'RIN':
             return I18N::translate('Record ID number');
         case 'ROLE':
             return I18N::translate('Role');
         case 'ROMN':
             return I18N::translate('Romanized');
         case 'SERV':
             return I18N::translate('Remote server');
         case 'SEX':
             return I18N::translate('Gender');
         case 'SHARED_NOTE':
             return I18N::translate('Shared note');
         case 'SLGC':
             return I18N::translate('LDS child sealing');
         case 'SLGC:DATE':
             return I18N::translate('Date of LDS child sealing');
         case 'SLGC:PLAC':
             return I18N::translate('Place of LDS child sealing');
         case 'SLGS':
             return I18N::translate('LDS spouse sealing');
         case 'SOUR':
             return I18N::translate('Source');
         case 'SPFX':
             return I18N::translate('Surname prefix');
         case 'SSN':
             return I18N::translate('Social security number');
         case 'STAE':
             return I18N::translate('State');
         case 'STAT':
             return I18N::translate('Status');
         case 'STAT:DATE':
             return I18N::translate('Status change date');
         case 'SUBM':
             return I18N::translate('Submitter');
         case 'SUBN':
             return I18N::translate('Submission');
         case 'SURN':
             return I18N::translate('Surname');
         case 'TEMP':
             return I18N::translate('Temple');
         case 'TEXT':
             return I18N::translate('Text');
         case 'TIME':
             return I18N::translate('Time');
         case 'TITL':
             return I18N::translate('Title');
         case 'TITL:FONE':
             return I18N::translate('Phonetic title');
         case 'TITL:ROMN':
             return I18N::translate('Romanized title');
         case 'TITL:_HEB':
             return I18N::translate('Title in Hebrew');
         case 'TRLR':
             return I18N::translate('Trailer');
         case 'TYPE':
             return I18N::translate('Type');
         case 'URL':
             return I18N::translate('URL');
         case 'VERS':
             return I18N::translate('Version');
         case 'WIFE':
             return I18N::translate('Wife');
         case 'WILL':
             return I18N::translate('Will');
         case 'WWW':
             return I18N::translate('URL');
         case '_ADOP_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a son');
                 case 'F':
                     return I18N::translate('Adoption of a daughter');
                 default:
                     return I18N::translate('Adoption of a child');
             }
         case '_ADOP_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a grandson');
                 case 'F':
                     return I18N::translate('Adoption of a granddaughter');
                 default:
                     return I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Adoption of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Adoption of a granddaughter');
                 default:
                     return I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Adoption of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Adoption of a granddaughter');
                 default:
                     return I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a half-brother');
                 case 'F':
                     return I18N::translate('Adoption of a half-sister');
                 default:
                     return I18N::translate('Adoption of a half-sibling');
             }
         case '_ADOP_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a brother');
                 case 'F':
                     return I18N::translate('Adoption of a sister');
                 default:
                     return I18N::translate('Adoption of a sibling');
             }
         case '_ADPF':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by father');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by father');
                 default:
                     return I18N::translate('Adopted by father');
             }
         case '_ADPM':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by mother');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by mother');
                 default:
                     return I18N::translate('Adopted by mother');
             }
         case '_AKA':
         case '_AKAN':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Also known as');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Also known as');
                 default:
                     return I18N::translate('Also known as');
             }
         case '_ASSO':
             return I18N::translate('Associate');
             /* see also ASSO */
         /* see also ASSO */
         case '_BAPM_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a son');
                 case 'F':
                     return I18N::translate('Baptism of a daughter');
                 default:
                     return I18N::translate('Baptism of a child');
             }
         case '_BAPM_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a grandson');
                 case 'F':
                     return I18N::translate('Baptism of a granddaughter');
                 default:
                     return I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Baptism of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Baptism of a granddaughter');
                 default:
                     return I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Baptism of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Baptism of a granddaughter');
                 default:
                     return I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a half-brother');
                 case 'F':
                     return I18N::translate('Baptism of a half-sister');
                 default:
                     return I18N::translate('Baptism of a half-sibling');
             }
         case '_BAPM_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a brother');
                 case 'F':
                     return I18N::translate('Baptism of a sister');
                 default:
                     return I18N::translate('Baptism of a sibling');
             }
         case '_BIBL':
             return I18N::translate('Bibliography');
         case '_BIRT_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a son');
                 case 'F':
                     return I18N::translate('Birth of a daughter');
                 default:
                     return I18N::translate('Birth of a child');
             }
         case '_BIRT_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a grandson');
                 case 'F':
                     return I18N::translate('Birth of a granddaughter');
                 default:
                     return I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Birth of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Birth of a granddaughter');
                 default:
                     return I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Birth of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Birth of a granddaughter');
                 default:
                     return I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a half-brother');
                 case 'F':
                     return I18N::translate('Birth of a half-sister');
                 default:
                     return I18N::translate('Birth of a half-sibling');
             }
         case '_BIRT_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a brother');
                 case 'F':
                     return I18N::translate('Birth of a sister');
                 default:
                     return I18N::translate('Birth of a sibling');
             }
         case '_BRTM':
             return I18N::translate('Brit milah');
         case '_BRTM:DATE':
             return I18N::translate('Date of brit milah');
         case '_BRTM:PLAC':
             return I18N::translate('Place of brit milah');
         case '_BURI_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a son');
                 case 'F':
                     return I18N::translate('Burial of a daughter');
                 default:
                     return I18N::translate('Burial of a child');
             }
         case '_BURI_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a grandson');
                 case 'F':
                     return I18N::translate('Burial of a granddaughter');
                 default:
                     return I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Burial of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Burial of a granddaughter');
                 default:
                     return I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Burial of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Burial of a granddaughter');
                 default:
                     return I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GPAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a grandfather');
                 case 'F':
                     return I18N::translate('Burial of a grandmother');
                 default:
                     return I18N::translate('Burial of a grandparent');
             }
         case '_BURI_GPA1':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a paternal grandfather');
                 case 'F':
                     return I18N::translate('Burial of a paternal grandmother');
                 default:
                     return I18N::translate('Burial of a paternal grandparent');
             }
         case '_BURI_GPA2':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a maternal grandfather');
                 case 'F':
                     return I18N::translate('Burial of a maternal grandmother');
                 default:
                     return I18N::translate('Burial of a maternal grandparent');
             }
         case '_BURI_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a half-brother');
                 case 'F':
                     return I18N::translate('Burial of a half-sister');
                 default:
                     return I18N::translate('Burial of a half-sibling');
             }
         case '_BURI_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a father');
                 case 'F':
                     return I18N::translate('Burial of a mother');
                 default:
                     return I18N::translate('Burial of a parent');
             }
         case '_BURI_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a brother');
                 case 'F':
                     return I18N::translate('Burial of a sister');
                 default:
                     return I18N::translate('Burial of a sibling');
             }
         case '_BURI_SPOU':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a husband');
                 case 'F':
                     return I18N::translate('Burial of a wife');
                 default:
                     return I18N::translate('Burial of a spouse');
             }
         case '_CHR_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a son');
                 case 'F':
                     return I18N::translate('Christening of a daughter');
                 default:
                     return I18N::translate('Christening of a child');
             }
         case '_CHR_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a grandson');
                 case 'F':
                     return I18N::translate('Christening of a granddaughter');
                 default:
                     return I18N::translate('Christening of a grandchild');
             }
         case '_CHR_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Christening of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Christening of a granddaughter');
                 default:
                     return I18N::translate('Christening of a grandchild');
             }
         case '_CHR_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Christening of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Christening of a granddaughter');
                 default:
                     return I18N::translate('Christening of a grandchild');
             }
         case '_CHR_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a half-brother');
                 case 'F':
                     return I18N::translate('Christening of a half-sister');
                 default:
                     return I18N::translate('Christening of a half-sibling');
             }
         case '_CHR_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a brother');
                 case 'F':
                     return I18N::translate('Christening of a sister');
                 default:
                     return I18N::translate('Christening of a sibling');
             }
         case '_COML':
             return I18N::translate('Common law marriage');
         case '_CREM_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a son');
                 case 'F':
                     return I18N::translate('Cremation of a daughter');
                 default:
                     return I18N::translate('Cremation of a child');
             }
         case '_CREM_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a grandson');
                 case 'F':
                     return I18N::translate('Cremation of a granddaughter');
                 default:
                     return I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Cremation of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Cremation of a granddaughter');
                 default:
                     return I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Cremation of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Cremation of a granddaughter');
                 default:
                     return I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GPAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a grandfather');
                 case 'F':
                     return I18N::translate('Cremation of a grandmother');
                 default:
                     return I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_GPA1':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a paternal grandfather');
                 case 'F':
                     return I18N::translate('Cremation of a paternal grandmother');
                 default:
                     return I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_GPA2':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a maternal grandfather');
                 case 'F':
                     return I18N::translate('Cremation of a maternal grandmother');
                 default:
                     return I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a half-brother');
                 case 'F':
                     return I18N::translate('Cremation of a half-sister');
                 default:
                     return I18N::translate('Cremation of a half-sibling');
             }
         case '_CREM_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a father');
                 case 'F':
                     return I18N::translate('Cremation of a mother');
                 default:
                     return I18N::translate('Cremation of a parent');
             }
         case '_CREM_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a brother');
                 case 'F':
                     return I18N::translate('Cremation of a sister');
                 default:
                     return I18N::translate('Cremation of a sibling');
             }
         case '_CREM_SPOU':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a husband');
                 case 'F':
                     return I18N::translate('Cremation of a wife');
                 default:
                     return I18N::translate('Cremation of a spouse');
             }
         case '_DBID':
             return I18N::translate('Linked database ID');
         case '_DEAT_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a son');
                 case 'F':
                     return I18N::translate('Death of a daughter');
                 default:
                     return I18N::translate('Death of a child');
             }
         case '_DEAT_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a grandson');
                 case 'F':
                     return I18N::translate('Death of a granddaughter');
                 default:
                     return I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Death of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Death of a granddaughter');
                 default:
                     return I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Death of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Death of a granddaughter');
                 default:
                     return I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GPAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a grandfather');
                 case 'F':
                     return I18N::translate('Death of a grandmother');
                 default:
                     return I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_GPA1':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a paternal grandfather');
                 case 'F':
                     return I18N::translate('Death of a paternal grandmother');
                 default:
                     return I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_GPA2':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a maternal grandfather');
                 case 'F':
                     return I18N::translate('Death of a maternal grandmother');
                 default:
                     return I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a half-brother');
                 case 'F':
                     return I18N::translate('Death of a half-sister');
                 default:
                     return I18N::translate('Death of a half-sibling');
             }
         case '_DEAT_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a father');
                 case 'F':
                     return I18N::translate('Death of a mother');
                 default:
                     return I18N::translate('Death of a parent');
             }
         case '_DEAT_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a brother');
                 case 'F':
                     return I18N::translate('Death of a sister');
                 default:
                     return I18N::translate('Death of a sibling');
             }
         case '_DEAT_SPOU':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a husband');
                 case 'F':
                     return I18N::translate('Death of a wife');
                 default:
                     return I18N::translate('Death of a spouse');
             }
         case '_DEG':
             return I18N::translate('Degree');
         case '_DETS':
             return I18N::translate('Death of one spouse');
         case '_DNA':
             return I18N::translate('DNA markers');
         case '_EMAIL':
             return I18N::translate('Email address');
         case '_EYEC':
             return I18N::translate('Eye color');
         case '_FA1':
             return I18N::translate('Fact 1');
         case '_FA2':
             return I18N::translate('Fact 2');
         case '_FA3':
             return I18N::translate('Fact 3');
         case '_FA4':
             return I18N::translate('Fact 4');
         case '_FA5':
             return I18N::translate('Fact 5');
         case '_FA6':
             return I18N::translate('Fact 6');
         case '_FA7':
             return I18N::translate('Fact 7');
         case '_FA8':
             return I18N::translate('Fact 8');
         case '_FA9':
             return I18N::translate('Fact 9');
         case '_FA10':
             return I18N::translate('Fact 10');
         case '_FA11':
             return I18N::translate('Fact 11');
         case '_FA12':
             return I18N::translate('Fact 12');
         case '_FA13':
             return I18N::translate('Fact 13');
         case '_FNRL':
             return I18N::translate('Funeral');
         case '_FREL':
             return I18N::translate('Relationship to father');
         case '_GEDF':
             return I18N::translate('GEDCOM file');
         case '_GODP':
             return I18N::translate('Godparent');
         case '_HAIR':
             return I18N::translate('Hair color');
         case '_HEB':
             return I18N::translate('Hebrew');
         case '_HEIG':
             return I18N::translate('Height');
         case '_HNM':
             return I18N::translate('Hebrew name');
         case '_HOL':
             return I18N::translate('Holocaust');
         case '_INTE':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Interred');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Interred');
                 default:
                     return I18N::translate('Interred');
             }
         case '_LOC':
             return I18N::translate('Location');
         case '_MARI':
             return I18N::translate('Marriage intention');
         case '_MARNM':
             return I18N::translate('Married name');
         case '_PRIM':
             return I18N::translate('Highlighted image');
         case '_MARNM_SURN':
             return I18N::translate('Married surname');
         case '_MARR_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a son');
                 case 'F':
                     return I18N::translate('Marriage of a daughter');
                 default:
                     return I18N::translate('Marriage of a child');
             }
         case '_MARR_FAMC':
             return I18N::translate('Marriage of parents');
         case '_MARR_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a grandson');
                 case 'F':
                     return I18N::translate('Marriage of a granddaughter');
                 default:
                     return I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Marriage of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Marriage of a granddaughter');
                 default:
                     return I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Marriage of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Marriage of a granddaughter');
                 default:
                     return I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a half-brother');
                 case 'F':
                     return I18N::translate('Marriage of a half-sister');
                 default:
                     return I18N::translate('Marriage of a half-sibling');
             }
         case '_MARR_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a father');
                 case 'F':
                     return I18N::translate('Marriage of a mother');
                 default:
                     return I18N::translate('Marriage of a parent');
             }
         case '_MARR_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a brother');
                 case 'F':
                     return I18N::translate('Marriage of a sister');
                 default:
                     return I18N::translate('Marriage of a sibling');
             }
         case '_MBON':
             return I18N::translate('Marriage bond');
         case '_MDCL':
             return I18N::translate('Medical');
         case '_MEDC':
             return I18N::translate('Medical condition');
         case '_MEND':
             return I18N::translate('Marriage ending status');
         case '_MILI':
             return I18N::translate('Military');
         case '_MILT':
             return I18N::translate('Military service');
         case '_MREL':
             return I18N::translate('Relationship to mother');
         case '_MSTAT':
             return I18N::translate('Marriage beginning status');
         case '_NAME':
             return I18N::translate('Mailing name');
         case '_NAMS':
             return I18N::translate('Namesake');
         case '_NLIV':
             return I18N::translate('Not living');
         case '_NMAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Never married');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Never married');
                 default:
                     return I18N::translate('Never married');
             }
         case '_NMR':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Not married');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Not married');
                 default:
                     return I18N::translate('Not married');
             }
         case '_WT_USER':
             return I18N::translate('by');
         case '_PRMN':
             return I18N::translate('Permanent number');
         case '_SCBK':
             return I18N::translate('Scrapbook');
         case '_SEPR':
             return I18N::translate('Separated');
         case '_SSHOW':
             return I18N::translate('Slide show');
         case '_STAT':
             return I18N::translate('Marriage status');
         case '_SUBQ':
             return I18N::translate('Short version');
         case '_TODO':
             return I18N::translate('Research task');
         case '_TYPE':
             return I18N::translate('Media type');
         case '_UID':
             return I18N::translate('Globally unique identifier');
         case '_URL':
             return I18N::translate('URL');
         case '_WEIG':
             return I18N::translate('Weight');
         case '_WITN':
             return I18N::translate('Witness');
         case '_WT_OBJE_SORT':
             return I18N::translate('Re-order media');
         case '_YART':
             return 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 I18N::translate('Brit milah of a son');
         case '__BRTM_GCHI':
             return I18N::translate('Brit milah of a grandson');
         case '__BRTM_GCH1':
             return I18N::translateContext('daughter’s son', 'Brit milah of a grandson');
         case '__BRTM_GCH2':
             return I18N::translateContext('son’s son', 'Brit milah of a grandson');
         case '__BRTM_HSIB':
             return I18N::translate('Brit milah of a half-brother');
         case '__BRTM_SIBL':
             return 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 I18N::translate('File size');
         case '__IMAGE_SIZE__':
             return 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="' . I18N::translate('Unrecognized GEDCOM code') . '">' . Filter::escapeHtml($tag) . '</span>';
     }
 }
Beispiel #28
0
 /**
  * Print places
  * 
  * @param Place $place
  * @param type $tree
  * @return string
  */
 private function printPlace($place, $tree)
 {
     if ($this->options('show_places') == true) {
         $place = new Place($place, $tree);
         $html = ' ' . I18N::translateContext('before placesnames', 'in ');
         if ($this->options('use_gedcom_places') == true) {
             $html .= $place->getShortName();
         } else {
             $country = $this->options('country');
             $new_place = array_reverse(explode(", ", $place->getGedcomName()));
             if (!empty($country) && $new_place[0] == $country) {
                 unset($new_place[0]);
                 $html .= '<span dir="auto">' . Filter::escapeHtml(implode(', ', array_reverse($new_place))) . '</span>';
             } else {
                 $html .= $place->getFullName();
             }
         }
         return $html;
     }
 }
 /**
  * print information for a sex record
  *
  * @param Fact $event the Event object
  */
 public function printSexRecord(Fact $event)
 {
     $sex = $event->getValue();
     if (empty($sex)) {
         $sex = 'U';
     }
     echo '<span id="sex" class="';
     if ($event->isPendingDeletion()) {
         echo 'old ';
     }
     if ($event->isPendingAddition()) {
         echo 'new ';
     }
     switch ($sex) {
         case 'M':
             echo 'male_gender"';
             if ($event->canEdit()) {
                 echo ' title="', I18N::translate('Male'), ' - ', I18N::translate('Edit'), '"';
                 echo ' onclick="edit_record(\'' . $this->record->getXref() . '\', \'' . $event->getFactId() . '\'); return false;">';
             } else {
                 echo ' title="', I18N::translate('Male'), '">';
             }
             break;
         case 'F':
             echo 'female_gender"';
             if ($event->canEdit()) {
                 echo ' title="', I18N::translate('Female'), ' - ', I18N::translate('Edit'), '"';
                 echo ' onclick="edit_record(\'' . $this->record->getXref() . '\', \'' . $event->getFactId() . '\'); return false;">';
             } else {
                 echo ' title="', I18N::translate('Female'), '">';
             }
             break;
         default:
             echo 'unknown_gender"';
             if ($event->canEdit()) {
                 echo ' title="', I18N::translateContext('unknown gender', 'Unknown'), ' - ', I18N::translate('Edit'), '"';
                 echo ' onclick="edit_record(\'' . $this->record->getXref() . '\', \'' . $event->getFactId() . '\'); return false;">';
             } else {
                 echo ' title="', I18N::translateContext('unknown gender', 'Unknown'), '">';
             }
             break;
     }
     echo '</span>';
 }
Beispiel #30
0
 /**
  * Full month name in instrumental case.
  *
  * @param int  $month_number
  * @param bool $leap_year    Some calendars use leap months
  *
  * @return string
  */
 protected function monthNameInstrumentalCase($month_number, $leap_year)
 {
     static $translated_month_names;
     if ($translated_month_names === null) {
         $translated_month_names = array(0 => '', 1 => I18N::translateContext('INSTRUMENTAL', 'Tishrei'), 2 => I18N::translateContext('INSTRUMENTAL', 'Heshvan'), 3 => I18N::translateContext('INSTRUMENTAL', 'Kislev'), 4 => I18N::translateContext('INSTRUMENTAL', 'Tevet'), 5 => I18N::translateContext('INSTRUMENTAL', 'Shevat'), 6 => I18N::translateContext('INSTRUMENTAL', 'Adar I'), 7 => I18N::translateContext('INSTRUMENTAL', 'Adar'), -7 => I18N::translateContext('INSTRUMENTAL', 'Adar II'), 8 => I18N::translateContext('INSTRUMENTAL', 'Nissan'), 9 => I18N::translateContext('INSTRUMENTAL', 'Iyar'), 10 => I18N::translateContext('INSTRUMENTAL', 'Sivan'), 11 => I18N::translateContext('INSTRUMENTAL', 'Tamuz'), 12 => I18N::translateContext('INSTRUMENTAL', 'Av'), 13 => I18N::translateContext('INSTRUMENTAL', 'Elul'));
     }
     if ($month_number === 7 && $leap_year) {
         return $translated_month_names[-7];
     } else {
         return $translated_month_names[$month_number];
     }
 }