Completed
Push — develop ( c314ec...310a97 )
by Greg
13:42
created
login.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,10 +52,18 @@
 block discarded – undo
52 52
 $password        = Filter::post('password');
53 53
 
54 54
 // These parameters may come from the URL which is emailed to users.
55
-if (!$action)        $action        = Filter::get('action');
56
-if (!$user_name)     $user_name     = Filter::get('user_name');
57
-if (!$user_hashcode) $user_hashcode = Filter::get('user_hashcode');
58
-if (!$url)           $url           = Filter::get('url');
55
+if (!$action) {
56
+	$action        = Filter::get('action');
57
+}
58
+if (!$user_name) {
59
+	$user_name     = Filter::get('user_name');
60
+}
61
+if (!$user_hashcode) {
62
+	$user_hashcode = Filter::get('user_hashcode');
63
+}
64
+if (!$url) {
65
+	$url           = Filter::get('url');
66
+}
59 67
 
60 68
 $message = '';
61 69
 
Please login to merge, or discard this patch.
app/Module/GoogleMapsModule.php 1 patch
Braces   +55 added lines, -29 removed lines patch added patch discarded remove patch
@@ -825,7 +825,9 @@  discard block
 block discarded – undo
825 825
 			$person = $this->ancestors[$i];
826 826
 			if (!empty($person)) {
827 827
 				$name = $person->getFullName();
828
-				if ($name == I18N::translate('Private')) $priv++;
828
+				if ($name == I18N::translate('Private')) {
829
+					$priv++;
830
+				}
829 831
 				$place = $person->getBirthPlace();
830 832
 				if (empty($place)) {
831 833
 					$latlongval[$i] = null;
@@ -1715,8 +1717,9 @@  discard block
 block discarded – undo
1715 1717
 
1716 1718
 				if ($row['pl_place'] != '') {
1717 1719
 					$placestr2 = $mapstr_edit . $id . "&level=" . $level . $mapstr3 . $mapstr5 . I18N::translate('Zoom=') . $row['pl_zoom'] . $mapstr6 . $row['pl_placerequested'] . $mapstr8;
1718
-					if ($row['pl_place'] === 'unknown')
1719
-						$matched[$x]++;
1720
+					if ($row['pl_place'] === 'unknown') {
1721
+											$matched[$x]++;
1722
+					}
1720 1723
 				} else {
1721 1724
 					if ($levels[$z] === 'unknown') {
1722 1725
 						$placestr2 = $mapstr_add . $id . "&amp;level=" . $level . $mapstr3 . $mapstr7 . "<strong>" . I18N::translate('unknown') . "</strong>" . $mapstr8; $matched[$x]++;
@@ -2828,8 +2831,9 @@  discard block
 block discarded – undo
2828 2831
 			$parent[$level] = $place2['place'];
2829 2832
 			$this->printHowManyPeople($level + 1, $parent);
2830 2833
 			echo '<br>', I18N::translate('This place has no coordinates');
2831
-			if (Auth::isAdmin())
2832
-				echo "<br><a href='module.php?mod=googlemap&amp;mod_action=admin_places&amp;parent=", $levelm, "&amp;display=inactive'>", I18N::translate('Geographic data'), "</a>";
2834
+			if (Auth::isAdmin()) {
2835
+							echo "<br><a href='module.php?mod=googlemap&amp;mod_action=admin_places&amp;parent=", $levelm, "&amp;display=inactive'>", I18N::translate('Geographic data'), "</a>";
2836
+			}
2833 2837
 			echo "</div>\", icon_type, \"", str_replace(array('&lrm;', '&rlm;'), array(WT_UTF8_LRM, WT_UTF8_RLM), addslashes($place2['place'])), "\");\n";
2834 2838
 		} else {
2835 2839
 			$lati = str_replace(array('N', 'S', ','), array('', '-', '.'), $place2['lati']);
@@ -3030,7 +3034,8 @@  discard block
 block discarded – undo
3030 3034
 		ob_start(); // TODO: rewrite print_gm_markers, and the functions called therein, to either return text or add JS directly.
3031 3035
 
3032 3036
 		if ($numfound == 0 && $level > 0) {
3033
-			if (isset($levelo[($level - 1)])) {  // ** BH not sure yet what this if statement is for ... TODO **
3037
+			if (isset($levelo[($level - 1)])) {
3038
+// ** BH not sure yet what this if statement is for ... TODO **
3034 3039
 				// show the current place on the map
3035 3040
 
3036 3041
 				$place = Database::prepare("SELECT pl_id as place_id, pl_place as place, pl_lati as lati, pl_long as `long`, pl_zoom as zoom, pl_icon as icon FROM `##placelocation` WHERE pl_id=?")
@@ -3305,10 +3310,11 @@  discard block
 block discarded – undo
3305 3310
 			$place_name       = $row->pl_place;
3306 3311
 			$place_icon       = $row->pl_icon;
3307 3312
 			$selected_country = explode("/", $place_icon);
3308
-			if (isset($selected_country[1]) && $selected_country[1] != "flags")
3309
-				$selected_country = $selected_country[1];
3310
-			else
3311
-				$selected_country = "Countries";
3313
+			if (isset($selected_country[1]) && $selected_country[1] != "flags") {
3314
+							$selected_country = $selected_country[1];
3315
+			} else {
3316
+							$selected_country = "Countries";
3317
+			}
3312 3318
 			$parent_id         = $row->pl_parent_id;
3313 3319
 			$level             = $row->pl_level;
3314 3320
 			$zoomfactor        = $row->pl_zoom;
@@ -3387,8 +3393,9 @@  discard block
 block discarded – undo
3387 3393
 			} else {
3388 3394
 				echo '<b>', $place_name;
3389 3395
 			}
3390
-			if (count($where_am_i) > 0)
3391
-				echo ', ', Filter::escapeHtml(str_replace('Unknown', I18N::translate('unknown'), implode(I18N::$list_separator, array_reverse($where_am_i, true)))), '</b><br>';
3396
+			if (count($where_am_i) > 0) {
3397
+							echo ', ', Filter::escapeHtml(str_replace('Unknown', I18N::translate('unknown'), implode(I18N::$list_separator, array_reverse($where_am_i, true)))), '</b><br>';
3398
+			}
3392 3399
 			echo '</b><br>';
3393 3400
 		}
3394 3401
 
@@ -3897,7 +3904,8 @@  discard block
 block discarded – undo
3897 3904
 			}
3898 3905
 
3899 3906
 			function showLocation_level(address) {
3900
-				address += '<?php if ($level > 0) echo ', ', addslashes(implode(', ', array_reverse($where_am_i, true))) ?>';
3907
+				address += '<?php if ($level > 0) {
3908
+	echo ', ', addslashes(implode(', ', array_reverse($where_am_i, true))) ?>';
3901 3909
 				geocoder.geocode({'address': address}, addAddressToMap);
3902 3910
 			}
3903 3911
 
@@ -3946,6 +3954,7 @@  discard block
 block discarded – undo
3946 3954
 				</td>
3947 3955
 				<?php
3948 3956
 					$exp = explode(".", $place_lati);
3957
+}
3949 3958
 					if (isset($exp[1])) {
3950 3959
 						$precision1 = strlen($exp[1]);
3951 3960
 					} else {
@@ -3958,13 +3967,15 @@  discard block
 block discarded – undo
3958 3967
 						$precision2 = -1;
3959 3968
 					}
3960 3969
 					($precision1 > $precision2) ? ($precision = $precision1) : ($precision = $precision2);
3961
-					if ($precision == -1) ($level > 3) ? ($precision = 3) : ($precision = $level);
3962
-					elseif ($precision > 5) {
3970
+					if ($precision == -1) {
3971
+						($level > 3) ? ($precision = 3) : ($precision = $level);
3972
+					} elseif ($precision > 5) {
3963 3973
 						$precision = 5;
3964 3974
 					}
3965 3975
 				?>
3966 3976
 				<td class="optionbox" colspan="2">
3967
-					<input type="radio" id="new_prec_0" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision == $this->getSetting('GM_PRECISION_0')) echo 'checked' ?> value="<?php echo $this->getSetting('GM_PRECISION_0') ?>">
3977
+					<input type="radio" id="new_prec_0" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision == $this->getSetting('GM_PRECISION_0')) {
3978
+	echo 'checked' ?> value="<?php echo $this->getSetting('GM_PRECISION_0') ?>">
3968 3979
 					<label for="new_prec_0"><?php echo I18N::translate('Country') ?></label>
3969 3980
 					<input type="radio" id="new_prec_1" name="NEW_PRECISION" onchange="updateMap();" <?php if ($precision == $this->getSetting('GM_PRECISION_1')) echo 'checked' ?> value="<?php echo $this->getSetting('GM_PRECISION_1') ?>">
3970 3981
 					<label for="new_prec_1"><?php echo I18N::translate('State') ?></label>
@@ -3986,8 +3997,13 @@  discard block
 block discarded – undo
3986 3997
 				<td class="optionbox" colspan="2">
3987 3998
 					<input type="text" id="NEW_PLACE_LATI" name="NEW_PLACE_LATI" placeholder="<?php echo /* I18N: Measure of latitude/longitude */ I18N::translate('degrees') ?>" value="<?php echo abs($place_lati) ?>" size="20" onchange="updateMap();">
3988 3999
 					<select name="LATI_CONTROL" onchange="updateMap();">
3989
-						<option value="PL_N" <?php if ($place_lati >= 0) echo "selected"; echo ">", I18N::translate('north') ?></option>
3990
-						<option value="PL_S" <?php if ($place_lati < 0) echo "selected"; echo ">", I18N::translate('south') ?></option>
4000
+						<option value="PL_N" <?php if ($place_lati >= 0) echo "selected";
4001
+}
4002
+echo ">", I18N::translate('north') ?></option>
4003
+						<option value="PL_S" <?php if ($place_lati < 0) {
4004
+	echo "selected";
4005
+}
4006
+echo ">", I18N::translate('south') ?></option>
3991 4007
 					</select>
3992 4008
 				</td>
3993 4009
 			</tr>
@@ -3996,8 +4012,14 @@  discard block
 block discarded – undo
3996 4012
 				<td class="optionbox" colspan="2">
3997 4013
 					<input type="text" id="NEW_PLACE_LONG" name="NEW_PLACE_LONG" placeholder="<?php echo I18N::translate('degrees') ?>" value="<?php echo abs($place_long) ?>" size="20" onchange="updateMap();">
3998 4014
 					<select name="LONG_CONTROL" onchange="updateMap();">
3999
-						<option value="PL_E" <?php if ($place_long >= 0) echo "selected"; echo ">", I18N::translate('east') ?></option>
4000
-						<option value="PL_W" <?php if ($place_long < 0) echo "selected"; echo ">", I18N::translate('west') ?></option>
4015
+						<option value="PL_E" <?php if ($place_long >= 0) {
4016
+	echo "selected";
4017
+}
4018
+echo ">", I18N::translate('east') ?></option>
4019
+						<option value="PL_W" <?php if ($place_long < 0) {
4020
+	echo "selected";
4021
+}
4022
+echo ">", I18N::translate('west') ?></option>
4001 4023
 					</select>
4002 4024
 				</td>
4003 4025
 			</tr>
@@ -4210,8 +4232,9 @@  discard block
 block discarded – undo
4210 4232
 				$parent    = array_reverse($parent);
4211 4233
 				$parent_id = 0;
4212 4234
 				for ($i = 0; $i < count($parent); $i++) {
4213
-					if (!isset($default_zoom_level[$i]))
4214
-						$default_zoom_level[$i] = $default_zoom_level[$i - 1];
4235
+					if (!isset($default_zoom_level[$i])) {
4236
+											$default_zoom_level[$i] = $default_zoom_level[$i - 1];
4237
+					}
4215 4238
 					$escparent               = $parent[$i];
4216 4239
 					if ($escparent == '') {
4217 4240
 						$escparent = 'Unknown';
@@ -4451,7 +4474,8 @@  discard block
 block discarded – undo
4451 4474
 						Database::prepare("SELECT pl_id, pl_long, pl_lati, pl_zoom, pl_icon FROM `##placelocation` WHERE pl_level=? AND pl_parent_id=? AND pl_place LIKE ? ORDER BY pl_place")
4452 4475
 						->execute(array($i, $parent_id, $escparent))
4453 4476
 						->fetchOneRow();
4454
-					if (empty($row)) {       // this name does not yet exist: create entry
4477
+					if (empty($row)) {
4478
+// this name does not yet exist: create entry
4455 4479
 						if (!Filter::postBool('updateonly')) {
4456 4480
 							$highestIndex = $highestIndex + 1;
4457 4481
 							if (($i + 1) == count($parent)) {
@@ -4590,14 +4614,16 @@  discard block
 block discarded – undo
4590 4614
 		echo '<th>', I18N::translate('Icon'), '</th>';
4591 4615
 		echo '<th>';
4592 4616
 		echo I18N::translate('Edit'), '</th><th>', I18N::translate('Delete'), '</th></tr>';
4593
-		if (count($placelist) == 0)
4594
-			echo '<tr><td colspan="7">', I18N::translate('No places found'), '</td></tr>';
4617
+		if (count($placelist) == 0) {
4618
+					echo '<tr><td colspan="7">', I18N::translate('No places found'), '</td></tr>';
4619
+		}
4595 4620
 		foreach ($placelist as $place) {
4596 4621
 			echo '<tr><td><a href="module.php?mod=googlemap&mod_action=admin_places&parent=', $place['place_id'], '&inactive=', $inactive, '">';
4597
-			if ($place['place'] != 'Unknown')
4598
-					echo Filter::escapeHtml($place['place']), '</a></td>';
4599
-				else
4600
-					echo I18N::translate('unknown'), '</a></td>';
4622
+			if ($place['place'] != 'Unknown') {
4623
+								echo Filter::escapeHtml($place['place']), '</a></td>';
4624
+			} else {
4625
+									echo I18N::translate('unknown'), '</a></td>';
4626
+				}
4601 4627
 			echo '<td>', $place['lati'], '</td>';
4602 4628
 			echo '<td>', $place['long'], '</td>';
4603 4629
 			echo '<td>', $place['zoom'], '</td>';
Please login to merge, or discard this patch.
admin.php 1 patch
Braces   +39 added lines, -16 removed lines patch added patch discarded remove patch
@@ -528,10 +528,12 @@  discard block
 block discarded – undo
528 528
 	version_compare(PHP_VERSION, '7.0', '<') && date('Y-m-d') >= '2016-08-28'
529 529
 ) {
530 530
 	$server_warnings[] = I18N::translate('Your web server is using PHP version %s, which is no longer maintained. You should upgrade to a later version.', PHP_VERSION);
531
-} else
531
+} else {
532 532
 
533 533
 ?>
534
-<h1><?php echo $controller->getPageTitle(); ?></h1>
534
+<h1><?php echo $controller->getPageTitle();
535
+}
536
+?></h1>
535 537
 
536 538
 <p>
537 539
 	<?php echo I18N::translate('These pages provide access to all the configuration settings and management tools for this webtrees site.'); ?>
@@ -584,8 +586,11 @@  discard block
 block discarded – undo
584 586
 					<a href="admin_site_upgrade.php" class="error">
585 587
 						<?php echo /* I18N: %s is a version number */ I18N::translate('Upgrade to webtrees %s.', Filter::escapeHtml($latest_version)); ?>
586 588
 					</a>
587
-					<?php else: ?>
588
-						<?php echo I18N::translate('This is the latest version of webtrees. No upgrade is available.'); ?>
589
+					<?php else {
590
+	: ?>
591
+						<?php echo I18N::translate('This is the latest version of webtrees. No upgrade is available.');
592
+}
593
+?>
589 594
 					<?php endif; ?>
590 595
 				</p>
591 596
 				<?php endif; ?>
@@ -747,9 +752,12 @@  discard block
 block discarded – undo
747 752
 									<?php echo I18N::number($changes[$tree->getTreeId()]); ?>
748 753
 									<span class="sr-only"><?php echo I18N::translate('Pending changes'); ?> <?php echo $tree->getTitleHtml(); ?></span>
749 754
 								</a>
750
-								<?php else: ?>
755
+								<?php else {
756
+	: ?>
751 757
 								-
752
-								<?php endif; ?>
758
+								<?php endif;
759
+}
760
+?>
753 761
 							</td>
754 762
 							<td class="text-right flip">
755 763
 								<?php if ($individuals[$tree->getTreeId()]): ?>
@@ -757,9 +765,12 @@  discard block
 block discarded – undo
757 765
 									<?php echo I18N::number($individuals[$tree->getTreeId()]); ?>
758 766
 									<span class="sr-only"><?php echo I18N::translate('Individuals'); ?> <?php echo $tree->getTitleHtml(); ?></span>
759 767
 								</a>
760
-								<?php else: ?>
768
+								<?php else {
769
+	: ?>
761 770
 									-
762
-								<?php endif; ?>
771
+								<?php endif;
772
+}
773
+?>
763 774
 								</td>
764 775
 							<td class="text-right flip">
765 776
 								<?php if ($families[$tree->getTreeId()]): ?>
@@ -767,9 +778,12 @@  discard block
 block discarded – undo
767 778
 									<?php echo I18N::number($families[$tree->getTreeId()]); ?>
768 779
 									<span class="sr-only"><?php echo I18N::translate('Families'); ?> <?php echo $tree->getTitleHtml(); ?></span>
769 780
 								</a>
770
-								<?php else: ?>
781
+								<?php else {
782
+	: ?>
771 783
 								-
772
-								<?php endif; ?>
784
+								<?php endif;
785
+}
786
+?>
773 787
 								</td>
774 788
 							<td class="text-right flip">
775 789
 								<?php if ($sources[$tree->getTreeId()]): ?>
@@ -777,9 +791,12 @@  discard block
 block discarded – undo
777 791
 									<?php echo I18N::number($sources[$tree->getTreeId()]); ?>
778 792
 									<span class="sr-only"><?php echo I18N::translate('Sources'); ?> <?php echo $tree->getTitleHtml(); ?></span>
779 793
 								</a>
780
-								<?php else: ?>
794
+								<?php else {
795
+	: ?>
781 796
 								-
782
-								<?php endif; ?>
797
+								<?php endif;
798
+}
799
+?>
783 800
 							</td>
784 801
 							<td class="text-right flip">
785 802
 								<?php if ($repositories[$tree->getTreeId()]): ?>
@@ -787,9 +804,12 @@  discard block
 block discarded – undo
787 804
 									<?php echo I18N::number($repositories[$tree->getTreeId()]); ?>
788 805
 									<span class="sr-only"><?php echo I18N::translate('Repositories'); ?> <?php echo $tree->getTitleHtml(); ?></span>
789 806
 								</a>
790
-								<?php else: ?>
807
+								<?php else {
808
+	: ?>
791 809
 									-
792
-								<?php endif; ?>
810
+								<?php endif;
811
+}
812
+?>
793 813
 							</td>
794 814
 							<td class="text-right flip">
795 815
 								<?php if ($media[$tree->getTreeId()]): ?>
@@ -797,9 +817,12 @@  discard block
 block discarded – undo
797 817
 									<?php echo I18N::number($media[$tree->getTreeId()]); ?>
798 818
 									<span class="sr-only"><?php echo I18N::translate('Media objects'); ?> <?php echo $tree->getTitleHtml(); ?></span>
799 819
 								</a>
800
-								<?php else: ?>
820
+								<?php else {
821
+	: ?>
801 822
 								-
802
-								<?php endif; ?>
823
+								<?php endif;
824
+}
825
+?>
803 826
 							</td>
804 827
 						</tr>
805 828
 						<?php endforeach; ?>
Please login to merge, or discard this patch.
app/I18N.php 2 patches
Switch Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -282,15 +282,15 @@  discard block
 block discarded – undo
282 282
 	 */
283 283
 	public static function gedcomAge($string) {
284 284
 		switch ($string) {
285
-			case 'STILLBORN':
286
-				// I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (stillborn)
287
-				return self::translate('(stillborn)');
288
-			case 'INFANT':
289
-				// I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (in infancy)
290
-				return self::translate('(in infancy)');
291
-			case 'CHILD':
292
-				// I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (in childhood)
293
-				return self::translate('(in childhood)');
285
+		case 'STILLBORN':
286
+			// I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (stillborn)
287
+			return self::translate('(stillborn)');
288
+		case 'INFANT':
289
+			// I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (in infancy)
290
+			return self::translate('(in infancy)');
291
+		case 'CHILD':
292
+			// I18N: Description of an individual’s age at an event. For example, Died 14 Jan 1900 (in childhood)
293
+			return self::translate('(in childhood)');
294 294
 		}
295 295
 		$age = array();
296 296
 		if (preg_match('/(\d+)y/', $string, $match)) {
@@ -874,15 +874,15 @@  discard block
 block discarded – undo
874 874
 	 */
875 875
 	public static function defaultCalendar() {
876 876
 		switch (self::$locale->languageTag()) {
877
-			case 'ar':
878
-				return new ArabicCalendar;
879
-			case 'fa':
880
-				return new PersianCalendar;
881
-			case 'he':
882
-			case 'yi':
883
-				return new JewishCalendar;
884
-			default:
885
-				return new GregorianCalendar;
877
+		case 'ar':
878
+			return new ArabicCalendar;
879
+		case 'fa':
880
+			return new PersianCalendar;
881
+		case 'he':
882
+		case 'yi':
883
+			return new JewishCalendar;
884
+		default:
885
+			return new GregorianCalendar;
886 886
 		}
887 887
 	}
888 888
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -421,7 +421,8 @@
 block discarded – undo
421 421
 				$translation  = new Translation($translation_file);
422 422
 				$translations = array_merge($translations, $translation->asArray());
423 423
 			}
424
-			if ($cache_dir_exists && is_writeable($cache_file)) { // During setup, we may not have been able to create it.
424
+			if ($cache_dir_exists && is_writeable($cache_file)) {
425
+// During setup, we may not have been able to create it.
425 426
 				file_put_contents($cache_file, '<' . '?php return ' . var_export($translations, true) . ';');
426 427
 			}
427 428
 		} else {
Please login to merge, or discard this patch.
app/Functions/FunctionsRtl.php 1 patch
Switch Indentation   +212 added lines, -212 removed lines patch added patch discarded remove patch
@@ -124,227 +124,227 @@  discard block
 block discarded – undo
124 124
 			$closeParIndex = strpos(self::CLOSE_PARENTHESES, $currentLetter); // Which closing parenthesis is this?
125 125
 
126 126
 			switch ($currentLetter) {
127
-				case '<':
128
-					// Assume this '<' starts an HTML element
129
-					$endPos = strpos($workingText, '>'); // look for the terminating '>'
130
-					if ($endPos === false) {
131
-						$endPos = 0;
132
-					}
133
-					$currentLen += $endPos;
134
-					$element = substr($workingText, 0, $currentLen);
135
-					$temp    = strtolower(substr($element, 0, 3));
136
-					if (strlen($element) < 7 && $temp == '<br') {
137
-						if ($numberState) {
138
-							$numberState = false;
139
-							if (self::$currentState == 'RTL') {
140
-								self::$waitingText .= WT_UTF8_PDF;
141
-							}
127
+			case '<':
128
+				// Assume this '<' starts an HTML element
129
+				$endPos = strpos($workingText, '>'); // look for the terminating '>'
130
+				if ($endPos === false) {
131
+					$endPos = 0;
132
+				}
133
+				$currentLen += $endPos;
134
+				$element = substr($workingText, 0, $currentLen);
135
+				$temp    = strtolower(substr($element, 0, 3));
136
+				if (strlen($element) < 7 && $temp == '<br') {
137
+					if ($numberState) {
138
+						$numberState = false;
139
+						if (self::$currentState == 'RTL') {
140
+							self::$waitingText .= WT_UTF8_PDF;
142 141
 						}
143
-						self::breakCurrentSpan($result);
144
-					} elseif (self::$waitingText == '') {
145
-						$result .= $element;
146
-					} else {
147
-						self::$waitingText .= $element;
148 142
 					}
149
-					$workingText = substr($workingText, $currentLen);
150
-					break;
151
-				case '&':
152
-					// Assume this '&' starts an HTML entity
153
-					$endPos = strpos($workingText, ';'); // look for the terminating ';'
143
+					self::breakCurrentSpan($result);
144
+				} elseif (self::$waitingText == '') {
145
+					$result .= $element;
146
+				} else {
147
+					self::$waitingText .= $element;
148
+				}
149
+				$workingText = substr($workingText, $currentLen);
150
+				break;
151
+			case '&':
152
+				// Assume this '&' starts an HTML entity
153
+				$endPos = strpos($workingText, ';'); // look for the terminating ';'
154
+				if ($endPos === false) {
155
+					$endPos = 0;
156
+				}
157
+				$currentLen += $endPos;
158
+				$entity = substr($workingText, 0, $currentLen);
159
+				if (strtolower($entity) == '&nbsp;') {
160
+					$entity .= '&nbsp;'; // Ensure consistent case for this entity
161
+				}
162
+				if (self::$waitingText == '') {
163
+					$result .= $entity;
164
+				} else {
165
+					self::$waitingText .= $entity;
166
+				}
167
+				$workingText = substr($workingText, $currentLen);
168
+				break;
169
+			case '{':
170
+				if (substr($workingText, 1, 1) == '{') {
171
+					// Assume this '{{' starts a TCPDF directive
172
+					$endPos = strpos($workingText, '}}'); // look for the terminating '}}'
154 173
 					if ($endPos === false) {
155 174
 						$endPos = 0;
156 175
 					}
157
-					$currentLen += $endPos;
158
-					$entity = substr($workingText, 0, $currentLen);
159
-					if (strtolower($entity) == '&nbsp;') {
160
-						$entity .= '&nbsp;'; // Ensure consistent case for this entity
161
-					}
162
-					if (self::$waitingText == '') {
163
-						$result .= $entity;
164
-					} else {
165
-						self::$waitingText .= $entity;
166
-					}
167
-					$workingText = substr($workingText, $currentLen);
176
+					$currentLen        = $endPos + 2;
177
+					$directive         = substr($workingText, 0, $currentLen);
178
+					$workingText       = substr($workingText, $currentLen);
179
+					$result            = $result . self::$waitingText . $directive;
180
+					self::$waitingText = '';
168 181
 					break;
169
-				case '{':
170
-					if (substr($workingText, 1, 1) == '{') {
171
-						// Assume this '{{' starts a TCPDF directive
172
-						$endPos = strpos($workingText, '}}'); // look for the terminating '}}'
173
-						if ($endPos === false) {
174
-							$endPos = 0;
182
+				}
183
+			default:
184
+				// Look for strings of numbers with optional leading or trailing + or -
185
+				// and with optional embedded numeric punctuation
186
+				if ($numberState) {
187
+					// If we're inside a numeric string, look for reasons to end it
188
+					$offset    = 0; // Be sure to look at the current character first
189
+					$charArray = self::getChar($workingText . "\n", $offset);
190
+					if (strpos(self::NUMBERS, $charArray['letter']) === false) {
191
+						// This is not a digit. Is it numeric punctuation?
192
+						if (substr($workingText . "\n", $offset, 6) == '&nbsp;') {
193
+							$offset += 6; // This could be numeric punctuation
194
+						} elseif (strpos(self::NUMBER_PUNCTUATION, $charArray['letter']) !== false) {
195
+							$offset += $charArray['length']; // This could be numeric punctuation
175 196
 						}
176
-						$currentLen        = $endPos + 2;
177
-						$directive         = substr($workingText, 0, $currentLen);
178
-						$workingText       = substr($workingText, $currentLen);
179
-						$result            = $result . self::$waitingText . $directive;
180
-						self::$waitingText = '';
181
-						break;
182
-					}
183
-				default:
184
-					// Look for strings of numbers with optional leading or trailing + or -
185
-					// and with optional embedded numeric punctuation
186
-					if ($numberState) {
187
-						// If we're inside a numeric string, look for reasons to end it
188
-						$offset    = 0; // Be sure to look at the current character first
197
+						// If the next character is a digit, the current character is numeric punctuation
189 198
 						$charArray = self::getChar($workingText . "\n", $offset);
190 199
 						if (strpos(self::NUMBERS, $charArray['letter']) === false) {
191
-							// This is not a digit. Is it numeric punctuation?
192
-							if (substr($workingText . "\n", $offset, 6) == '&nbsp;') {
193
-								$offset += 6; // This could be numeric punctuation
194
-							} elseif (strpos(self::NUMBER_PUNCTUATION, $charArray['letter']) !== false) {
195
-								$offset += $charArray['length']; // This could be numeric punctuation
196
-							}
197
-							// If the next character is a digit, the current character is numeric punctuation
198
-							$charArray = self::getChar($workingText . "\n", $offset);
199
-							if (strpos(self::NUMBERS, $charArray['letter']) === false) {
200
-								// This is not a digit. End the run of digits and punctuation.
201
-								$numberState = false;
202
-								if (self::$currentState == 'RTL') {
203
-									if (strpos(self::NUMBER_PREFIX, $currentLetter) === false) {
204
-										$currentLetter = WT_UTF8_PDF . $currentLetter;
205
-									} else {
206
-										$currentLetter = $currentLetter . WT_UTF8_PDF; // Include a trailing + or - in the run
207
-									}
200
+							// This is not a digit. End the run of digits and punctuation.
201
+							$numberState = false;
202
+							if (self::$currentState == 'RTL') {
203
+								if (strpos(self::NUMBER_PREFIX, $currentLetter) === false) {
204
+									$currentLetter = WT_UTF8_PDF . $currentLetter;
205
+								} else {
206
+									$currentLetter = $currentLetter . WT_UTF8_PDF; // Include a trailing + or - in the run
208 207
 								}
209 208
 							}
210 209
 						}
211
-					} else {
212
-						// If we're outside a numeric string, look for reasons to start it
213
-						if (strpos(self::NUMBER_PREFIX, $currentLetter) !== false) {
214
-							// This might be a number lead-in
215
-							$offset   = $currentLen;
216
-							$nextChar = substr($workingText . "\n", $offset, 1);
217
-							if (strpos(self::NUMBERS, $nextChar) !== false) {
218
-								$numberState = true; // We found a digit: the lead-in is therefore numeric
219
-								if (self::$currentState == 'RTL') {
220
-									$currentLetter = WT_UTF8_LRE . $currentLetter;
221
-								}
222
-							}
223
-						} elseif (strpos(self::NUMBERS, $currentLetter) !== false) {
224
-							$numberState = true; // The current letter is a digit
210
+					}
211
+				} else {
212
+					// If we're outside a numeric string, look for reasons to start it
213
+					if (strpos(self::NUMBER_PREFIX, $currentLetter) !== false) {
214
+						// This might be a number lead-in
215
+						$offset   = $currentLen;
216
+						$nextChar = substr($workingText . "\n", $offset, 1);
217
+						if (strpos(self::NUMBERS, $nextChar) !== false) {
218
+							$numberState = true; // We found a digit: the lead-in is therefore numeric
225 219
 							if (self::$currentState == 'RTL') {
226 220
 								$currentLetter = WT_UTF8_LRE . $currentLetter;
227 221
 							}
228 222
 						}
223
+					} elseif (strpos(self::NUMBERS, $currentLetter) !== false) {
224
+						$numberState = true; // The current letter is a digit
225
+						if (self::$currentState == 'RTL') {
226
+							$currentLetter = WT_UTF8_LRE . $currentLetter;
227
+						}
229 228
 					}
229
+				}
230
+
231
+				// Determine the directionality of the current UTF-8 character
232
+				$newState = self::$currentState;
233
+				while (true) {
234
+					if (I18N::scriptDirection(I18N::textScript($currentLetter)) === 'rtl') {
235
+						if (self::$currentState == '') {
236
+							$newState = 'RTL';
237
+							break;
238
+						}
230 239
 
231
-					// Determine the directionality of the current UTF-8 character
232
-					$newState = self::$currentState;
233
-					while (true) {
234
-						if (I18N::scriptDirection(I18N::textScript($currentLetter)) === 'rtl') {
235
-							if (self::$currentState == '') {
240
+						if (self::$currentState == 'RTL') {
241
+							break;
242
+						}
243
+						// Switch to RTL only if this isn't a solitary RTL letter
244
+						$tempText = substr($workingText, $currentLen);
245
+						while ($tempText != '') {
246
+							$nextCharArray = self::getChar($tempText, 0);
247
+							$nextLetter    = $nextCharArray['letter'];
248
+							$nextLen       = $nextCharArray['length'];
249
+							$tempText      = substr($tempText, $nextLen);
250
+
251
+							if (I18N::scriptDirection(I18N::textScript($nextLetter)) === 'rtl') {
236 252
 								$newState = 'RTL';
237
-								break;
253
+								break 2;
238 254
 							}
239 255
 
240
-							if (self::$currentState == 'RTL') {
241
-								break;
256
+							if (strpos(self::PUNCTUATION, $nextLetter) !== false || strpos(self::OPEN_PARENTHESES, $nextLetter) !== false) {
257
+								$newState = 'RTL';
258
+								break 2;
242 259
 							}
243
-							// Switch to RTL only if this isn't a solitary RTL letter
244
-							$tempText = substr($workingText, $currentLen);
245
-							while ($tempText != '') {
246
-								$nextCharArray = self::getChar($tempText, 0);
247
-								$nextLetter    = $nextCharArray['letter'];
248
-								$nextLen       = $nextCharArray['length'];
249
-								$tempText      = substr($tempText, $nextLen);
250
-
251
-								if (I18N::scriptDirection(I18N::textScript($nextLetter)) === 'rtl') {
252
-									$newState = 'RTL';
253
-									break 2;
254
-								}
255
-
256
-								if (strpos(self::PUNCTUATION, $nextLetter) !== false || strpos(self::OPEN_PARENTHESES, $nextLetter) !== false) {
257
-									$newState = 'RTL';
258
-									break 2;
259
-								}
260 260
 
261
-								if ($nextLetter === ' ') {
262
-									break;
263
-								}
264
-								$nextLetter .= substr($tempText . "\n", 0, 5);
265
-								if ($nextLetter === '&nbsp;') {
266
-									break;
267
-								}
268
-							}
269
-							// This is a solitary RTL letter : wrap it in UTF8 control codes to force LTR directionality
270
-							$currentLetter = WT_UTF8_LRO . $currentLetter . WT_UTF8_PDF;
271
-							$newState      = 'LTR';
272
-							break;
273
-						}
274
-						if (($currentLen != 1) || ($currentLetter >= 'A' && $currentLetter <= 'Z') || ($currentLetter >= 'a' && $currentLetter <= 'z')) {
275
-							// Since it’s neither Hebrew nor Arabic, this UTF-8 character or ASCII letter must be LTR
276
-							$newState = 'LTR';
277
-							break;
278
-						}
279
-						if ($closeParIndex !== false) {
280
-							// This closing parenthesis has to inherit the matching opening parenthesis' directionality
281
-							if (!empty($openParDirection[$closeParIndex]) && $openParDirection[$closeParIndex] != '?') {
282
-								$newState = $openParDirection[$closeParIndex];
261
+							if ($nextLetter === ' ') {
262
+								break;
283 263
 							}
284
-							$openParDirection[$closeParIndex] = '';
285
-							break;
286
-						}
287
-						if ($openParIndex !== false) {
288
-							// Opening parentheses always inherit the following directionality
289
-							self::$waitingText .= $currentLetter;
290
-							$workingText = substr($workingText, $currentLen);
291
-							while (true) {
292
-								if ($workingText === '') {
293
-									break;
294
-								}
295
-								if (substr($workingText, 0, 1) === ' ') {
296
-									// Spaces following this left parenthesis inherit the following directionality too
297
-									self::$waitingText .= ' ';
298
-									$workingText = substr($workingText, 1);
299
-									continue;
300
-								}
301
-								if (substr($workingText, 0, 6) === '&nbsp;') {
302
-									// Spaces following this left parenthesis inherit the following directionality too
303
-									self::$waitingText .= '&nbsp;';
304
-									$workingText = substr($workingText, 6);
305
-									continue;
306
-								}
264
+							$nextLetter .= substr($tempText . "\n", 0, 5);
265
+							if ($nextLetter === '&nbsp;') {
307 266
 								break;
308 267
 							}
309
-							$openParDirection[$openParIndex] = '?';
310
-							break 2; // double break because we're waiting for more information
311 268
 						}
312
-
313
-						// We have a digit or a "normal" special character.
314
-						//
315
-						// When this character is not at the start of the input string, it inherits the preceding directionality;
316
-						// at the start of the input string, it assumes the following directionality.
317
-						//
318
-						// Exceptions to this rule will be handled later during final clean-up.
319
-						//
269
+						// This is a solitary RTL letter : wrap it in UTF8 control codes to force LTR directionality
270
+						$currentLetter = WT_UTF8_LRO . $currentLetter . WT_UTF8_PDF;
271
+						$newState      = 'LTR';
272
+						break;
273
+					}
274
+					if (($currentLen != 1) || ($currentLetter >= 'A' && $currentLetter <= 'Z') || ($currentLetter >= 'a' && $currentLetter <= 'z')) {
275
+						// Since it’s neither Hebrew nor Arabic, this UTF-8 character or ASCII letter must be LTR
276
+						$newState = 'LTR';
277
+						break;
278
+					}
279
+					if ($closeParIndex !== false) {
280
+						// This closing parenthesis has to inherit the matching opening parenthesis' directionality
281
+						if (!empty($openParDirection[$closeParIndex]) && $openParDirection[$closeParIndex] != '?') {
282
+							$newState = $openParDirection[$closeParIndex];
283
+						}
284
+						$openParDirection[$closeParIndex] = '';
285
+						break;
286
+					}
287
+					if ($openParIndex !== false) {
288
+						// Opening parentheses always inherit the following directionality
320 289
 						self::$waitingText .= $currentLetter;
321 290
 						$workingText = substr($workingText, $currentLen);
322
-						if (self::$currentState != '') {
323
-							$result .= self::$waitingText;
324
-							self::$waitingText = '';
291
+						while (true) {
292
+							if ($workingText === '') {
293
+								break;
294
+							}
295
+							if (substr($workingText, 0, 1) === ' ') {
296
+								// Spaces following this left parenthesis inherit the following directionality too
297
+								self::$waitingText .= ' ';
298
+								$workingText = substr($workingText, 1);
299
+								continue;
300
+							}
301
+							if (substr($workingText, 0, 6) === '&nbsp;') {
302
+								// Spaces following this left parenthesis inherit the following directionality too
303
+								self::$waitingText .= '&nbsp;';
304
+								$workingText = substr($workingText, 6);
305
+								continue;
306
+							}
307
+							break;
325 308
 						}
309
+						$openParDirection[$openParIndex] = '?';
326 310
 						break 2; // double break because we're waiting for more information
327 311
 					}
328
-					if ($newState != self::$currentState) {
329
-						// A direction change has occurred
330
-						self::finishCurrentSpan($result, false);
331
-						self::$previousState = self::$currentState;
332
-						self::$currentState  = $newState;
333
-						self::beginCurrentSpan($result);
334
-					}
312
+
313
+					// We have a digit or a "normal" special character.
314
+					//
315
+					// When this character is not at the start of the input string, it inherits the preceding directionality;
316
+					// at the start of the input string, it assumes the following directionality.
317
+					//
318
+					// Exceptions to this rule will be handled later during final clean-up.
319
+					//
335 320
 					self::$waitingText .= $currentLetter;
336 321
 					$workingText = substr($workingText, $currentLen);
337
-					$result .= self::$waitingText;
338
-					self::$waitingText = '';
322
+					if (self::$currentState != '') {
323
+						$result .= self::$waitingText;
324
+						self::$waitingText = '';
325
+					}
326
+					break 2; // double break because we're waiting for more information
327
+				}
328
+				if ($newState != self::$currentState) {
329
+					// A direction change has occurred
330
+					self::finishCurrentSpan($result, false);
331
+					self::$previousState = self::$currentState;
332
+					self::$currentState  = $newState;
333
+					self::beginCurrentSpan($result);
334
+				}
335
+				self::$waitingText .= $currentLetter;
336
+				$workingText = substr($workingText, $currentLen);
337
+				$result .= self::$waitingText;
338
+				self::$waitingText = '';
339 339
 
340
-					foreach ($openParDirection as $index => $value) {
341
-						// Since we now know the proper direction, remember it for all waiting opening parentheses
342
-						if ($value === '?') {
343
-							$openParDirection[$index] = self::$currentState;
344
-						}
340
+				foreach ($openParDirection as $index => $value) {
341
+					// Since we now know the proper direction, remember it for all waiting opening parentheses
342
+					if ($value === '?') {
343
+						$openParDirection[$index] = self::$currentState;
345 344
 					}
345
+				}
346 346
 
347
-					break;
347
+				break;
348 348
 			}
349 349
 		}
350 350
 
@@ -461,34 +461,34 @@  discard block
 block discarded – undo
461 461
 
462 462
 		// Finally, correct '<LTR>', '</LTR>', '<RTL>', and '</RTL>'
463 463
 		switch ($direction) {
464
-			case 'BOTH':
465
-			case 'both':
466
-				// LTR text: <span dir="ltr"> text </span>
467
-				// RTL text: <span dir="rtl"> text </span>
468
-				$sLTR = '<span dir="ltr" ' . $class . '>' . $nothing;
469
-				$eLTR = $nothing . '</span>';
470
-				$sRTL = '<span dir="rtl" ' . $class . '>' . $nothing;
471
-				$eRTL = $nothing . '</span>';
472
-				break;
473
-			case 'LTR':
474
-			case 'ltr':
475
-				// LTR text: <span dir="ltr"> text </span>
476
-				// RTL text: text
477
-				$sLTR = '<span dir="ltr" ' . $class . '>' . $nothing;
478
-				$eLTR = $nothing . '</span>';
479
-				$sRTL = '';
480
-				$eRTL = '';
481
-				break;
482
-			case 'RTL':
483
-			case 'rtl':
484
-			default:
485
-				// LTR text: text
486
-				// RTL text: <span dir="rtl"> text </span>
487
-				$sLTR = '';
488
-				$eLTR = '';
489
-				$sRTL = '<span dir="rtl" ' . $class . '>' . $nothing;
490
-				$eRTL = $nothing . '</span>';
491
-				break;
464
+		case 'BOTH':
465
+		case 'both':
466
+			// LTR text: <span dir="ltr"> text </span>
467
+			// RTL text: <span dir="rtl"> text </span>
468
+			$sLTR = '<span dir="ltr" ' . $class . '>' . $nothing;
469
+			$eLTR = $nothing . '</span>';
470
+			$sRTL = '<span dir="rtl" ' . $class . '>' . $nothing;
471
+			$eRTL = $nothing . '</span>';
472
+			break;
473
+		case 'LTR':
474
+		case 'ltr':
475
+			// LTR text: <span dir="ltr"> text </span>
476
+			// RTL text: text
477
+			$sLTR = '<span dir="ltr" ' . $class . '>' . $nothing;
478
+			$eLTR = $nothing . '</span>';
479
+			$sRTL = '';
480
+			$eRTL = '';
481
+			break;
482
+		case 'RTL':
483
+		case 'rtl':
484
+		default:
485
+			// LTR text: text
486
+			// RTL text: <span dir="rtl"> text </span>
487
+			$sLTR = '';
488
+			$eLTR = '';
489
+			$sRTL = '<span dir="rtl" ' . $class . '>' . $nothing;
490
+			$eRTL = $nothing . '</span>';
491
+			break;
492 492
 		}
493 493
 		$result = str_replace(array(self::$startLTR, self::$endLTR, self::$startRTL, self::$endRTL), array($sLTR, $eLTR, $sRTL, $eRTL), $result);
494 494
 
Please login to merge, or discard this patch.
app/Functions/Functions.php 1 patch
Switch Indentation   +1485 added lines, -1485 removed lines patch added patch discarded remove patch
@@ -66,29 +66,29 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public static function fileUploadErrorText($error_code) {
68 68
 		switch ($error_code) {
69
-			case UPLOAD_ERR_OK:
70
-				return I18N::translate('File successfully uploaded');
71
-			case UPLOAD_ERR_INI_SIZE:
72
-			case UPLOAD_ERR_FORM_SIZE:
73
-				// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
74
-				return I18N::translate('The uploaded file exceeds the allowed size.');
75
-			case UPLOAD_ERR_PARTIAL:
76
-				// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
77
-				return I18N::translate('The file was only partially uploaded. Please try again.');
78
-			case UPLOAD_ERR_NO_FILE:
79
-				// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
80
-				return I18N::translate('No file was received. Please try again.');
81
-			case UPLOAD_ERR_NO_TMP_DIR:
82
-				// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
83
-				return I18N::translate('The PHP temporary folder is missing.');
84
-			case UPLOAD_ERR_CANT_WRITE:
85
-				// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
86
-				return I18N::translate('PHP failed to write to disk.');
87
-			case UPLOAD_ERR_EXTENSION:
88
-				// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
89
-				return I18N::translate('PHP blocked the file because of its extension.');
90
-			default:
91
-				return 'Error: ' . $error_code;
69
+		case UPLOAD_ERR_OK:
70
+			return I18N::translate('File successfully uploaded');
71
+		case UPLOAD_ERR_INI_SIZE:
72
+		case UPLOAD_ERR_FORM_SIZE:
73
+			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
74
+			return I18N::translate('The uploaded file exceeds the allowed size.');
75
+		case UPLOAD_ERR_PARTIAL:
76
+			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
77
+			return I18N::translate('The file was only partially uploaded. Please try again.');
78
+		case UPLOAD_ERR_NO_FILE:
79
+			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
80
+			return I18N::translate('No file was received. Please try again.');
81
+		case UPLOAD_ERR_NO_TMP_DIR:
82
+			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
83
+			return I18N::translate('The PHP temporary folder is missing.');
84
+		case UPLOAD_ERR_CANT_WRITE:
85
+			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
86
+			return I18N::translate('PHP failed to write to disk.');
87
+		case UPLOAD_ERR_EXTENSION:
88
+			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
89
+			return I18N::translate('PHP blocked the file because of its extension.');
90
+		default:
91
+			return 'Error: ' . $error_code;
92 92
 		}
93 93
 	}
94 94
 
@@ -482,127 +482,127 @@  discard block
 block discarded – undo
482 482
 	 */
483 483
 	public static function cousinName($n, $sex) {
484 484
 		switch ($sex) {
485
-			case 'M':
486
-				switch ($n) {
487
-					case  1:
488
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
489
-						return I18N::translateContext('MALE', 'first cousin');
490
-					case  2:
491
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
492
-						return I18N::translateContext('MALE', 'second cousin');
493
-					case  3:
494
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
495
-						return I18N::translateContext('MALE', 'third cousin');
496
-					case  4:
497
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
498
-						return I18N::translateContext('MALE', 'fourth cousin');
499
-					case  5:
500
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
501
-						return I18N::translateContext('MALE', 'fifth cousin');
502
-					case  6:
503
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
504
-						return I18N::translateContext('MALE', 'sixth cousin');
505
-					case  7:
506
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
507
-						return I18N::translateContext('MALE', 'seventh cousin');
508
-					case  8:
509
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
510
-						return I18N::translateContext('MALE', 'eighth cousin');
511
-					case  9:
512
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
513
-						return I18N::translateContext('MALE', 'ninth cousin');
514
-					case 10:
515
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
516
-						return I18N::translateContext('MALE', 'tenth cousin');
517
-					case 11:
518
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
519
-						return I18N::translateContext('MALE', 'eleventh cousin');
520
-					case 12:
521
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
522
-						return I18N::translateContext('MALE', 'twelfth cousin');
523
-					case 13:
524
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
525
-						return I18N::translateContext('MALE', 'thirteenth cousin');
526
-					case 14:
527
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
528
-						return I18N::translateContext('MALE', 'fourteenth cousin');
529
-					case 15:
530
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
531
-						return I18N::translateContext('MALE', 'fifteenth cousin');
532
-					default:
533
-						/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
534
-						return I18N::translateContext('MALE', '%s × cousin', I18N::number($n));
535
-				}
536
-			case 'F':
537
-				switch ($n) {
538
-					case  1:
539
-						return I18N::translateContext('FEMALE', 'first cousin');
540
-					case  2:
541
-						return I18N::translateContext('FEMALE', 'second cousin');
542
-					case  3:
543
-						return I18N::translateContext('FEMALE', 'third cousin');
544
-					case  4:
545
-						return I18N::translateContext('FEMALE', 'fourth cousin');
546
-					case  5:
547
-						return I18N::translateContext('FEMALE', 'fifth cousin');
548
-					case  6:
549
-						return I18N::translateContext('FEMALE', 'sixth cousin');
550
-					case  7:
551
-						return I18N::translateContext('FEMALE', 'seventh cousin');
552
-					case  8:
553
-						return I18N::translateContext('FEMALE', 'eighth cousin');
554
-					case  9:
555
-						return I18N::translateContext('FEMALE', 'ninth cousin');
556
-					case 10:
557
-						return I18N::translateContext('FEMALE', 'tenth cousin');
558
-					case 11:
559
-						return I18N::translateContext('FEMALE', 'eleventh cousin');
560
-					case 12:
561
-						return I18N::translateContext('FEMALE', 'twelfth cousin');
562
-					case 13:
563
-						return I18N::translateContext('FEMALE', 'thirteenth cousin');
564
-					case 14:
565
-						return I18N::translateContext('FEMALE', 'fourteenth cousin');
566
-					case 15:
567
-						return I18N::translateContext('FEMALE', 'fifteenth cousin');
568
-					default:
569
-						return I18N::translateContext('FEMALE', '%s × cousin', I18N::number($n));
570
-				}
485
+		case 'M':
486
+			switch ($n) {
487
+			case  1:
488
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
489
+			return I18N::translateContext('MALE', 'first cousin');
490
+			case  2:
491
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
492
+			return I18N::translateContext('MALE', 'second cousin');
493
+			case  3:
494
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
495
+			return I18N::translateContext('MALE', 'third cousin');
496
+			case  4:
497
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
498
+			return I18N::translateContext('MALE', 'fourth cousin');
499
+			case  5:
500
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
501
+			return I18N::translateContext('MALE', 'fifth cousin');
502
+			case  6:
503
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
504
+			return I18N::translateContext('MALE', 'sixth cousin');
505
+			case  7:
506
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
507
+			return I18N::translateContext('MALE', 'seventh cousin');
508
+			case  8:
509
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
510
+			return I18N::translateContext('MALE', 'eighth cousin');
511
+			case  9:
512
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
513
+			return I18N::translateContext('MALE', 'ninth cousin');
514
+			case 10:
515
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
516
+			return I18N::translateContext('MALE', 'tenth cousin');
517
+			case 11:
518
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
519
+			return I18N::translateContext('MALE', 'eleventh cousin');
520
+			case 12:
521
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
522
+			return I18N::translateContext('MALE', 'twelfth cousin');
523
+			case 13:
524
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
525
+			return I18N::translateContext('MALE', 'thirteenth cousin');
526
+			case 14:
527
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
528
+			return I18N::translateContext('MALE', 'fourteenth cousin');
529
+			case 15:
530
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
531
+			return I18N::translateContext('MALE', 'fifteenth cousin');
571 532
 			default:
572
-				switch ($n) {
573
-					case  1:
574
-						return I18N::translateContext('MALE/FEMALE', 'first cousin');
575
-					case  2:
576
-						return I18N::translateContext('MALE/FEMALE', 'second cousin');
577
-					case  3:
578
-						return I18N::translateContext('MALE/FEMALE', 'third cousin');
579
-					case  4:
580
-						return I18N::translateContext('MALE/FEMALE', 'fourth cousin');
581
-					case  5:
582
-						return I18N::translateContext('MALE/FEMALE', 'fifth cousin');
583
-					case  6:
584
-						return I18N::translateContext('MALE/FEMALE', 'sixth cousin');
585
-					case  7:
586
-						return I18N::translateContext('MALE/FEMALE', 'seventh cousin');
587
-					case  8:
588
-						return I18N::translateContext('MALE/FEMALE', 'eighth cousin');
589
-					case  9:
590
-						return I18N::translateContext('MALE/FEMALE', 'ninth cousin');
591
-					case 10:
592
-						return I18N::translateContext('MALE/FEMALE', 'tenth cousin');
593
-					case 11:
594
-						return I18N::translateContext('MALE/FEMALE', 'eleventh cousin');
595
-					case 12:
596
-						return I18N::translateContext('MALE/FEMALE', 'twelfth cousin');
597
-					case 13:
598
-						return I18N::translateContext('MALE/FEMALE', 'thirteenth cousin');
599
-					case 14:
600
-						return I18N::translateContext('MALE/FEMALE', 'fourteenth cousin');
601
-					case 15:
602
-						return I18N::translateContext('MALE/FEMALE', 'fifteenth cousin');
603
-					default:
604
-						return I18N::translateContext('MALE/FEMALE', '%s × cousin', I18N::number($n));
605
-				}
533
+			/* I18N: Note that for Italian and Polish, “N’th cousins” are different from English “N’th cousins”, and the software has already generated the correct “N” for your language. You only need to translate - you do not need to convert. For other languages, if your cousin rules are different from English, please contact the developers. */
534
+			return I18N::translateContext('MALE', '%s × cousin', I18N::number($n));
535
+			}
536
+		case 'F':
537
+			switch ($n) {
538
+			case  1:
539
+			return I18N::translateContext('FEMALE', 'first cousin');
540
+			case  2:
541
+			return I18N::translateContext('FEMALE', 'second cousin');
542
+			case  3:
543
+			return I18N::translateContext('FEMALE', 'third cousin');
544
+			case  4:
545
+			return I18N::translateContext('FEMALE', 'fourth cousin');
546
+			case  5:
547
+			return I18N::translateContext('FEMALE', 'fifth cousin');
548
+			case  6:
549
+			return I18N::translateContext('FEMALE', 'sixth cousin');
550
+			case  7:
551
+			return I18N::translateContext('FEMALE', 'seventh cousin');
552
+			case  8:
553
+			return I18N::translateContext('FEMALE', 'eighth cousin');
554
+			case  9:
555
+			return I18N::translateContext('FEMALE', 'ninth cousin');
556
+			case 10:
557
+			return I18N::translateContext('FEMALE', 'tenth cousin');
558
+			case 11:
559
+			return I18N::translateContext('FEMALE', 'eleventh cousin');
560
+			case 12:
561
+			return I18N::translateContext('FEMALE', 'twelfth cousin');
562
+			case 13:
563
+			return I18N::translateContext('FEMALE', 'thirteenth cousin');
564
+			case 14:
565
+			return I18N::translateContext('FEMALE', 'fourteenth cousin');
566
+			case 15:
567
+			return I18N::translateContext('FEMALE', 'fifteenth cousin');
568
+			default:
569
+			return I18N::translateContext('FEMALE', '%s × cousin', I18N::number($n));
570
+			}
571
+		default:
572
+			switch ($n) {
573
+			case  1:
574
+			return I18N::translateContext('MALE/FEMALE', 'first cousin');
575
+			case  2:
576
+			return I18N::translateContext('MALE/FEMALE', 'second cousin');
577
+			case  3:
578
+			return I18N::translateContext('MALE/FEMALE', 'third cousin');
579
+			case  4:
580
+			return I18N::translateContext('MALE/FEMALE', 'fourth cousin');
581
+			case  5:
582
+			return I18N::translateContext('MALE/FEMALE', 'fifth cousin');
583
+			case  6:
584
+			return I18N::translateContext('MALE/FEMALE', 'sixth cousin');
585
+			case  7:
586
+			return I18N::translateContext('MALE/FEMALE', 'seventh cousin');
587
+			case  8:
588
+			return I18N::translateContext('MALE/FEMALE', 'eighth cousin');
589
+			case  9:
590
+			return I18N::translateContext('MALE/FEMALE', 'ninth cousin');
591
+			case 10:
592
+			return I18N::translateContext('MALE/FEMALE', 'tenth cousin');
593
+			case 11:
594
+			return I18N::translateContext('MALE/FEMALE', 'eleventh cousin');
595
+			case 12:
596
+			return I18N::translateContext('MALE/FEMALE', 'twelfth cousin');
597
+			case 13:
598
+			return I18N::translateContext('MALE/FEMALE', 'thirteenth cousin');
599
+			case 14:
600
+			return I18N::translateContext('MALE/FEMALE', 'fourteenth cousin');
601
+			case 15:
602
+			return I18N::translateContext('MALE/FEMALE', 'fifteenth cousin');
603
+			default:
604
+			return I18N::translateContext('MALE/FEMALE', '%s × cousin', I18N::number($n));
605
+			}
606 606
 		}
607 607
 	}
608 608
 
@@ -618,51 +618,51 @@  discard block
 block discarded – undo
618 618
 	 */
619 619
 	public static function cousinName2($n, $sex, $relation) {
620 620
 		switch ($sex) {
621
-			case 'M':
622
-				switch ($n) {
623
-					case  1: // I18N: A Spanish relationship name, such as third great-nephew
624
-						return I18N::translateContext('MALE', 'first %s', $relation);
625
-					case  2:
626
-						return I18N::translateContext('MALE', 'second %s', $relation);
627
-					case  3:
628
-						return I18N::translateContext('MALE', 'third %s', $relation);
629
-					case  4:
630
-						return I18N::translateContext('MALE', 'fourth %s', $relation);
631
-					case  5:
632
-						return I18N::translateContext('MALE', 'fifth %s', $relation);
633
-					default: // I18N: A Spanish relationship name, such as third great-nephew
634
-						return I18N::translateContext('MALE', '%1$s × %2$s', I18N::number($n), $relation);
635
-				}
636
-			case 'F':
637
-				switch ($n) {
638
-					case  1: // I18N: A Spanish relationship name, such as third great-nephew
639
-						return I18N::translateContext('FEMALE', 'first %s', $relation);
640
-					case  2:
641
-						return I18N::translateContext('FEMALE', 'second %s', $relation);
642
-					case  3:
643
-						return I18N::translateContext('FEMALE', 'third %s', $relation);
644
-					case  4:
645
-						return I18N::translateContext('FEMALE', 'fourth %s', $relation);
646
-					case  5:
647
-						return I18N::translateContext('FEMALE', 'fifth %s', $relation);
648
-					default: // I18N: A Spanish relationship name, such as third great-nephew
649
-						return I18N::translateContext('FEMALE', '%1$s × %2$s', I18N::number($n), $relation);
650
-				}
651
-			default:
652
-				switch ($n) {
653
-					case  1: // I18N: A Spanish relationship name, such as third great-nephew
654
-						return I18N::translateContext('MALE/FEMALE', 'first %s', $relation);
655
-					case  2:
656
-						return I18N::translateContext('MALE/FEMALE', 'second %s', $relation);
657
-					case  3:
658
-						return I18N::translateContext('MALE/FEMALE', 'third %s', $relation);
659
-					case  4:
660
-						return I18N::translateContext('MALE/FEMALE', 'fourth %s', $relation);
661
-					case  5:
662
-						return I18N::translateContext('MALE/FEMALE', 'fifth %s', $relation);
663
-					default: // I18N: A Spanish relationship name, such as third great-nephew
664
-						return I18N::translateContext('MALE/FEMALE', '%1$s × %2$s', I18N::number($n), $relation);
665
-				}
621
+		case 'M':
622
+			switch ($n) {
623
+			case  1: // I18N: A Spanish relationship name, such as third great-nephew
624
+			return I18N::translateContext('MALE', 'first %s', $relation);
625
+			case  2:
626
+			return I18N::translateContext('MALE', 'second %s', $relation);
627
+			case  3:
628
+			return I18N::translateContext('MALE', 'third %s', $relation);
629
+			case  4:
630
+			return I18N::translateContext('MALE', 'fourth %s', $relation);
631
+			case  5:
632
+			return I18N::translateContext('MALE', 'fifth %s', $relation);
633
+			default: // I18N: A Spanish relationship name, such as third great-nephew
634
+			return I18N::translateContext('MALE', '%1$s × %2$s', I18N::number($n), $relation);
635
+			}
636
+		case 'F':
637
+			switch ($n) {
638
+			case  1: // I18N: A Spanish relationship name, such as third great-nephew
639
+			return I18N::translateContext('FEMALE', 'first %s', $relation);
640
+			case  2:
641
+			return I18N::translateContext('FEMALE', 'second %s', $relation);
642
+			case  3:
643
+			return I18N::translateContext('FEMALE', 'third %s', $relation);
644
+			case  4:
645
+			return I18N::translateContext('FEMALE', 'fourth %s', $relation);
646
+			case  5:
647
+			return I18N::translateContext('FEMALE', 'fifth %s', $relation);
648
+			default: // I18N: A Spanish relationship name, such as third great-nephew
649
+			return I18N::translateContext('FEMALE', '%1$s × %2$s', I18N::number($n), $relation);
650
+			}
651
+		default:
652
+			switch ($n) {
653
+			case  1: // I18N: A Spanish relationship name, such as third great-nephew
654
+			return I18N::translateContext('MALE/FEMALE', 'first %s', $relation);
655
+			case  2:
656
+			return I18N::translateContext('MALE/FEMALE', 'second %s', $relation);
657
+			case  3:
658
+			return I18N::translateContext('MALE/FEMALE', 'third %s', $relation);
659
+			case  4:
660
+			return I18N::translateContext('MALE/FEMALE', 'fourth %s', $relation);
661
+			case  5:
662
+			return I18N::translateContext('MALE/FEMALE', 'fifth %s', $relation);
663
+			default: // I18N: A Spanish relationship name, such as third great-nephew
664
+			return I18N::translateContext('MALE/FEMALE', '%1$s × %2$s', I18N::number($n), $relation);
665
+			}
666 666
 		}
667 667
 	}
668 668
 
@@ -699,796 +699,796 @@  discard block
 block discarded – undo
699 699
 		}
700 700
 
701 701
 		switch ($path) {
702
-			case '':
703
-				return I18N::translate('self');
704
-			//  Level One relationships
705
-			case 'mot':
706
-				return I18N::translate('mother');
707
-			case 'fat':
708
-				return I18N::translate('father');
709
-			case 'par':
710
-				return I18N::translate('parent');
711
-			case 'hus':
712
-				if ($person1 && $person2) {
713
-					foreach ($person1->getSpouseFamilies() as $family) {
714
-						if ($person2 === $family->getSpouse($person1)) {
715
-							if ($family->getFacts('_NMR')) {
716
-								if ($family->getFacts(WT_EVENTS_DIV)) {
717
-									return I18N::translateContext('MALE', 'ex-partner');
718
-								} else {
719
-									return I18N::translateContext('MALE', 'partner');
720
-								}
721
-							} elseif ($family->getFacts(WT_EVENTS_DIV)) {
722
-								return I18N::translate('ex-husband');
702
+		case '':
703
+			return I18N::translate('self');
704
+		//  Level One relationships
705
+		case 'mot':
706
+			return I18N::translate('mother');
707
+		case 'fat':
708
+			return I18N::translate('father');
709
+		case 'par':
710
+			return I18N::translate('parent');
711
+		case 'hus':
712
+			if ($person1 && $person2) {
713
+				foreach ($person1->getSpouseFamilies() as $family) {
714
+					if ($person2 === $family->getSpouse($person1)) {
715
+						if ($family->getFacts('_NMR')) {
716
+							if ($family->getFacts(WT_EVENTS_DIV)) {
717
+								return I18N::translateContext('MALE', 'ex-partner');
718
+							} else {
719
+								return I18N::translateContext('MALE', 'partner');
723 720
 							}
721
+						} elseif ($family->getFacts(WT_EVENTS_DIV)) {
722
+							return I18N::translate('ex-husband');
724 723
 						}
725 724
 					}
726 725
 				}
726
+			}
727 727
 
728
-				return I18N::translate('husband');
729
-			case 'wif':
730
-				if ($person1 && $person1) {
731
-					foreach ($person1->getSpouseFamilies() as $family) {
732
-						if ($person2 === $family->getSpouse($person1)) {
733
-							if ($family->getFacts('_NMR')) {
734
-								if ($family->getFacts(WT_EVENTS_DIV)) {
735
-									return I18N::translateContext('FEMALE', 'ex-partner');
736
-								} else {
737
-									return I18N::translateContext('FEMALE', 'partner');
738
-								}
739
-							} elseif ($family->getFacts(WT_EVENTS_DIV)) {
740
-								return I18N::translate('ex-wife');
728
+			return I18N::translate('husband');
729
+		case 'wif':
730
+			if ($person1 && $person1) {
731
+				foreach ($person1->getSpouseFamilies() as $family) {
732
+					if ($person2 === $family->getSpouse($person1)) {
733
+						if ($family->getFacts('_NMR')) {
734
+							if ($family->getFacts(WT_EVENTS_DIV)) {
735
+								return I18N::translateContext('FEMALE', 'ex-partner');
736
+							} else {
737
+								return I18N::translateContext('FEMALE', 'partner');
741 738
 							}
739
+						} elseif ($family->getFacts(WT_EVENTS_DIV)) {
740
+							return I18N::translate('ex-wife');
742 741
 						}
743 742
 					}
744 743
 				}
744
+			}
745 745
 
746
-				return I18N::translate('wife');
747
-			case 'spo':
748
-				if ($person1 && $person2) {
749
-					foreach ($person1->getSpouseFamilies() as $family) {
750
-						if ($person2 === $family->getSpouse($person1)) {
751
-							if ($family->getFacts('_NMR')) {
752
-								if ($family->getFacts(WT_EVENTS_DIV)) {
753
-									return I18N::translateContext('MALE/FEMALE', 'ex-partner');
754
-								} else {
755
-									return I18N::translateContext('MALE/FEMALE', 'partner');
756
-								}
757
-							} elseif ($family->getFacts(WT_EVENTS_DIV)) {
758
-								return I18N::translate('ex-spouse');
746
+			return I18N::translate('wife');
747
+		case 'spo':
748
+			if ($person1 && $person2) {
749
+				foreach ($person1->getSpouseFamilies() as $family) {
750
+					if ($person2 === $family->getSpouse($person1)) {
751
+						if ($family->getFacts('_NMR')) {
752
+							if ($family->getFacts(WT_EVENTS_DIV)) {
753
+								return I18N::translateContext('MALE/FEMALE', 'ex-partner');
754
+							} else {
755
+								return I18N::translateContext('MALE/FEMALE', 'partner');
759 756
 							}
757
+						} elseif ($family->getFacts(WT_EVENTS_DIV)) {
758
+							return I18N::translate('ex-spouse');
760 759
 						}
761 760
 					}
762 761
 				}
762
+			}
763 763
 
764
-				return I18N::translate('spouse');
765
-			case 'son':
766
-				return I18N::translate('son');
767
-			case 'dau':
768
-				return I18N::translate('daughter');
769
-			case 'chi':
770
-				return I18N::translate('child');
771
-			case 'bro':
772
-				if ($person1 && $person2) {
773
-					$dob1 = $person1->getBirthDate();
774
-					$dob2 = $person2->getBirthDate();
775
-					if ($dob1->isOK() && $dob2->isOK()) {
776
-						if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
777
-							// Exclude BEF, AFT, etc.
778
-							return I18N::translate('twin brother');
779
-						} elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
780
-							return I18N::translate('younger brother');
781
-						} elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
782
-							return I18N::translate('elder brother');
783
-						}
764
+			return I18N::translate('spouse');
765
+		case 'son':
766
+			return I18N::translate('son');
767
+		case 'dau':
768
+			return I18N::translate('daughter');
769
+		case 'chi':
770
+			return I18N::translate('child');
771
+		case 'bro':
772
+			if ($person1 && $person2) {
773
+				$dob1 = $person1->getBirthDate();
774
+				$dob2 = $person2->getBirthDate();
775
+				if ($dob1->isOK() && $dob2->isOK()) {
776
+					if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
777
+						// Exclude BEF, AFT, etc.
778
+						return I18N::translate('twin brother');
779
+					} elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
780
+						return I18N::translate('younger brother');
781
+					} elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
782
+						return I18N::translate('elder brother');
784 783
 					}
785 784
 				}
785
+			}
786 786
 
787
-				return I18N::translate('brother');
788
-			case 'sis':
789
-				if ($person1 && $person2) {
790
-					$dob1 = $person1->getBirthDate();
791
-					$dob2 = $person2->getBirthDate();
792
-					if ($dob1->isOK() && $dob2->isOK()) {
793
-						if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
794
-							// Exclude BEF, AFT, etc.
795
-							return I18N::translate('twin sister');
796
-						} elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
797
-							return I18N::translate('younger sister');
798
-						} elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
799
-							return I18N::translate('elder sister');
800
-						}
787
+			return I18N::translate('brother');
788
+		case 'sis':
789
+			if ($person1 && $person2) {
790
+				$dob1 = $person1->getBirthDate();
791
+				$dob2 = $person2->getBirthDate();
792
+				if ($dob1->isOK() && $dob2->isOK()) {
793
+					if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
794
+						// Exclude BEF, AFT, etc.
795
+						return I18N::translate('twin sister');
796
+					} elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
797
+						return I18N::translate('younger sister');
798
+					} elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
799
+						return I18N::translate('elder sister');
801 800
 					}
802 801
 				}
802
+			}
803 803
 
804
-				return I18N::translate('sister');
805
-			case 'sib':
806
-				if ($person1 && $person2) {
807
-					$dob1 = $person1->getBirthDate();
808
-					$dob2 = $person2->getBirthDate();
809
-					if ($dob1->isOK() && $dob2->isOK()) {
810
-						if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
811
-							// Exclude BEF, AFT, etc.
812
-							return I18N::translate('twin sibling');
813
-						} elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
814
-							return I18N::translate('younger sibling');
815
-						} elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
816
-							return I18N::translate('elder sibling');
817
-						}
804
+			return I18N::translate('sister');
805
+		case 'sib':
806
+			if ($person1 && $person2) {
807
+				$dob1 = $person1->getBirthDate();
808
+				$dob2 = $person2->getBirthDate();
809
+				if ($dob1->isOK() && $dob2->isOK()) {
810
+					if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
811
+						// Exclude BEF, AFT, etc.
812
+						return I18N::translate('twin sibling');
813
+					} elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
814
+						return I18N::translate('younger sibling');
815
+					} elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
816
+						return I18N::translate('elder sibling');
818 817
 					}
819 818
 				}
819
+			}
820 820
 
821
-				return I18N::translate('sibling');
821
+			return I18N::translate('sibling');
822 822
 
823
-			// Level Two relationships
824
-			case 'brochi':
825
-				return I18N::translateContext('brother’s child', 'nephew/niece');
826
-			case 'brodau':
827
-				return I18N::translateContext('brother’s daughter', 'niece');
828
-			case 'broson':
829
-				return I18N::translateContext('brother’s son', 'nephew');
830
-			case 'browif':
831
-				return I18N::translateContext('brother’s wife', 'sister-in-law');
832
-			case 'chichi':
833
-				return I18N::translateContext('child’s child', 'grandchild');
834
-			case 'chidau':
835
-				return I18N::translateContext('child’s daughter', 'granddaughter');
836
-			case 'chihus':
837
-				return I18N::translateContext('child’s husband', 'son-in-law');
838
-			case 'chison':
839
-				return I18N::translateContext('child’s son', 'grandson');
840
-			case 'chispo':
841
-				return I18N::translateContext('child’s spouse', 'son/daughter-in-law');
842
-			case 'chiwif':
843
-				return I18N::translateContext('child’s wife', 'daughter-in-law');
844
-			case 'dauchi':
845
-				return I18N::translateContext('daughter’s child', 'grandchild');
846
-			case 'daudau':
847
-				return I18N::translateContext('daughter’s daughter', 'granddaughter');
848
-			case 'dauhus':
849
-				return I18N::translateContext('daughter’s husband', 'son-in-law');
850
-			case 'dauson':
851
-				return I18N::translateContext('daughter’s son', 'grandson');
852
-			case 'fatbro':
853
-				return I18N::translateContext('father’s brother', 'uncle');
854
-			case 'fatchi':
855
-				return I18N::translateContext('father’s child', 'half-sibling');
856
-			case 'fatdau':
857
-				return I18N::translateContext('father’s daughter', 'half-sister');
858
-			case 'fatfat':
859
-				return I18N::translateContext('father’s father', 'paternal grandfather');
860
-			case 'fatmot':
861
-				return I18N::translateContext('father’s mother', 'paternal grandmother');
862
-			case 'fatpar':
863
-				return I18N::translateContext('father’s parent', 'paternal grandparent');
864
-			case 'fatsib':
865
-				return I18N::translateContext('father’s sibling', 'aunt/uncle');
866
-			case 'fatsis':
867
-				return I18N::translateContext('father’s sister', 'aunt');
868
-			case 'fatson':
869
-				return I18N::translateContext('father’s son', 'half-brother');
870
-			case 'fatwif':
871
-				return I18N::translateContext('father’s wife', 'step-mother');
872
-			case 'husbro':
873
-				return I18N::translateContext('husband’s brother', 'brother-in-law');
874
-			case 'huschi':
875
-				return I18N::translateContext('husband’s child', 'step-child');
876
-			case 'husdau':
877
-				return I18N::translateContext('husband’s daughter', 'step-daughter');
878
-			case 'husfat':
879
-				return I18N::translateContext('husband’s father', 'father-in-law');
880
-			case 'husmot':
881
-				return I18N::translateContext('husband’s mother', 'mother-in-law');
882
-			case 'hussib':
883
-				return I18N::translateContext('husband’s sibling', 'brother/sister-in-law');
884
-			case 'hussis':
885
-				return I18N::translateContext('husband’s sister', 'sister-in-law');
886
-			case 'husson':
887
-				return I18N::translateContext('husband’s son', 'step-son');
888
-			case 'motbro':
889
-				return I18N::translateContext('mother’s brother', 'uncle');
890
-			case 'motchi':
891
-				return I18N::translateContext('mother’s child', 'half-sibling');
892
-			case 'motdau':
893
-				return I18N::translateContext('mother’s daughter', 'half-sister');
894
-			case 'motfat':
895
-				return I18N::translateContext('mother’s father', 'maternal grandfather');
896
-			case 'mothus':
897
-				return I18N::translateContext('mother’s husband', 'step-father');
898
-			case 'motmot':
899
-				return I18N::translateContext('mother’s mother', 'maternal grandmother');
900
-			case 'motpar':
901
-				return I18N::translateContext('mother’s parent', 'maternal grandparent');
902
-			case 'motsib':
903
-				return I18N::translateContext('mother’s sibling', 'aunt/uncle');
904
-			case 'motsis':
905
-				return I18N::translateContext('mother’s sister', 'aunt');
906
-			case 'motson':
907
-				return I18N::translateContext('mother’s son', 'half-brother');
908
-			case 'parbro':
909
-				return I18N::translateContext('parent’s brother', 'uncle');
910
-			case 'parchi':
911
-				return I18N::translateContext('parent’s child', 'half-sibling');
912
-			case 'pardau':
913
-				return I18N::translateContext('parent’s daughter', 'half-sister');
914
-			case 'parfat':
915
-				return I18N::translateContext('parent’s father', 'grandfather');
916
-			case 'parmot':
917
-				return I18N::translateContext('parent’s mother', 'grandmother');
918
-			case 'parpar':
919
-				return I18N::translateContext('parent’s parent', 'grandparent');
920
-			case 'parsib':
921
-				return I18N::translateContext('parent’s sibling', 'aunt/uncle');
922
-			case 'parsis':
923
-				return I18N::translateContext('parent’s sister', 'aunt');
924
-			case 'parson':
925
-				return I18N::translateContext('parent’s son', 'half-brother');
926
-			case 'parspo':
927
-				return I18N::translateContext('parent’s spouse', 'step-parent');
928
-			case 'sibchi':
929
-				return I18N::translateContext('sibling’s child', 'nephew/niece');
930
-			case 'sibdau':
931
-				return I18N::translateContext('sibling’s daughter', 'niece');
932
-			case 'sibson':
933
-				return I18N::translateContext('sibling’s son', 'nephew');
934
-			case 'sibspo':
935
-				return I18N::translateContext('sibling’s spouse', 'brother/sister-in-law');
936
-			case 'sischi':
937
-				return I18N::translateContext('sister’s child', 'nephew/niece');
938
-			case 'sisdau':
939
-				return I18N::translateContext('sister’s daughter', 'niece');
940
-			case 'sishus':
941
-				return I18N::translateContext('sister’s husband', 'brother-in-law');
942
-			case 'sisson':
943
-				return I18N::translateContext('sister’s son', 'nephew');
944
-			case 'sonchi':
945
-				return I18N::translateContext('son’s child', 'grandchild');
946
-			case 'sondau':
947
-				return I18N::translateContext('son’s daughter', 'granddaughter');
948
-			case 'sonson':
949
-				return I18N::translateContext('son’s son', 'grandson');
950
-			case 'sonwif':
951
-				return I18N::translateContext('son’s wife', 'daughter-in-law');
952
-			case 'spobro':
953
-				return I18N::translateContext('spouse’s brother', 'brother-in-law');
954
-			case 'spochi':
955
-				return I18N::translateContext('spouse’s child', 'step-child');
956
-			case 'spodau':
957
-				return I18N::translateContext('spouse’s daughter', 'step-daughter');
958
-			case 'spofat':
959
-				return I18N::translateContext('spouse’s father', 'father-in-law');
960
-			case 'spomot':
961
-				return I18N::translateContext('spouse’s mother', 'mother-in-law');
962
-			case 'sposis':
963
-				return I18N::translateContext('spouse’s sister', 'sister-in-law');
964
-			case 'sposon':
965
-				return I18N::translateContext('spouse’s son', 'step-son');
966
-			case 'spopar':
967
-				return I18N::translateContext('spouse’s parent', 'mother/father-in-law');
968
-			case 'sposib':
969
-				return I18N::translateContext('spouse’s sibling', 'brother/sister-in-law');
970
-			case 'wifbro':
971
-				return I18N::translateContext('wife’s brother', 'brother-in-law');
972
-			case 'wifchi':
973
-				return I18N::translateContext('wife’s child', 'step-child');
974
-			case 'wifdau':
975
-				return I18N::translateContext('wife’s daughter', 'step-daughter');
976
-			case 'wiffat':
977
-				return I18N::translateContext('wife’s father', 'father-in-law');
978
-			case 'wifmot':
979
-				return I18N::translateContext('wife’s mother', 'mother-in-law');
980
-			case 'wifsib':
981
-				return I18N::translateContext('wife’s sibling', 'brother/sister-in-law');
982
-			case 'wifsis':
983
-				return I18N::translateContext('wife’s sister', 'sister-in-law');
984
-			case 'wifson':
985
-				return I18N::translateContext('wife’s son', 'step-son');
823
+		// Level Two relationships
824
+		case 'brochi':
825
+			return I18N::translateContext('brother’s child', 'nephew/niece');
826
+		case 'brodau':
827
+			return I18N::translateContext('brother’s daughter', 'niece');
828
+		case 'broson':
829
+			return I18N::translateContext('brother’s son', 'nephew');
830
+		case 'browif':
831
+			return I18N::translateContext('brother’s wife', 'sister-in-law');
832
+		case 'chichi':
833
+			return I18N::translateContext('child’s child', 'grandchild');
834
+		case 'chidau':
835
+			return I18N::translateContext('child’s daughter', 'granddaughter');
836
+		case 'chihus':
837
+			return I18N::translateContext('child’s husband', 'son-in-law');
838
+		case 'chison':
839
+			return I18N::translateContext('child’s son', 'grandson');
840
+		case 'chispo':
841
+			return I18N::translateContext('child’s spouse', 'son/daughter-in-law');
842
+		case 'chiwif':
843
+			return I18N::translateContext('child’s wife', 'daughter-in-law');
844
+		case 'dauchi':
845
+			return I18N::translateContext('daughter’s child', 'grandchild');
846
+		case 'daudau':
847
+			return I18N::translateContext('daughter’s daughter', 'granddaughter');
848
+		case 'dauhus':
849
+			return I18N::translateContext('daughter’s husband', 'son-in-law');
850
+		case 'dauson':
851
+			return I18N::translateContext('daughter’s son', 'grandson');
852
+		case 'fatbro':
853
+			return I18N::translateContext('father’s brother', 'uncle');
854
+		case 'fatchi':
855
+			return I18N::translateContext('father’s child', 'half-sibling');
856
+		case 'fatdau':
857
+			return I18N::translateContext('father’s daughter', 'half-sister');
858
+		case 'fatfat':
859
+			return I18N::translateContext('father’s father', 'paternal grandfather');
860
+		case 'fatmot':
861
+			return I18N::translateContext('father’s mother', 'paternal grandmother');
862
+		case 'fatpar':
863
+			return I18N::translateContext('father’s parent', 'paternal grandparent');
864
+		case 'fatsib':
865
+			return I18N::translateContext('father’s sibling', 'aunt/uncle');
866
+		case 'fatsis':
867
+			return I18N::translateContext('father’s sister', 'aunt');
868
+		case 'fatson':
869
+			return I18N::translateContext('father’s son', 'half-brother');
870
+		case 'fatwif':
871
+			return I18N::translateContext('father’s wife', 'step-mother');
872
+		case 'husbro':
873
+			return I18N::translateContext('husband’s brother', 'brother-in-law');
874
+		case 'huschi':
875
+			return I18N::translateContext('husband’s child', 'step-child');
876
+		case 'husdau':
877
+			return I18N::translateContext('husband’s daughter', 'step-daughter');
878
+		case 'husfat':
879
+			return I18N::translateContext('husband’s father', 'father-in-law');
880
+		case 'husmot':
881
+			return I18N::translateContext('husband’s mother', 'mother-in-law');
882
+		case 'hussib':
883
+			return I18N::translateContext('husband’s sibling', 'brother/sister-in-law');
884
+		case 'hussis':
885
+			return I18N::translateContext('husband’s sister', 'sister-in-law');
886
+		case 'husson':
887
+			return I18N::translateContext('husband’s son', 'step-son');
888
+		case 'motbro':
889
+			return I18N::translateContext('mother’s brother', 'uncle');
890
+		case 'motchi':
891
+			return I18N::translateContext('mother’s child', 'half-sibling');
892
+		case 'motdau':
893
+			return I18N::translateContext('mother’s daughter', 'half-sister');
894
+		case 'motfat':
895
+			return I18N::translateContext('mother’s father', 'maternal grandfather');
896
+		case 'mothus':
897
+			return I18N::translateContext('mother’s husband', 'step-father');
898
+		case 'motmot':
899
+			return I18N::translateContext('mother’s mother', 'maternal grandmother');
900
+		case 'motpar':
901
+			return I18N::translateContext('mother’s parent', 'maternal grandparent');
902
+		case 'motsib':
903
+			return I18N::translateContext('mother’s sibling', 'aunt/uncle');
904
+		case 'motsis':
905
+			return I18N::translateContext('mother’s sister', 'aunt');
906
+		case 'motson':
907
+			return I18N::translateContext('mother’s son', 'half-brother');
908
+		case 'parbro':
909
+			return I18N::translateContext('parent’s brother', 'uncle');
910
+		case 'parchi':
911
+			return I18N::translateContext('parent’s child', 'half-sibling');
912
+		case 'pardau':
913
+			return I18N::translateContext('parent’s daughter', 'half-sister');
914
+		case 'parfat':
915
+			return I18N::translateContext('parent’s father', 'grandfather');
916
+		case 'parmot':
917
+			return I18N::translateContext('parent’s mother', 'grandmother');
918
+		case 'parpar':
919
+			return I18N::translateContext('parent’s parent', 'grandparent');
920
+		case 'parsib':
921
+			return I18N::translateContext('parent’s sibling', 'aunt/uncle');
922
+		case 'parsis':
923
+			return I18N::translateContext('parent’s sister', 'aunt');
924
+		case 'parson':
925
+			return I18N::translateContext('parent’s son', 'half-brother');
926
+		case 'parspo':
927
+			return I18N::translateContext('parent’s spouse', 'step-parent');
928
+		case 'sibchi':
929
+			return I18N::translateContext('sibling’s child', 'nephew/niece');
930
+		case 'sibdau':
931
+			return I18N::translateContext('sibling’s daughter', 'niece');
932
+		case 'sibson':
933
+			return I18N::translateContext('sibling’s son', 'nephew');
934
+		case 'sibspo':
935
+			return I18N::translateContext('sibling’s spouse', 'brother/sister-in-law');
936
+		case 'sischi':
937
+			return I18N::translateContext('sister’s child', 'nephew/niece');
938
+		case 'sisdau':
939
+			return I18N::translateContext('sister’s daughter', 'niece');
940
+		case 'sishus':
941
+			return I18N::translateContext('sister’s husband', 'brother-in-law');
942
+		case 'sisson':
943
+			return I18N::translateContext('sister’s son', 'nephew');
944
+		case 'sonchi':
945
+			return I18N::translateContext('son’s child', 'grandchild');
946
+		case 'sondau':
947
+			return I18N::translateContext('son’s daughter', 'granddaughter');
948
+		case 'sonson':
949
+			return I18N::translateContext('son’s son', 'grandson');
950
+		case 'sonwif':
951
+			return I18N::translateContext('son’s wife', 'daughter-in-law');
952
+		case 'spobro':
953
+			return I18N::translateContext('spouse’s brother', 'brother-in-law');
954
+		case 'spochi':
955
+			return I18N::translateContext('spouse’s child', 'step-child');
956
+		case 'spodau':
957
+			return I18N::translateContext('spouse’s daughter', 'step-daughter');
958
+		case 'spofat':
959
+			return I18N::translateContext('spouse’s father', 'father-in-law');
960
+		case 'spomot':
961
+			return I18N::translateContext('spouse’s mother', 'mother-in-law');
962
+		case 'sposis':
963
+			return I18N::translateContext('spouse’s sister', 'sister-in-law');
964
+		case 'sposon':
965
+			return I18N::translateContext('spouse’s son', 'step-son');
966
+		case 'spopar':
967
+			return I18N::translateContext('spouse’s parent', 'mother/father-in-law');
968
+		case 'sposib':
969
+			return I18N::translateContext('spouse’s sibling', 'brother/sister-in-law');
970
+		case 'wifbro':
971
+			return I18N::translateContext('wife’s brother', 'brother-in-law');
972
+		case 'wifchi':
973
+			return I18N::translateContext('wife’s child', 'step-child');
974
+		case 'wifdau':
975
+			return I18N::translateContext('wife’s daughter', 'step-daughter');
976
+		case 'wiffat':
977
+			return I18N::translateContext('wife’s father', 'father-in-law');
978
+		case 'wifmot':
979
+			return I18N::translateContext('wife’s mother', 'mother-in-law');
980
+		case 'wifsib':
981
+			return I18N::translateContext('wife’s sibling', 'brother/sister-in-law');
982
+		case 'wifsis':
983
+			return I18N::translateContext('wife’s sister', 'sister-in-law');
984
+		case 'wifson':
985
+			return I18N::translateContext('wife’s son', 'step-son');
986 986
 
987
-			// Level Three relationships
988
-			// I have commented out some of the unknown-sex relationships that are unlikely to to occur.
989
-			// Feel free to add them in, if you think they might be needed
990
-			case 'brochichi':
991
-				if ($sex1 === 'M') {
992
-					return I18N::translateContext('(a man’s) brother’s child’s child', 'great-nephew/niece');
993
-				} else {
994
-					return I18N::translateContext('(a woman’s) brother’s child’s child', 'great-nephew/niece');
995
-				}
996
-			case 'brochidau':
997
-				if ($sex1 === 'M') {
998
-					return I18N::translateContext('(a man’s) brother’s child’s daughter', 'great-niece');
999
-				} else {
1000
-					return I18N::translateContext('(a woman’s) brother’s child’s daughter', 'great-niece');
1001
-				}
1002
-			case 'brochison':
1003
-				if ($sex1 === 'M') {
1004
-					return I18N::translateContext('(a man’s) brother’s child’s son', 'great-nephew');
1005
-				} else {
1006
-					return I18N::translateContext('(a woman’s) brother’s child’s son', 'great-nephew');
1007
-				}
1008
-			case 'brodauchi':
1009
-				if ($sex1 === 'M') {
1010
-					return I18N::translateContext('(a man’s) brother’s daughter’s child', 'great-nephew/niece');
1011
-				} else {
1012
-					return I18N::translateContext('(a woman’s) brother’s daughter’s child', 'great-nephew/niece');
1013
-				}
1014
-			case 'brodaudau':
1015
-				if ($sex1 === 'M') {
1016
-					return I18N::translateContext('(a man’s) brother’s daughter’s daughter', 'great-niece');
1017
-				} else {
1018
-					return I18N::translateContext('(a woman’s) brother’s daughter’s daughter', 'great-niece');
1019
-				}
1020
-			case 'brodauhus':
1021
-				return I18N::translateContext('brother’s daughter’s husband', 'nephew-in-law');
1022
-			case 'brodauson':
1023
-				if ($sex1 === 'M') {
1024
-					return I18N::translateContext('(a man’s) brother’s daughter’s son', 'great-nephew');
1025
-				} else {
1026
-					return I18N::translateContext('(a woman’s) brother’s daughter’s son', 'great-nephew');
1027
-				}
1028
-			case 'brosonchi':
1029
-				if ($sex1 === 'M') {
1030
-					return I18N::translateContext('(a man’s) brother’s son’s child', 'great-nephew/niece');
1031
-				} else {
1032
-					return I18N::translateContext('(a woman’s) brother’s son’s child', 'great-nephew/niece');
1033
-				}
1034
-			case 'brosondau':
1035
-				if ($sex1 === 'M') {
1036
-					return I18N::translateContext('(a man’s) brother’s son’s daughter', 'great-niece');
1037
-				} else {
1038
-					return I18N::translateContext('(a woman’s) brother’s son’s daughter', 'great-niece');
1039
-				}
1040
-			case 'brosonson':
1041
-				if ($sex1 === 'M') {
1042
-					return I18N::translateContext('(a man’s) brother’s son’s son', 'great-nephew');
1043
-				} else {
1044
-					return I18N::translateContext('(a woman’s) brother’s son’s son', 'great-nephew');
1045
-				}
1046
-			case 'brosonwif':
1047
-				return I18N::translateContext('brother’s son’s wife', 'niece-in-law');
1048
-			case 'browifbro':
1049
-				return I18N::translateContext('brother’s wife’s brother', 'brother-in-law');
1050
-			case 'browifsib':
1051
-				return I18N::translateContext('brother’s wife’s sibling', 'brother/sister-in-law');
1052
-			case 'browifsis':
1053
-				return I18N::translateContext('brother’s wife’s sister', 'sister-in-law');
1054
-			case 'chichichi':
1055
-				return I18N::translateContext('child’s child’s child', 'great-grandchild');
1056
-			case 'chichidau':
1057
-				return I18N::translateContext('child’s child’s daughter', 'great-granddaughter');
1058
-			case 'chichison':
1059
-				return I18N::translateContext('child’s child’s son', 'great-grandson');
1060
-			case 'chidauchi':
1061
-				return I18N::translateContext('child’s daughter’s child', 'great-grandchild');
1062
-			case 'chidaudau':
1063
-				return I18N::translateContext('child’s daughter’s daughter', 'great-granddaughter');
1064
-			case 'chidauhus':
1065
-				return I18N::translateContext('child’s daughter’s husband', 'granddaughter’s husband');
1066
-			case 'chidauson':
1067
-				return I18N::translateContext('child’s daughter’s son', 'great-grandson');
1068
-			case 'chisonchi':
1069
-				return I18N::translateContext('child’s son’s child', 'great-grandchild');
1070
-			case 'chisondau':
1071
-				return I18N::translateContext('child’s son’s daughter', 'great-granddaughter');
1072
-			case 'chisonson':
1073
-				return I18N::translateContext('child’s son’s son', 'great-grandson');
1074
-			case 'chisonwif':
1075
-				return I18N::translateContext('child’s son’s wife', 'grandson’s wife');
1076
-			case 'dauchichi':
1077
-				return I18N::translateContext('daughter’s child’s child', 'great-grandchild');
1078
-			case 'dauchidau':
1079
-				return I18N::translateContext('daughter’s child’s daughter', 'great-granddaughter');
1080
-			case 'dauchison':
1081
-				return I18N::translateContext('daughter’s child’s son', 'great-grandson');
1082
-			case 'daudauchi':
1083
-				return I18N::translateContext('daughter’s daughter’s child', 'great-grandchild');
1084
-			case 'daudaudau':
1085
-				return I18N::translateContext('daughter’s daughter’s daughter', 'great-granddaughter');
1086
-			case 'daudauhus':
1087
-				return I18N::translateContext('daughter’s daughter’s husband', 'granddaughter’s husband');
1088
-			case 'daudauson':
1089
-				return I18N::translateContext('daughter’s daughter’s son', 'great-grandson');
1090
-			case 'dauhusfat':
1091
-				return I18N::translateContext('daughter’s husband’s father', 'son-in-law’s father');
1092
-			case 'dauhusmot':
1093
-				return I18N::translateContext('daughter’s husband’s mother', 'son-in-law’s mother');
1094
-			case 'dauhuspar':
1095
-				return I18N::translateContext('daughter’s husband’s parent', 'son-in-law’s parent');
1096
-			case 'dausonchi':
1097
-				return I18N::translateContext('daughter’s son’s child', 'great-grandchild');
1098
-			case 'dausondau':
1099
-				return I18N::translateContext('daughter’s son’s daughter', 'great-granddaughter');
1100
-			case 'dausonson':
1101
-				return I18N::translateContext('daughter’s son’s son', 'great-grandson');
1102
-			case 'dausonwif':
1103
-				return I18N::translateContext('daughter’s son’s wife', 'grandson’s wife');
1104
-			case 'fatbrochi':
1105
-				return I18N::translateContext('father’s brother’s child', 'first cousin');
1106
-			case 'fatbrodau':
1107
-				return I18N::translateContext('father’s brother’s daughter', 'first cousin');
1108
-			case 'fatbroson':
1109
-				return I18N::translateContext('father’s brother’s son', 'first cousin');
1110
-			case 'fatbrowif':
1111
-				return I18N::translateContext('father’s brother’s wife', 'aunt');
1112
-			case 'fatfatbro':
1113
-				return I18N::translateContext('father’s father’s brother', 'great-uncle');
1114
-			case 'fatfatfat':
1115
-				return I18N::translateContext('father’s father’s father', 'great-grandfather');
1116
-			case 'fatfatmot':
1117
-				return I18N::translateContext('father’s father’s mother', 'great-grandmother');
1118
-			case 'fatfatpar':
1119
-				return I18N::translateContext('father’s father’s parent', 'great-grandparent');
1120
-			case 'fatfatsib':
1121
-				return I18N::translateContext('father’s father’s sibling', 'great-aunt/uncle');
1122
-			case 'fatfatsis':
1123
-				return I18N::translateContext('father’s father’s sister', 'great-aunt');
1124
-			case 'fatmotbro':
1125
-				return I18N::translateContext('father’s mother’s brother', 'great-uncle');
1126
-			case 'fatmotfat':
1127
-				return I18N::translateContext('father’s mother’s father', 'great-grandfather');
1128
-			case 'fatmotmot':
1129
-				return I18N::translateContext('father’s mother’s mother', 'great-grandmother');
1130
-			case 'fatmotpar':
1131
-				return I18N::translateContext('father’s mother’s parent', 'great-grandparent');
1132
-			case 'fatmotsib':
1133
-				return I18N::translateContext('father’s mother’s sibling', 'great-aunt/uncle');
1134
-			case 'fatmotsis':
1135
-				return I18N::translateContext('father’s mother’s sister', 'great-aunt');
1136
-			case 'fatparbro':
1137
-				return I18N::translateContext('father’s parent’s brother', 'great-uncle');
1138
-			case 'fatparfat':
1139
-				return I18N::translateContext('father’s parent’s father', 'great-grandfather');
1140
-			case 'fatparmot':
1141
-				return I18N::translateContext('father’s parent’s mother', 'great-grandmother');
1142
-			case 'fatparpar':
1143
-				return I18N::translateContext('father’s parent’s parent', 'great-grandparent');
1144
-			case 'fatparsib':
1145
-				return I18N::translateContext('father’s parent’s sibling', 'great-aunt/uncle');
1146
-			case 'fatparsis':
1147
-				return I18N::translateContext('father’s parent’s sister', 'great-aunt');
1148
-			case 'fatsischi':
1149
-				return I18N::translateContext('father’s sister’s child', 'first cousin');
1150
-			case 'fatsisdau':
1151
-				return I18N::translateContext('father’s sister’s daughter', 'first cousin');
1152
-			case 'fatsishus':
1153
-				return I18N::translateContext('father’s sister’s husband', 'uncle');
1154
-			case 'fatsisson':
1155
-				return I18N::translateContext('father’s sister’s son', 'first cousin');
1156
-			case 'fatwifchi':
1157
-				return I18N::translateContext('father’s wife’s child', 'step-sibling');
1158
-			case 'fatwifdau':
1159
-				return I18N::translateContext('father’s wife’s daughter', 'step-sister');
1160
-			case 'fatwifson':
1161
-				return I18N::translateContext('father’s wife’s son', 'step-brother');
1162
-			case 'husbrowif':
1163
-				return I18N::translateContext('husband’s brother’s wife', 'sister-in-law');
1164
-			case 'hussishus':
1165
-				return I18N::translateContext('husband’s sister’s husband', 'brother-in-law');
1166
-			case 'motbrochi':
1167
-				return I18N::translateContext('mother’s brother’s child', 'first cousin');
1168
-			case 'motbrodau':
1169
-				return I18N::translateContext('mother’s brother’s daughter', 'first cousin');
1170
-			case 'motbroson':
1171
-				return I18N::translateContext('mother’s brother’s son', 'first cousin');
1172
-			case 'motbrowif':
1173
-				return I18N::translateContext('mother’s brother’s wife', 'aunt');
1174
-			case 'motfatbro':
1175
-				return I18N::translateContext('mother’s father’s brother', 'great-uncle');
1176
-			case 'motfatfat':
1177
-				return I18N::translateContext('mother’s father’s father', 'great-grandfather');
1178
-			case 'motfatmot':
1179
-				return I18N::translateContext('mother’s father’s mother', 'great-grandmother');
1180
-			case 'motfatpar':
1181
-				return I18N::translateContext('mother’s father’s parent', 'great-grandparent');
1182
-			case 'motfatsib':
1183
-				return I18N::translateContext('mother’s father’s sibling', 'great-aunt/uncle');
1184
-			case 'motfatsis':
1185
-				return I18N::translateContext('mother’s father’s sister', 'great-aunt');
1186
-			case 'mothuschi':
1187
-				return I18N::translateContext('mother’s husband’s child', 'step-sibling');
1188
-			case 'mothusdau':
1189
-				return I18N::translateContext('mother’s husband’s daughter', 'step-sister');
1190
-			case 'mothusson':
1191
-				return I18N::translateContext('mother’s husband’s son', 'step-brother');
1192
-			case 'motmotbro':
1193
-				return I18N::translateContext('mother’s mother’s brother', 'great-uncle');
1194
-			case 'motmotfat':
1195
-				return I18N::translateContext('mother’s mother’s father', 'great-grandfather');
1196
-			case 'motmotmot':
1197
-				return I18N::translateContext('mother’s mother’s mother', 'great-grandmother');
1198
-			case 'motmotpar':
1199
-				return I18N::translateContext('mother’s mother’s parent', 'great-grandparent');
1200
-			case 'motmotsib':
1201
-				return I18N::translateContext('mother’s mother’s sibling', 'great-aunt/uncle');
1202
-			case 'motmotsis':
1203
-				return I18N::translateContext('mother’s mother’s sister', 'great-aunt');
1204
-			case 'motparbro':
1205
-				return I18N::translateContext('mother’s parent’s brother', 'great-uncle');
1206
-			case 'motparfat':
1207
-				return I18N::translateContext('mother’s parent’s father', 'great-grandfather');
1208
-			case 'motparmot':
1209
-				return I18N::translateContext('mother’s parent’s mother', 'great-grandmother');
1210
-			case 'motparpar':
1211
-				return I18N::translateContext('mother’s parent’s parent', 'great-grandparent');
1212
-			case 'motparsib':
1213
-				return I18N::translateContext('mother’s parent’s sibling', 'great-aunt/uncle');
1214
-			case 'motparsis':
1215
-				return I18N::translateContext('mother’s parent’s sister', 'great-aunt');
1216
-			case 'motsischi':
1217
-				return I18N::translateContext('mother’s sister’s child', 'first cousin');
1218
-			case 'motsisdau':
1219
-				return I18N::translateContext('mother’s sister’s daughter', 'first cousin');
1220
-			case 'motsishus':
1221
-				return I18N::translateContext('mother’s sister’s husband', 'uncle');
1222
-			case 'motsisson':
1223
-				return I18N::translateContext('mother’s sister’s son', 'first cousin');
1224
-			case 'parbrowif':
1225
-				return I18N::translateContext('parent’s brother’s wife', 'aunt');
1226
-			case 'parfatbro':
1227
-				return I18N::translateContext('parent’s father’s brother', 'great-uncle');
1228
-			case 'parfatfat':
1229
-				return I18N::translateContext('parent’s father’s father', 'great-grandfather');
1230
-			case 'parfatmot':
1231
-				return I18N::translateContext('parent’s father’s mother', 'great-grandmother');
1232
-			case 'parfatpar':
1233
-				return I18N::translateContext('parent’s father’s parent', 'great-grandparent');
1234
-			case 'parfatsib':
1235
-				return I18N::translateContext('parent’s father’s sibling', 'great-aunt/uncle');
1236
-			case 'parfatsis':
1237
-				return I18N::translateContext('parent’s father’s sister', 'great-aunt');
1238
-			case 'parmotbro':
1239
-				return I18N::translateContext('parent’s mother’s brother', 'great-uncle');
1240
-			case 'parmotfat':
1241
-				return I18N::translateContext('parent’s mother’s father', 'great-grandfather');
1242
-			case 'parmotmot':
1243
-				return I18N::translateContext('parent’s mother’s mother', 'great-grandmother');
1244
-			case 'parmotpar':
1245
-				return I18N::translateContext('parent’s mother’s parent', 'great-grandparent');
1246
-			case 'parmotsib':
1247
-				return I18N::translateContext('parent’s mother’s sibling', 'great-aunt/uncle');
1248
-			case 'parmotsis':
1249
-				return I18N::translateContext('parent’s mother’s sister', 'great-aunt');
1250
-			case 'parparbro':
1251
-				return I18N::translateContext('parent’s parent’s brother', 'great-uncle');
1252
-			case 'parparfat':
1253
-				return I18N::translateContext('parent’s parent’s father', 'great-grandfather');
1254
-			case 'parparmot':
1255
-				return I18N::translateContext('parent’s parent’s mother', 'great-grandmother');
1256
-			case 'parparpar':
1257
-				return I18N::translateContext('parent’s parent’s parent', 'great-grandparent');
1258
-			case 'parparsib':
1259
-				return I18N::translateContext('parent’s parent’s sibling', 'great-aunt/uncle');
1260
-			case 'parparsis':
1261
-				return I18N::translateContext('parent’s parent’s sister', 'great-aunt');
1262
-			case 'parsishus':
1263
-				return I18N::translateContext('parent’s sister’s husband', 'uncle');
1264
-			case 'parspochi':
1265
-				return I18N::translateContext('parent’s spouse’s child', 'step-sibling');
1266
-			case 'parspodau':
1267
-				return I18N::translateContext('parent’s spouse’s daughter', 'step-sister');
1268
-			case 'parsposon':
1269
-				return I18N::translateContext('parent’s spouse’s son', 'step-brother');
1270
-			case 'sibchichi':
1271
-				return I18N::translateContext('sibling’s child’s child', 'great-nephew/niece');
1272
-			case 'sibchidau':
1273
-				return I18N::translateContext('sibling’s child’s daughter', 'great-niece');
1274
-			case 'sibchison':
1275
-				return I18N::translateContext('sibling’s child’s son', 'great-nephew');
1276
-			case 'sibdauchi':
1277
-				return I18N::translateContext('sibling’s daughter’s child', 'great-nephew/niece');
1278
-			case 'sibdaudau':
1279
-				return I18N::translateContext('sibling’s daughter’s daughter', 'great-niece');
1280
-			case 'sibdauhus':
1281
-				return I18N::translateContext('sibling’s daughter’s husband', 'nephew-in-law');
1282
-			case 'sibdauson':
1283
-				return I18N::translateContext('sibling’s daughter’s son', 'great-nephew');
1284
-			case 'sibsonchi':
1285
-				return I18N::translateContext('sibling’s son’s child', 'great-nephew/niece');
1286
-			case 'sibsondau':
1287
-				return I18N::translateContext('sibling’s son’s daughter', 'great-niece');
1288
-			case 'sibsonson':
1289
-				return I18N::translateContext('sibling’s son’s son', 'great-nephew');
1290
-			case 'sibsonwif':
1291
-				return I18N::translateContext('sibling’s son’s wife', 'niece-in-law');
1292
-			case 'sischichi':
1293
-				if ($sex1 === 'M') {
1294
-					return I18N::translateContext('(a man’s) sister’s child’s child', 'great-nephew/niece');
1295
-				} else {
1296
-					return I18N::translateContext('(a woman’s) sister’s child’s child', 'great-nephew/niece');
1297
-				}
1298
-			case 'sischidau':
1299
-				if ($sex1 === 'M') {
1300
-					return I18N::translateContext('(a man’s) sister’s child’s daughter', 'great-niece');
1301
-				} else {
1302
-					return I18N::translateContext('(a woman’s) sister’s child’s daughter', 'great-niece');
1303
-				}
1304
-			case 'sischison':
1305
-				if ($sex1 === 'M') {
1306
-					return I18N::translateContext('(a man’s) sister’s child’s son', 'great-nephew');
1307
-				} else {
1308
-					return I18N::translateContext('(a woman’s) sister’s child’s son', 'great-nephew');
1309
-				}
1310
-			case 'sisdauchi':
1311
-				if ($sex1 === 'M') {
1312
-					return I18N::translateContext('(a man’s) sister’s daughter’s child', 'great-nephew/niece');
1313
-				} else {
1314
-					return I18N::translateContext('(a woman’s) sister’s daughter’s child', 'great-nephew/niece');
1315
-				}
1316
-			case 'sisdaudau':
1317
-				if ($sex1 === 'M') {
1318
-					return I18N::translateContext('(a man’s) sister’s daughter’s daughter', 'great-niece');
1319
-				} else {
1320
-					return I18N::translateContext('(a woman’s) sister’s daughter’s daughter', 'great-niece');
1321
-				}
1322
-			case 'sisdauhus':
1323
-				return I18N::translateContext('sisters’s daughter’s husband', 'nephew-in-law');
1324
-			case 'sisdauson':
1325
-				if ($sex1 === 'M') {
1326
-					return I18N::translateContext('(a man’s) sister’s daughter’s son', 'great-nephew');
1327
-				} else {
1328
-					return I18N::translateContext('(a woman’s) sister’s daughter’s son', 'great-nephew');
1329
-				}
1330
-			case 'sishusbro':
1331
-				return I18N::translateContext('sister’s husband’s brother', 'brother-in-law');
1332
-			case 'sishussib':
1333
-				return I18N::translateContext('sister’s husband’s sibling', 'brother/sister-in-law');
1334
-			case 'sishussis':
1335
-				return I18N::translateContext('sister’s husband’s sister', 'sister-in-law');
1336
-			case 'sissonchi':
1337
-				if ($sex1 === 'M') {
1338
-					return I18N::translateContext('(a man’s) sister’s son’s child', 'great-nephew/niece');
1339
-				} else {
1340
-					return I18N::translateContext('(a woman’s) sister’s son’s child', 'great-nephew/niece');
1341
-				}
1342
-			case 'sissondau':
1343
-				if ($sex1 === 'M') {
1344
-					return I18N::translateContext('(a man’s) sister’s son’s daughter', 'great-niece');
1345
-				} else {
1346
-					return I18N::translateContext('(a woman’s) sister’s son’s daughter', 'great-niece');
1347
-				}
1348
-			case 'sissonson':
1349
-				if ($sex1 === 'M') {
1350
-					return I18N::translateContext('(a man’s) sister’s son’s son', 'great-nephew');
1351
-				} else {
1352
-					return I18N::translateContext('(a woman’s) sister’s son’s son', 'great-nephew');
1353
-				}
1354
-			case 'sissonwif':
1355
-				return I18N::translateContext('sisters’s son’s wife', 'niece-in-law');
1356
-			case 'sonchichi':
1357
-				return I18N::translateContext('son’s child’s child', 'great-grandchild');
1358
-			case 'sonchidau':
1359
-				return I18N::translateContext('son’s child’s daughter', 'great-granddaughter');
1360
-			case 'sonchison':
1361
-				return I18N::translateContext('son’s child’s son', 'great-grandson');
1362
-			case 'sondauchi':
1363
-				return I18N::translateContext('son’s daughter’s child', 'great-grandchild');
1364
-			case 'sondaudau':
1365
-				return I18N::translateContext('son’s daughter’s daughter', 'great-granddaughter');
1366
-			case 'sondauhus':
1367
-				return I18N::translateContext('son’s daughter’s husband', 'granddaughter’s husband');
1368
-			case 'sondauson':
1369
-				return I18N::translateContext('son’s daughter’s son', 'great-grandson');
1370
-			case 'sonsonchi':
1371
-				return I18N::translateContext('son’s son’s child', 'great-grandchild');
1372
-			case 'sonsondau':
1373
-				return I18N::translateContext('son’s son’s daughter', 'great-granddaughter');
1374
-			case 'sonsonson':
1375
-				return I18N::translateContext('son’s son’s son', 'great-grandson');
1376
-			case 'sonsonwif':
1377
-				return I18N::translateContext('son’s son’s wife', 'grandson’s wife');
1378
-			case 'sonwiffat':
1379
-				return I18N::translateContext('son’s wife’s father', 'daughter-in-law’s father');
1380
-			case 'sonwifmot':
1381
-				return I18N::translateContext('son’s wife’s mother', 'daughter-in-law’s mother');
1382
-			case 'sonwifpar':
1383
-				return I18N::translateContext('son’s wife’s parent', 'daughter-in-law’s parent');
1384
-			case 'wifbrowif':
1385
-				return I18N::translateContext('wife’s brother’s wife', 'sister-in-law');
1386
-			case 'wifsishus':
1387
-				return I18N::translateContext('wife’s sister’s husband', 'brother-in-law');
987
+		// Level Three relationships
988
+		// I have commented out some of the unknown-sex relationships that are unlikely to to occur.
989
+		// Feel free to add them in, if you think they might be needed
990
+		case 'brochichi':
991
+			if ($sex1 === 'M') {
992
+				return I18N::translateContext('(a man’s) brother’s child’s child', 'great-nephew/niece');
993
+			} else {
994
+				return I18N::translateContext('(a woman’s) brother’s child’s child', 'great-nephew/niece');
995
+			}
996
+		case 'brochidau':
997
+			if ($sex1 === 'M') {
998
+				return I18N::translateContext('(a man’s) brother’s child’s daughter', 'great-niece');
999
+			} else {
1000
+				return I18N::translateContext('(a woman’s) brother’s child’s daughter', 'great-niece');
1001
+			}
1002
+		case 'brochison':
1003
+			if ($sex1 === 'M') {
1004
+				return I18N::translateContext('(a man’s) brother’s child’s son', 'great-nephew');
1005
+			} else {
1006
+				return I18N::translateContext('(a woman’s) brother’s child’s son', 'great-nephew');
1007
+			}
1008
+		case 'brodauchi':
1009
+			if ($sex1 === 'M') {
1010
+				return I18N::translateContext('(a man’s) brother’s daughter’s child', 'great-nephew/niece');
1011
+			} else {
1012
+				return I18N::translateContext('(a woman’s) brother’s daughter’s child', 'great-nephew/niece');
1013
+			}
1014
+		case 'brodaudau':
1015
+			if ($sex1 === 'M') {
1016
+				return I18N::translateContext('(a man’s) brother’s daughter’s daughter', 'great-niece');
1017
+			} else {
1018
+				return I18N::translateContext('(a woman’s) brother’s daughter’s daughter', 'great-niece');
1019
+			}
1020
+		case 'brodauhus':
1021
+			return I18N::translateContext('brother’s daughter’s husband', 'nephew-in-law');
1022
+		case 'brodauson':
1023
+			if ($sex1 === 'M') {
1024
+				return I18N::translateContext('(a man’s) brother’s daughter’s son', 'great-nephew');
1025
+			} else {
1026
+				return I18N::translateContext('(a woman’s) brother’s daughter’s son', 'great-nephew');
1027
+			}
1028
+		case 'brosonchi':
1029
+			if ($sex1 === 'M') {
1030
+				return I18N::translateContext('(a man’s) brother’s son’s child', 'great-nephew/niece');
1031
+			} else {
1032
+				return I18N::translateContext('(a woman’s) brother’s son’s child', 'great-nephew/niece');
1033
+			}
1034
+		case 'brosondau':
1035
+			if ($sex1 === 'M') {
1036
+				return I18N::translateContext('(a man’s) brother’s son’s daughter', 'great-niece');
1037
+			} else {
1038
+				return I18N::translateContext('(a woman’s) brother’s son’s daughter', 'great-niece');
1039
+			}
1040
+		case 'brosonson':
1041
+			if ($sex1 === 'M') {
1042
+				return I18N::translateContext('(a man’s) brother’s son’s son', 'great-nephew');
1043
+			} else {
1044
+				return I18N::translateContext('(a woman’s) brother’s son’s son', 'great-nephew');
1045
+			}
1046
+		case 'brosonwif':
1047
+			return I18N::translateContext('brother’s son’s wife', 'niece-in-law');
1048
+		case 'browifbro':
1049
+			return I18N::translateContext('brother’s wife’s brother', 'brother-in-law');
1050
+		case 'browifsib':
1051
+			return I18N::translateContext('brother’s wife’s sibling', 'brother/sister-in-law');
1052
+		case 'browifsis':
1053
+			return I18N::translateContext('brother’s wife’s sister', 'sister-in-law');
1054
+		case 'chichichi':
1055
+			return I18N::translateContext('child’s child’s child', 'great-grandchild');
1056
+		case 'chichidau':
1057
+			return I18N::translateContext('child’s child’s daughter', 'great-granddaughter');
1058
+		case 'chichison':
1059
+			return I18N::translateContext('child’s child’s son', 'great-grandson');
1060
+		case 'chidauchi':
1061
+			return I18N::translateContext('child’s daughter’s child', 'great-grandchild');
1062
+		case 'chidaudau':
1063
+			return I18N::translateContext('child’s daughter’s daughter', 'great-granddaughter');
1064
+		case 'chidauhus':
1065
+			return I18N::translateContext('child’s daughter’s husband', 'granddaughter’s husband');
1066
+		case 'chidauson':
1067
+			return I18N::translateContext('child’s daughter’s son', 'great-grandson');
1068
+		case 'chisonchi':
1069
+			return I18N::translateContext('child’s son’s child', 'great-grandchild');
1070
+		case 'chisondau':
1071
+			return I18N::translateContext('child’s son’s daughter', 'great-granddaughter');
1072
+		case 'chisonson':
1073
+			return I18N::translateContext('child’s son’s son', 'great-grandson');
1074
+		case 'chisonwif':
1075
+			return I18N::translateContext('child’s son’s wife', 'grandson’s wife');
1076
+		case 'dauchichi':
1077
+			return I18N::translateContext('daughter’s child’s child', 'great-grandchild');
1078
+		case 'dauchidau':
1079
+			return I18N::translateContext('daughter’s child’s daughter', 'great-granddaughter');
1080
+		case 'dauchison':
1081
+			return I18N::translateContext('daughter’s child’s son', 'great-grandson');
1082
+		case 'daudauchi':
1083
+			return I18N::translateContext('daughter’s daughter’s child', 'great-grandchild');
1084
+		case 'daudaudau':
1085
+			return I18N::translateContext('daughter’s daughter’s daughter', 'great-granddaughter');
1086
+		case 'daudauhus':
1087
+			return I18N::translateContext('daughter’s daughter’s husband', 'granddaughter’s husband');
1088
+		case 'daudauson':
1089
+			return I18N::translateContext('daughter’s daughter’s son', 'great-grandson');
1090
+		case 'dauhusfat':
1091
+			return I18N::translateContext('daughter’s husband’s father', 'son-in-law’s father');
1092
+		case 'dauhusmot':
1093
+			return I18N::translateContext('daughter’s husband’s mother', 'son-in-law’s mother');
1094
+		case 'dauhuspar':
1095
+			return I18N::translateContext('daughter’s husband’s parent', 'son-in-law’s parent');
1096
+		case 'dausonchi':
1097
+			return I18N::translateContext('daughter’s son’s child', 'great-grandchild');
1098
+		case 'dausondau':
1099
+			return I18N::translateContext('daughter’s son’s daughter', 'great-granddaughter');
1100
+		case 'dausonson':
1101
+			return I18N::translateContext('daughter’s son’s son', 'great-grandson');
1102
+		case 'dausonwif':
1103
+			return I18N::translateContext('daughter’s son’s wife', 'grandson’s wife');
1104
+		case 'fatbrochi':
1105
+			return I18N::translateContext('father’s brother’s child', 'first cousin');
1106
+		case 'fatbrodau':
1107
+			return I18N::translateContext('father’s brother’s daughter', 'first cousin');
1108
+		case 'fatbroson':
1109
+			return I18N::translateContext('father’s brother’s son', 'first cousin');
1110
+		case 'fatbrowif':
1111
+			return I18N::translateContext('father’s brother’s wife', 'aunt');
1112
+		case 'fatfatbro':
1113
+			return I18N::translateContext('father’s father’s brother', 'great-uncle');
1114
+		case 'fatfatfat':
1115
+			return I18N::translateContext('father’s father’s father', 'great-grandfather');
1116
+		case 'fatfatmot':
1117
+			return I18N::translateContext('father’s father’s mother', 'great-grandmother');
1118
+		case 'fatfatpar':
1119
+			return I18N::translateContext('father’s father’s parent', 'great-grandparent');
1120
+		case 'fatfatsib':
1121
+			return I18N::translateContext('father’s father’s sibling', 'great-aunt/uncle');
1122
+		case 'fatfatsis':
1123
+			return I18N::translateContext('father’s father’s sister', 'great-aunt');
1124
+		case 'fatmotbro':
1125
+			return I18N::translateContext('father’s mother’s brother', 'great-uncle');
1126
+		case 'fatmotfat':
1127
+			return I18N::translateContext('father’s mother’s father', 'great-grandfather');
1128
+		case 'fatmotmot':
1129
+			return I18N::translateContext('father’s mother’s mother', 'great-grandmother');
1130
+		case 'fatmotpar':
1131
+			return I18N::translateContext('father’s mother’s parent', 'great-grandparent');
1132
+		case 'fatmotsib':
1133
+			return I18N::translateContext('father’s mother’s sibling', 'great-aunt/uncle');
1134
+		case 'fatmotsis':
1135
+			return I18N::translateContext('father’s mother’s sister', 'great-aunt');
1136
+		case 'fatparbro':
1137
+			return I18N::translateContext('father’s parent’s brother', 'great-uncle');
1138
+		case 'fatparfat':
1139
+			return I18N::translateContext('father’s parent’s father', 'great-grandfather');
1140
+		case 'fatparmot':
1141
+			return I18N::translateContext('father’s parent’s mother', 'great-grandmother');
1142
+		case 'fatparpar':
1143
+			return I18N::translateContext('father’s parent’s parent', 'great-grandparent');
1144
+		case 'fatparsib':
1145
+			return I18N::translateContext('father’s parent’s sibling', 'great-aunt/uncle');
1146
+		case 'fatparsis':
1147
+			return I18N::translateContext('father’s parent’s sister', 'great-aunt');
1148
+		case 'fatsischi':
1149
+			return I18N::translateContext('father’s sister’s child', 'first cousin');
1150
+		case 'fatsisdau':
1151
+			return I18N::translateContext('father’s sister’s daughter', 'first cousin');
1152
+		case 'fatsishus':
1153
+			return I18N::translateContext('father’s sister’s husband', 'uncle');
1154
+		case 'fatsisson':
1155
+			return I18N::translateContext('father’s sister’s son', 'first cousin');
1156
+		case 'fatwifchi':
1157
+			return I18N::translateContext('father’s wife’s child', 'step-sibling');
1158
+		case 'fatwifdau':
1159
+			return I18N::translateContext('father’s wife’s daughter', 'step-sister');
1160
+		case 'fatwifson':
1161
+			return I18N::translateContext('father’s wife’s son', 'step-brother');
1162
+		case 'husbrowif':
1163
+			return I18N::translateContext('husband’s brother’s wife', 'sister-in-law');
1164
+		case 'hussishus':
1165
+			return I18N::translateContext('husband’s sister’s husband', 'brother-in-law');
1166
+		case 'motbrochi':
1167
+			return I18N::translateContext('mother’s brother’s child', 'first cousin');
1168
+		case 'motbrodau':
1169
+			return I18N::translateContext('mother’s brother’s daughter', 'first cousin');
1170
+		case 'motbroson':
1171
+			return I18N::translateContext('mother’s brother’s son', 'first cousin');
1172
+		case 'motbrowif':
1173
+			return I18N::translateContext('mother’s brother’s wife', 'aunt');
1174
+		case 'motfatbro':
1175
+			return I18N::translateContext('mother’s father’s brother', 'great-uncle');
1176
+		case 'motfatfat':
1177
+			return I18N::translateContext('mother’s father’s father', 'great-grandfather');
1178
+		case 'motfatmot':
1179
+			return I18N::translateContext('mother’s father’s mother', 'great-grandmother');
1180
+		case 'motfatpar':
1181
+			return I18N::translateContext('mother’s father’s parent', 'great-grandparent');
1182
+		case 'motfatsib':
1183
+			return I18N::translateContext('mother’s father’s sibling', 'great-aunt/uncle');
1184
+		case 'motfatsis':
1185
+			return I18N::translateContext('mother’s father’s sister', 'great-aunt');
1186
+		case 'mothuschi':
1187
+			return I18N::translateContext('mother’s husband’s child', 'step-sibling');
1188
+		case 'mothusdau':
1189
+			return I18N::translateContext('mother’s husband’s daughter', 'step-sister');
1190
+		case 'mothusson':
1191
+			return I18N::translateContext('mother’s husband’s son', 'step-brother');
1192
+		case 'motmotbro':
1193
+			return I18N::translateContext('mother’s mother’s brother', 'great-uncle');
1194
+		case 'motmotfat':
1195
+			return I18N::translateContext('mother’s mother’s father', 'great-grandfather');
1196
+		case 'motmotmot':
1197
+			return I18N::translateContext('mother’s mother’s mother', 'great-grandmother');
1198
+		case 'motmotpar':
1199
+			return I18N::translateContext('mother’s mother’s parent', 'great-grandparent');
1200
+		case 'motmotsib':
1201
+			return I18N::translateContext('mother’s mother’s sibling', 'great-aunt/uncle');
1202
+		case 'motmotsis':
1203
+			return I18N::translateContext('mother’s mother’s sister', 'great-aunt');
1204
+		case 'motparbro':
1205
+			return I18N::translateContext('mother’s parent’s brother', 'great-uncle');
1206
+		case 'motparfat':
1207
+			return I18N::translateContext('mother’s parent’s father', 'great-grandfather');
1208
+		case 'motparmot':
1209
+			return I18N::translateContext('mother’s parent’s mother', 'great-grandmother');
1210
+		case 'motparpar':
1211
+			return I18N::translateContext('mother’s parent’s parent', 'great-grandparent');
1212
+		case 'motparsib':
1213
+			return I18N::translateContext('mother’s parent’s sibling', 'great-aunt/uncle');
1214
+		case 'motparsis':
1215
+			return I18N::translateContext('mother’s parent’s sister', 'great-aunt');
1216
+		case 'motsischi':
1217
+			return I18N::translateContext('mother’s sister’s child', 'first cousin');
1218
+		case 'motsisdau':
1219
+			return I18N::translateContext('mother’s sister’s daughter', 'first cousin');
1220
+		case 'motsishus':
1221
+			return I18N::translateContext('mother’s sister’s husband', 'uncle');
1222
+		case 'motsisson':
1223
+			return I18N::translateContext('mother’s sister’s son', 'first cousin');
1224
+		case 'parbrowif':
1225
+			return I18N::translateContext('parent’s brother’s wife', 'aunt');
1226
+		case 'parfatbro':
1227
+			return I18N::translateContext('parent’s father’s brother', 'great-uncle');
1228
+		case 'parfatfat':
1229
+			return I18N::translateContext('parent’s father’s father', 'great-grandfather');
1230
+		case 'parfatmot':
1231
+			return I18N::translateContext('parent’s father’s mother', 'great-grandmother');
1232
+		case 'parfatpar':
1233
+			return I18N::translateContext('parent’s father’s parent', 'great-grandparent');
1234
+		case 'parfatsib':
1235
+			return I18N::translateContext('parent’s father’s sibling', 'great-aunt/uncle');
1236
+		case 'parfatsis':
1237
+			return I18N::translateContext('parent’s father’s sister', 'great-aunt');
1238
+		case 'parmotbro':
1239
+			return I18N::translateContext('parent’s mother’s brother', 'great-uncle');
1240
+		case 'parmotfat':
1241
+			return I18N::translateContext('parent’s mother’s father', 'great-grandfather');
1242
+		case 'parmotmot':
1243
+			return I18N::translateContext('parent’s mother’s mother', 'great-grandmother');
1244
+		case 'parmotpar':
1245
+			return I18N::translateContext('parent’s mother’s parent', 'great-grandparent');
1246
+		case 'parmotsib':
1247
+			return I18N::translateContext('parent’s mother’s sibling', 'great-aunt/uncle');
1248
+		case 'parmotsis':
1249
+			return I18N::translateContext('parent’s mother’s sister', 'great-aunt');
1250
+		case 'parparbro':
1251
+			return I18N::translateContext('parent’s parent’s brother', 'great-uncle');
1252
+		case 'parparfat':
1253
+			return I18N::translateContext('parent’s parent’s father', 'great-grandfather');
1254
+		case 'parparmot':
1255
+			return I18N::translateContext('parent’s parent’s mother', 'great-grandmother');
1256
+		case 'parparpar':
1257
+			return I18N::translateContext('parent’s parent’s parent', 'great-grandparent');
1258
+		case 'parparsib':
1259
+			return I18N::translateContext('parent’s parent’s sibling', 'great-aunt/uncle');
1260
+		case 'parparsis':
1261
+			return I18N::translateContext('parent’s parent’s sister', 'great-aunt');
1262
+		case 'parsishus':
1263
+			return I18N::translateContext('parent’s sister’s husband', 'uncle');
1264
+		case 'parspochi':
1265
+			return I18N::translateContext('parent’s spouse’s child', 'step-sibling');
1266
+		case 'parspodau':
1267
+			return I18N::translateContext('parent’s spouse’s daughter', 'step-sister');
1268
+		case 'parsposon':
1269
+			return I18N::translateContext('parent’s spouse’s son', 'step-brother');
1270
+		case 'sibchichi':
1271
+			return I18N::translateContext('sibling’s child’s child', 'great-nephew/niece');
1272
+		case 'sibchidau':
1273
+			return I18N::translateContext('sibling’s child’s daughter', 'great-niece');
1274
+		case 'sibchison':
1275
+			return I18N::translateContext('sibling’s child’s son', 'great-nephew');
1276
+		case 'sibdauchi':
1277
+			return I18N::translateContext('sibling’s daughter’s child', 'great-nephew/niece');
1278
+		case 'sibdaudau':
1279
+			return I18N::translateContext('sibling’s daughter’s daughter', 'great-niece');
1280
+		case 'sibdauhus':
1281
+			return I18N::translateContext('sibling’s daughter’s husband', 'nephew-in-law');
1282
+		case 'sibdauson':
1283
+			return I18N::translateContext('sibling’s daughter’s son', 'great-nephew');
1284
+		case 'sibsonchi':
1285
+			return I18N::translateContext('sibling’s son’s child', 'great-nephew/niece');
1286
+		case 'sibsondau':
1287
+			return I18N::translateContext('sibling’s son’s daughter', 'great-niece');
1288
+		case 'sibsonson':
1289
+			return I18N::translateContext('sibling’s son’s son', 'great-nephew');
1290
+		case 'sibsonwif':
1291
+			return I18N::translateContext('sibling’s son’s wife', 'niece-in-law');
1292
+		case 'sischichi':
1293
+			if ($sex1 === 'M') {
1294
+				return I18N::translateContext('(a man’s) sister’s child’s child', 'great-nephew/niece');
1295
+			} else {
1296
+				return I18N::translateContext('(a woman’s) sister’s child’s child', 'great-nephew/niece');
1297
+			}
1298
+		case 'sischidau':
1299
+			if ($sex1 === 'M') {
1300
+				return I18N::translateContext('(a man’s) sister’s child’s daughter', 'great-niece');
1301
+			} else {
1302
+				return I18N::translateContext('(a woman’s) sister’s child’s daughter', 'great-niece');
1303
+			}
1304
+		case 'sischison':
1305
+			if ($sex1 === 'M') {
1306
+				return I18N::translateContext('(a man’s) sister’s child’s son', 'great-nephew');
1307
+			} else {
1308
+				return I18N::translateContext('(a woman’s) sister’s child’s son', 'great-nephew');
1309
+			}
1310
+		case 'sisdauchi':
1311
+			if ($sex1 === 'M') {
1312
+				return I18N::translateContext('(a man’s) sister’s daughter’s child', 'great-nephew/niece');
1313
+			} else {
1314
+				return I18N::translateContext('(a woman’s) sister’s daughter’s child', 'great-nephew/niece');
1315
+			}
1316
+		case 'sisdaudau':
1317
+			if ($sex1 === 'M') {
1318
+				return I18N::translateContext('(a man’s) sister’s daughter’s daughter', 'great-niece');
1319
+			} else {
1320
+				return I18N::translateContext('(a woman’s) sister’s daughter’s daughter', 'great-niece');
1321
+			}
1322
+		case 'sisdauhus':
1323
+			return I18N::translateContext('sisters’s daughter’s husband', 'nephew-in-law');
1324
+		case 'sisdauson':
1325
+			if ($sex1 === 'M') {
1326
+				return I18N::translateContext('(a man’s) sister’s daughter’s son', 'great-nephew');
1327
+			} else {
1328
+				return I18N::translateContext('(a woman’s) sister’s daughter’s son', 'great-nephew');
1329
+			}
1330
+		case 'sishusbro':
1331
+			return I18N::translateContext('sister’s husband’s brother', 'brother-in-law');
1332
+		case 'sishussib':
1333
+			return I18N::translateContext('sister’s husband’s sibling', 'brother/sister-in-law');
1334
+		case 'sishussis':
1335
+			return I18N::translateContext('sister’s husband’s sister', 'sister-in-law');
1336
+		case 'sissonchi':
1337
+			if ($sex1 === 'M') {
1338
+				return I18N::translateContext('(a man’s) sister’s son’s child', 'great-nephew/niece');
1339
+			} else {
1340
+				return I18N::translateContext('(a woman’s) sister’s son’s child', 'great-nephew/niece');
1341
+			}
1342
+		case 'sissondau':
1343
+			if ($sex1 === 'M') {
1344
+				return I18N::translateContext('(a man’s) sister’s son’s daughter', 'great-niece');
1345
+			} else {
1346
+				return I18N::translateContext('(a woman’s) sister’s son’s daughter', 'great-niece');
1347
+			}
1348
+		case 'sissonson':
1349
+			if ($sex1 === 'M') {
1350
+				return I18N::translateContext('(a man’s) sister’s son’s son', 'great-nephew');
1351
+			} else {
1352
+				return I18N::translateContext('(a woman’s) sister’s son’s son', 'great-nephew');
1353
+			}
1354
+		case 'sissonwif':
1355
+			return I18N::translateContext('sisters’s son’s wife', 'niece-in-law');
1356
+		case 'sonchichi':
1357
+			return I18N::translateContext('son’s child’s child', 'great-grandchild');
1358
+		case 'sonchidau':
1359
+			return I18N::translateContext('son’s child’s daughter', 'great-granddaughter');
1360
+		case 'sonchison':
1361
+			return I18N::translateContext('son’s child’s son', 'great-grandson');
1362
+		case 'sondauchi':
1363
+			return I18N::translateContext('son’s daughter’s child', 'great-grandchild');
1364
+		case 'sondaudau':
1365
+			return I18N::translateContext('son’s daughter’s daughter', 'great-granddaughter');
1366
+		case 'sondauhus':
1367
+			return I18N::translateContext('son’s daughter’s husband', 'granddaughter’s husband');
1368
+		case 'sondauson':
1369
+			return I18N::translateContext('son’s daughter’s son', 'great-grandson');
1370
+		case 'sonsonchi':
1371
+			return I18N::translateContext('son’s son’s child', 'great-grandchild');
1372
+		case 'sonsondau':
1373
+			return I18N::translateContext('son’s son’s daughter', 'great-granddaughter');
1374
+		case 'sonsonson':
1375
+			return I18N::translateContext('son’s son’s son', 'great-grandson');
1376
+		case 'sonsonwif':
1377
+			return I18N::translateContext('son’s son’s wife', 'grandson’s wife');
1378
+		case 'sonwiffat':
1379
+			return I18N::translateContext('son’s wife’s father', 'daughter-in-law’s father');
1380
+		case 'sonwifmot':
1381
+			return I18N::translateContext('son’s wife’s mother', 'daughter-in-law’s mother');
1382
+		case 'sonwifpar':
1383
+			return I18N::translateContext('son’s wife’s parent', 'daughter-in-law’s parent');
1384
+		case 'wifbrowif':
1385
+			return I18N::translateContext('wife’s brother’s wife', 'sister-in-law');
1386
+		case 'wifsishus':
1387
+			return I18N::translateContext('wife’s sister’s husband', 'brother-in-law');
1388 1388
 
1389
-			// Some “special case” level four relationships that have specific names in certain languages
1390
-			case 'fatfatbrowif':
1391
-				return I18N::translateContext('father’s father’s brother’s wife', 'great-aunt');
1392
-			case 'fatfatsibspo':
1393
-				return I18N::translateContext('father’s father’s sibling’s spouse', 'great-aunt/uncle');
1394
-			case 'fatfatsishus':
1395
-				return I18N::translateContext('father’s father’s sister’s husband', 'great-uncle');
1396
-			case 'fatmotbrowif':
1397
-				return I18N::translateContext('father’s mother’s brother’s wife', 'great-aunt');
1398
-			case 'fatmotsibspo':
1399
-				return I18N::translateContext('father’s mother’s sibling’s spouse', 'great-aunt/uncle');
1400
-			case 'fatmotsishus':
1401
-				return I18N::translateContext('father’s mother’s sister’s husband', 'great-uncle');
1402
-			case 'fatparbrowif':
1403
-				return I18N::translateContext('father’s parent’s brother’s wife', 'great-aunt');
1404
-			case 'fatparsibspo':
1405
-				return I18N::translateContext('father’s parent’s sibling’s spouse', 'great-aunt/uncle');
1406
-			case 'fatparsishus':
1407
-				return I18N::translateContext('father’s parent’s sister’s husband', 'great-uncle');
1408
-			case 'motfatbrowif':
1409
-				return I18N::translateContext('mother’s father’s brother’s wife', 'great-aunt');
1410
-			case 'motfatsibspo':
1411
-				return I18N::translateContext('mother’s father’s sibling’s spouse', 'great-aunt/uncle');
1412
-			case 'motfatsishus':
1413
-				return I18N::translateContext('mother’s father’s sister’s husband', 'great-uncle');
1414
-			case 'motmotbrowif':
1415
-				return I18N::translateContext('mother’s mother’s brother’s wife', 'great-aunt');
1416
-			case 'motmotsibspo':
1417
-				return I18N::translateContext('mother’s mother’s sibling’s spouse', 'great-aunt/uncle');
1418
-			case 'motmotsishus':
1419
-				return I18N::translateContext('mother’s mother’s sister’s husband', 'great-uncle');
1420
-			case 'motparbrowif':
1421
-				return I18N::translateContext('mother’s parent’s brother’s wife', 'great-aunt');
1422
-			case 'motparsibspo':
1423
-				return I18N::translateContext('mother’s parent’s sibling’s spouse', 'great-aunt/uncle');
1424
-			case 'motparsishus':
1425
-				return I18N::translateContext('mother’s parent’s sister’s husband', 'great-uncle');
1426
-			case 'parfatbrowif':
1427
-				return I18N::translateContext('parent’s father’s brother’s wife', 'great-aunt');
1428
-			case 'parfatsibspo':
1429
-				return I18N::translateContext('parent’s father’s sibling’s spouse', 'great-aunt/uncle');
1430
-			case 'parfatsishus':
1431
-				return I18N::translateContext('parent’s father’s sister’s husband', 'great-uncle');
1432
-			case 'parmotbrowif':
1433
-				return I18N::translateContext('parent’s mother’s brother’s wife', 'great-aunt');
1434
-			case 'parmotsibspo':
1435
-				return I18N::translateContext('parent’s mother’s sibling’s spouse', 'great-aunt/uncle');
1436
-			case 'parmotsishus':
1437
-				return I18N::translateContext('parent’s mother’s sister’s husband', 'great-uncle');
1438
-			case 'parparbrowif':
1439
-				return I18N::translateContext('parent’s parent’s brother’s wife', 'great-aunt');
1440
-			case 'parparsibspo':
1441
-				return I18N::translateContext('parent’s parent’s sibling’s spouse', 'great-aunt/uncle');
1442
-			case 'parparsishus':
1443
-				return I18N::translateContext('parent’s parent’s sister’s husband', 'great-uncle');
1444
-			case 'fatfatbrodau':
1445
-				return I18N::translateContext('father’s father’s brother’s daughter', 'first cousin once removed ascending');
1446
-			case 'fatfatbroson':
1447
-				return I18N::translateContext('father’s father’s brother’s son', 'first cousin once removed ascending');
1448
-			case 'fatfatbrochi':
1449
-				return I18N::translateContext('father’s father’s brother’s child', 'first cousin once removed ascending');
1450
-			case 'fatfatsisdau':
1451
-				return I18N::translateContext('father’s father’s sister’s daughter', 'first cousin once removed ascending');
1452
-			case 'fatfatsisson':
1453
-				return I18N::translateContext('father’s father’s sister’s son', 'first cousin once removed ascending');
1454
-			case 'fatfatsischi':
1455
-				return I18N::translateContext('father’s father’s sister’s child', 'first cousin once removed ascending');
1456
-			case 'fatmotbrodau':
1457
-				return I18N::translateContext('father’s mother’s brother’s daughter', 'first cousin once removed ascending');
1458
-			case 'fatmotbroson':
1459
-				return I18N::translateContext('father’s mother’s brother’s son', 'first cousin once removed ascending');
1460
-			case 'fatmotbrochi':
1461
-				return I18N::translateContext('father’s mother’s brother’s child', 'first cousin once removed ascending');
1462
-			case 'fatmotsisdau':
1463
-				return I18N::translateContext('father’s mother’s sister’s daughter', 'first cousin once removed ascending');
1464
-			case 'fatmotsisson':
1465
-				return I18N::translateContext('father’s mother’s sister’s son', 'first cousin once removed ascending');
1466
-			case 'fatmotsischi':
1467
-				return I18N::translateContext('father’s mother’s sister’s child', 'first cousin once removed ascending');
1468
-			case 'motfatbrodau':
1469
-				return I18N::translateContext('mother’s father’s brother’s daughter', 'first cousin once removed ascending');
1470
-			case 'motfatbroson':
1471
-				return I18N::translateContext('mother’s father’s brother’s son', 'first cousin once removed ascending');
1472
-			case 'motfatbrochi':
1473
-				return I18N::translateContext('mother’s father’s brother’s child', 'first cousin once removed ascending');
1474
-			case 'motfatsisdau':
1475
-				return I18N::translateContext('mother’s father’s sister’s daughter', 'first cousin once removed ascending');
1476
-			case 'motfatsisson':
1477
-				return I18N::translateContext('mother’s father’s sister’s son', 'first cousin once removed ascending');
1478
-			case 'motfatsischi':
1479
-				return I18N::translateContext('mother’s father’s sister’s child', 'first cousin once removed ascending');
1480
-			case 'motmotbrodau':
1481
-				return I18N::translateContext('mother’s mother’s brother’s daughter', 'first cousin once removed ascending');
1482
-			case 'motmotbroson':
1483
-				return I18N::translateContext('mother’s mother’s brother’s son', 'first cousin once removed ascending');
1484
-			case 'motmotbrochi':
1485
-				return I18N::translateContext('mother’s mother’s brother’s child', 'first cousin once removed ascending');
1486
-			case 'motmotsisdau':
1487
-				return I18N::translateContext('mother’s mother’s sister’s daughter', 'first cousin once removed ascending');
1488
-			case 'motmotsisson':
1489
-				return I18N::translateContext('mother’s mother’s sister’s son', 'first cousin once removed ascending');
1490
-			case 'motmotsischi':
1491
-				return I18N::translateContext('mother’s mother’s sister’s child', 'first cousin once removed ascending');
1389
+		// Some “special case” level four relationships that have specific names in certain languages
1390
+		case 'fatfatbrowif':
1391
+			return I18N::translateContext('father’s father’s brother’s wife', 'great-aunt');
1392
+		case 'fatfatsibspo':
1393
+			return I18N::translateContext('father’s father’s sibling’s spouse', 'great-aunt/uncle');
1394
+		case 'fatfatsishus':
1395
+			return I18N::translateContext('father’s father’s sister’s husband', 'great-uncle');
1396
+		case 'fatmotbrowif':
1397
+			return I18N::translateContext('father’s mother’s brother’s wife', 'great-aunt');
1398
+		case 'fatmotsibspo':
1399
+			return I18N::translateContext('father’s mother’s sibling’s spouse', 'great-aunt/uncle');
1400
+		case 'fatmotsishus':
1401
+			return I18N::translateContext('father’s mother’s sister’s husband', 'great-uncle');
1402
+		case 'fatparbrowif':
1403
+			return I18N::translateContext('father’s parent’s brother’s wife', 'great-aunt');
1404
+		case 'fatparsibspo':
1405
+			return I18N::translateContext('father’s parent’s sibling’s spouse', 'great-aunt/uncle');
1406
+		case 'fatparsishus':
1407
+			return I18N::translateContext('father’s parent’s sister’s husband', 'great-uncle');
1408
+		case 'motfatbrowif':
1409
+			return I18N::translateContext('mother’s father’s brother’s wife', 'great-aunt');
1410
+		case 'motfatsibspo':
1411
+			return I18N::translateContext('mother’s father’s sibling’s spouse', 'great-aunt/uncle');
1412
+		case 'motfatsishus':
1413
+			return I18N::translateContext('mother’s father’s sister’s husband', 'great-uncle');
1414
+		case 'motmotbrowif':
1415
+			return I18N::translateContext('mother’s mother’s brother’s wife', 'great-aunt');
1416
+		case 'motmotsibspo':
1417
+			return I18N::translateContext('mother’s mother’s sibling’s spouse', 'great-aunt/uncle');
1418
+		case 'motmotsishus':
1419
+			return I18N::translateContext('mother’s mother’s sister’s husband', 'great-uncle');
1420
+		case 'motparbrowif':
1421
+			return I18N::translateContext('mother’s parent’s brother’s wife', 'great-aunt');
1422
+		case 'motparsibspo':
1423
+			return I18N::translateContext('mother’s parent’s sibling’s spouse', 'great-aunt/uncle');
1424
+		case 'motparsishus':
1425
+			return I18N::translateContext('mother’s parent’s sister’s husband', 'great-uncle');
1426
+		case 'parfatbrowif':
1427
+			return I18N::translateContext('parent’s father’s brother’s wife', 'great-aunt');
1428
+		case 'parfatsibspo':
1429
+			return I18N::translateContext('parent’s father’s sibling’s spouse', 'great-aunt/uncle');
1430
+		case 'parfatsishus':
1431
+			return I18N::translateContext('parent’s father’s sister’s husband', 'great-uncle');
1432
+		case 'parmotbrowif':
1433
+			return I18N::translateContext('parent’s mother’s brother’s wife', 'great-aunt');
1434
+		case 'parmotsibspo':
1435
+			return I18N::translateContext('parent’s mother’s sibling’s spouse', 'great-aunt/uncle');
1436
+		case 'parmotsishus':
1437
+			return I18N::translateContext('parent’s mother’s sister’s husband', 'great-uncle');
1438
+		case 'parparbrowif':
1439
+			return I18N::translateContext('parent’s parent’s brother’s wife', 'great-aunt');
1440
+		case 'parparsibspo':
1441
+			return I18N::translateContext('parent’s parent’s sibling’s spouse', 'great-aunt/uncle');
1442
+		case 'parparsishus':
1443
+			return I18N::translateContext('parent’s parent’s sister’s husband', 'great-uncle');
1444
+		case 'fatfatbrodau':
1445
+			return I18N::translateContext('father’s father’s brother’s daughter', 'first cousin once removed ascending');
1446
+		case 'fatfatbroson':
1447
+			return I18N::translateContext('father’s father’s brother’s son', 'first cousin once removed ascending');
1448
+		case 'fatfatbrochi':
1449
+			return I18N::translateContext('father’s father’s brother’s child', 'first cousin once removed ascending');
1450
+		case 'fatfatsisdau':
1451
+			return I18N::translateContext('father’s father’s sister’s daughter', 'first cousin once removed ascending');
1452
+		case 'fatfatsisson':
1453
+			return I18N::translateContext('father’s father’s sister’s son', 'first cousin once removed ascending');
1454
+		case 'fatfatsischi':
1455
+			return I18N::translateContext('father’s father’s sister’s child', 'first cousin once removed ascending');
1456
+		case 'fatmotbrodau':
1457
+			return I18N::translateContext('father’s mother’s brother’s daughter', 'first cousin once removed ascending');
1458
+		case 'fatmotbroson':
1459
+			return I18N::translateContext('father’s mother’s brother’s son', 'first cousin once removed ascending');
1460
+		case 'fatmotbrochi':
1461
+			return I18N::translateContext('father’s mother’s brother’s child', 'first cousin once removed ascending');
1462
+		case 'fatmotsisdau':
1463
+			return I18N::translateContext('father’s mother’s sister’s daughter', 'first cousin once removed ascending');
1464
+		case 'fatmotsisson':
1465
+			return I18N::translateContext('father’s mother’s sister’s son', 'first cousin once removed ascending');
1466
+		case 'fatmotsischi':
1467
+			return I18N::translateContext('father’s mother’s sister’s child', 'first cousin once removed ascending');
1468
+		case 'motfatbrodau':
1469
+			return I18N::translateContext('mother’s father’s brother’s daughter', 'first cousin once removed ascending');
1470
+		case 'motfatbroson':
1471
+			return I18N::translateContext('mother’s father’s brother’s son', 'first cousin once removed ascending');
1472
+		case 'motfatbrochi':
1473
+			return I18N::translateContext('mother’s father’s brother’s child', 'first cousin once removed ascending');
1474
+		case 'motfatsisdau':
1475
+			return I18N::translateContext('mother’s father’s sister’s daughter', 'first cousin once removed ascending');
1476
+		case 'motfatsisson':
1477
+			return I18N::translateContext('mother’s father’s sister’s son', 'first cousin once removed ascending');
1478
+		case 'motfatsischi':
1479
+			return I18N::translateContext('mother’s father’s sister’s child', 'first cousin once removed ascending');
1480
+		case 'motmotbrodau':
1481
+			return I18N::translateContext('mother’s mother’s brother’s daughter', 'first cousin once removed ascending');
1482
+		case 'motmotbroson':
1483
+			return I18N::translateContext('mother’s mother’s brother’s son', 'first cousin once removed ascending');
1484
+		case 'motmotbrochi':
1485
+			return I18N::translateContext('mother’s mother’s brother’s child', 'first cousin once removed ascending');
1486
+		case 'motmotsisdau':
1487
+			return I18N::translateContext('mother’s mother’s sister’s daughter', 'first cousin once removed ascending');
1488
+		case 'motmotsisson':
1489
+			return I18N::translateContext('mother’s mother’s sister’s son', 'first cousin once removed ascending');
1490
+		case 'motmotsischi':
1491
+			return I18N::translateContext('mother’s mother’s sister’s child', 'first cousin once removed ascending');
1492 1492
 		}
1493 1493
 
1494 1494
 		// Some “special case” level five relationships that have specific names in certain languages
@@ -1554,139 +1554,139 @@  discard block
 block discarded – undo
1554 1554
 			$up       = strlen($match[1]) / 3;
1555 1555
 			$bef_last = substr($path, -6, 3);
1556 1556
 			switch ($up) {
1557
-				case 3:
1558
-					switch ($sex2) {
1559
-						case 'M':
1560
-							if ($bef_last === 'fat') {
1561
-								return I18N::translateContext('great-grandfather’s brother', 'great-great-uncle');
1562
-							} elseif ($bef_last === 'mot') {
1563
-								return I18N::translateContext('great-grandmother’s brother', 'great-great-uncle');
1564
-							} else {
1565
-								return I18N::translateContext('great-grandparent’s brother', 'great-great-uncle');
1566
-							}
1567
-						case 'F':
1568
-							return I18N::translate('great-great-aunt');
1569
-						default:
1570
-							return I18N::translate('great-great-aunt/uncle');
1571
-					}
1572
-				case 4:
1573
-					switch ($sex2) {
1574
-						case 'M':
1575
-							if ($bef_last === 'fat') {
1576
-								return I18N::translateContext('great-great-grandfather’s brother', 'great-great-great-uncle');
1577
-							} elseif ($bef_last === 'mot') {
1578
-								return I18N::translateContext('great-great-grandmother’s brother', 'great-great-great-uncle');
1579
-							} else {
1580
-								return I18N::translateContext('great-great-grandparent’s brother', 'great-great-great-uncle');
1581
-							}
1582
-						case 'F':
1583
-							return I18N::translate('great-great-great-aunt');
1584
-						default:
1585
-							return I18N::translate('great-great-great-aunt/uncle');
1586
-					}
1587
-				case 5:
1588
-					switch ($sex2) {
1589
-						case 'M':
1590
-							if ($bef_last === 'fat') {
1591
-								return I18N::translateContext('great-great-great-grandfather’s brother', 'great ×4 uncle');
1592
-							} elseif ($bef_last === 'mot') {
1593
-								return I18N::translateContext('great-great-great-grandmother’s brother', 'great ×4 uncle');
1594
-							} else {
1595
-								return I18N::translateContext('great-great-great-grandparent’s brother', 'great ×4 uncle');
1596
-							}
1597
-						case 'F':
1598
-							return I18N::translate('great ×4 aunt');
1599
-						default:
1600
-							return I18N::translate('great ×4 aunt/uncle');
1601
-					}
1602
-				case 6:
1557
+			case 3:
1558
+				switch ($sex2) {
1559
+				case 'M':
1560
+				if ($bef_last === 'fat') {
1561
+				return I18N::translateContext('great-grandfather’s brother', 'great-great-uncle');
1562
+				} elseif ($bef_last === 'mot') {
1563
+				return I18N::translateContext('great-grandmother’s brother', 'great-great-uncle');
1564
+				} else {
1565
+				return I18N::translateContext('great-grandparent’s brother', 'great-great-uncle');
1566
+				}
1567
+				case 'F':
1568
+				return I18N::translate('great-great-aunt');
1569
+				default:
1570
+				return I18N::translate('great-great-aunt/uncle');
1571
+				}
1572
+			case 4:
1573
+				switch ($sex2) {
1574
+				case 'M':
1575
+				if ($bef_last === 'fat') {
1576
+				return I18N::translateContext('great-great-grandfather’s brother', 'great-great-great-uncle');
1577
+				} elseif ($bef_last === 'mot') {
1578
+				return I18N::translateContext('great-great-grandmother’s brother', 'great-great-great-uncle');
1579
+				} else {
1580
+				return I18N::translateContext('great-great-grandparent’s brother', 'great-great-great-uncle');
1581
+				}
1582
+				case 'F':
1583
+				return I18N::translate('great-great-great-aunt');
1584
+				default:
1585
+				return I18N::translate('great-great-great-aunt/uncle');
1586
+				}
1587
+			case 5:
1588
+				switch ($sex2) {
1589
+				case 'M':
1590
+				if ($bef_last === 'fat') {
1591
+				return I18N::translateContext('great-great-great-grandfather’s brother', 'great ×4 uncle');
1592
+				} elseif ($bef_last === 'mot') {
1593
+				return I18N::translateContext('great-great-great-grandmother’s brother', 'great ×4 uncle');
1594
+				} else {
1595
+				return I18N::translateContext('great-great-great-grandparent’s brother', 'great ×4 uncle');
1596
+				}
1597
+				case 'F':
1598
+				return I18N::translate('great ×4 aunt');
1599
+				default:
1600
+				return I18N::translate('great ×4 aunt/uncle');
1601
+				}
1602
+			case 6:
1603
+				switch ($sex2) {
1604
+				case 'M':
1605
+				if ($bef_last === 'fat') {
1606
+				return I18N::translateContext('great ×4 grandfather’s brother', 'great ×5 uncle');
1607
+				} elseif ($bef_last === 'mot') {
1608
+				return I18N::translateContext('great ×4 grandmother’s brother', 'great ×5 uncle');
1609
+				} else {
1610
+				return I18N::translateContext('great ×4 grandparent’s brother', 'great ×5 uncle');
1611
+				}
1612
+				case 'F':
1613
+				return I18N::translate('great ×5 aunt');
1614
+				default:
1615
+				return I18N::translate('great ×5 aunt/uncle');
1616
+				}
1617
+			case 7:
1618
+				switch ($sex2) {
1619
+				case 'M':
1620
+				if ($bef_last === 'fat') {
1621
+				return I18N::translateContext('great ×5 grandfather’s brother', 'great ×6 uncle');
1622
+				} elseif ($bef_last === 'mot') {
1623
+				return I18N::translateContext('great ×5 grandmother’s brother', 'great ×6 uncle');
1624
+				} else {
1625
+				return I18N::translateContext('great ×5 grandparent’s brother', 'great ×6 uncle');
1626
+				}
1627
+				case 'F':
1628
+				return I18N::translate('great ×6 aunt');
1629
+				default:
1630
+				return I18N::translate('great ×6 aunt/uncle');
1631
+				}
1632
+			case 8:
1633
+				switch ($sex2) {
1634
+				case 'M':
1635
+				if ($bef_last === 'fat') {
1636
+				return I18N::translateContext('great ×6 grandfather’s brother', 'great ×7 uncle');
1637
+				} elseif ($bef_last === 'mot') {
1638
+				return I18N::translateContext('great ×6 grandmother’s brother', 'great ×7 uncle');
1639
+				} else {
1640
+				return I18N::translateContext('great ×6 grandparent’s brother', 'great ×7 uncle');
1641
+				}
1642
+				case 'F':
1643
+				return I18N::translate('great ×7 aunt');
1644
+				default:
1645
+				return I18N::translate('great ×7 aunt/uncle');
1646
+				}
1647
+			default:
1648
+				// Different languages have different rules for naming generations.
1649
+				// An English great ×12 uncle is a Danish great ×10 uncle.
1650
+				//
1651
+				// Need to find out which languages use which rules.
1652
+				switch (WT_LOCALE) {
1653
+				case 'da':
1654
+				switch ($sex2) {
1655
+				case 'M':
1656
+				return I18N::translate('great ×%s uncle', I18N::number($up - 4));
1657
+				case 'F':
1658
+				return I18N::translate('great ×%s aunt', I18N::number($up - 4));
1659
+				default:
1660
+				return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 4));
1661
+				}
1662
+				case 'pl':
1603 1663
 					switch ($sex2) {
1604
-						case 'M':
1605
-							if ($bef_last === 'fat') {
1606
-								return I18N::translateContext('great ×4 grandfather’s brother', 'great ×5 uncle');
1607
-							} elseif ($bef_last === 'mot') {
1608
-								return I18N::translateContext('great ×4 grandmother’s brother', 'great ×5 uncle');
1609
-							} else {
1610
-								return I18N::translateContext('great ×4 grandparent’s brother', 'great ×5 uncle');
1611
-							}
1612
-						case 'F':
1613
-							return I18N::translate('great ×5 aunt');
1614
-						default:
1615
-							return I18N::translate('great ×5 aunt/uncle');
1664
+					case 'M':
1665
+					if ($bef_last === 'fat') {
1666
+					return I18N::translateContext('great ×(%s-1) grandfather’s brother', 'great ×%s uncle', I18N::number($up - 2));
1667
+					} elseif ($bef_last === 'mot') {
1668
+					return I18N::translateContext('great ×(%s-1) grandmother’s brother', 'great ×%s uncle', I18N::number($up - 2));
1669
+					} else {
1670
+					return I18N::translateContext('great ×(%s-1) grandparent’s brother', 'great ×%s uncle', I18N::number($up - 2));
1616 1671
 					}
1617
-				case 7:
1618
-					switch ($sex2) {
1619
-						case 'M':
1620
-							if ($bef_last === 'fat') {
1621
-								return I18N::translateContext('great ×5 grandfather’s brother', 'great ×6 uncle');
1622
-							} elseif ($bef_last === 'mot') {
1623
-								return I18N::translateContext('great ×5 grandmother’s brother', 'great ×6 uncle');
1624
-							} else {
1625
-								return I18N::translateContext('great ×5 grandparent’s brother', 'great ×6 uncle');
1626
-							}
1627
-						case 'F':
1628
-							return I18N::translate('great ×6 aunt');
1629
-						default:
1630
-							return I18N::translate('great ×6 aunt/uncle');
1672
+					case 'F':
1673
+					return I18N::translate('great ×%s aunt', I18N::number($up - 2));
1674
+					default:
1675
+					return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 2));
1631 1676
 					}
1632
-				case 8:
1677
+				case 'it': // Source: Michele Locati
1678
+				case 'en_AU':
1679
+				case 'en_GB':
1680
+				case 'en_US':
1681
+				default:
1633 1682
 					switch ($sex2) {
1634
-						case 'M':
1635
-							if ($bef_last === 'fat') {
1636
-								return I18N::translateContext('great ×6 grandfather’s brother', 'great ×7 uncle');
1637
-							} elseif ($bef_last === 'mot') {
1638
-								return I18N::translateContext('great ×6 grandmother’s brother', 'great ×7 uncle');
1639
-							} else {
1640
-								return I18N::translateContext('great ×6 grandparent’s brother', 'great ×7 uncle');
1641
-							}
1642
-						case 'F':
1643
-							return I18N::translate('great ×7 aunt');
1644
-						default:
1645
-							return I18N::translate('great ×7 aunt/uncle');
1683
+					case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1684
+					return I18N::translate('great ×%s uncle', I18N::number($up - 1));
1685
+					case 'F':
1686
+					return I18N::translate('great ×%s aunt', I18N::number($up - 1));
1687
+					default:
1688
+					return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 1));
1646 1689
 					}
1647
-				default:
1648
-					// Different languages have different rules for naming generations.
1649
-					// An English great ×12 uncle is a Danish great ×10 uncle.
1650
-					//
1651
-					// Need to find out which languages use which rules.
1652
-					switch (WT_LOCALE) {
1653
-						case 'da':
1654
-							switch ($sex2) {
1655
-								case 'M':
1656
-									return I18N::translate('great ×%s uncle', I18N::number($up - 4));
1657
-								case 'F':
1658
-									return I18N::translate('great ×%s aunt', I18N::number($up - 4));
1659
-								default:
1660
-									return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 4));
1661
-							}
1662
-						case 'pl':
1663
-							switch ($sex2) {
1664
-								case 'M':
1665
-									if ($bef_last === 'fat') {
1666
-										return I18N::translateContext('great ×(%s-1) grandfather’s brother', 'great ×%s uncle', I18N::number($up - 2));
1667
-									} elseif ($bef_last === 'mot') {
1668
-										return I18N::translateContext('great ×(%s-1) grandmother’s brother', 'great ×%s uncle', I18N::number($up - 2));
1669
-									} else {
1670
-										return I18N::translateContext('great ×(%s-1) grandparent’s brother', 'great ×%s uncle', I18N::number($up - 2));
1671
-									}
1672
-								case 'F':
1673
-									return I18N::translate('great ×%s aunt', I18N::number($up - 2));
1674
-								default:
1675
-									return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 2));
1676
-							}
1677
-						case 'it': // Source: Michele Locati
1678
-						case 'en_AU':
1679
-						case 'en_GB':
1680
-						case 'en_US':
1681
-						default:
1682
-							switch ($sex2) {
1683
-								case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1684
-									return I18N::translate('great ×%s uncle', I18N::number($up - 1));
1685
-								case 'F':
1686
-									return I18N::translate('great ×%s aunt', I18N::number($up - 1));
1687
-								default:
1688
-									return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 1));
1689
-							}
1690 1690
 					}
1691 1691
 			}
1692 1692
 		}
@@ -1695,169 +1695,169 @@  discard block
 block discarded – undo
1695 1695
 			$down  = strlen($match[1]) / 3 + 1; // Add one, as we count generations from the common ancestor
1696 1696
 			$first = substr($path, 0, 3);
1697 1697
 			switch ($down) {
1698
-				case 4:
1699
-					switch ($sex2) {
1700
-						case 'M':
1701
-							if ($first === 'bro' && $sex1 === 'M') {
1702
-								return I18N::translateContext('(a man’s) brother’s great-grandson', 'great-great-nephew');
1703
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1704
-								return I18N::translateContext('(a man’s) sister’s great-grandson', 'great-great-nephew');
1705
-							} else {
1706
-								return I18N::translateContext('(a woman’s) great-great-nephew', 'great-great-nephew');
1707
-							}
1708
-						case 'F':
1709
-							if ($first === 'bro' && $sex1 === 'M') {
1710
-								return I18N::translateContext('(a man’s) brother’s great-granddaughter', 'great-great-niece');
1711
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1712
-								return I18N::translateContext('(a man’s) sister’s great-granddaughter', 'great-great-niece');
1713
-							} else {
1714
-								return I18N::translateContext('(a woman’s) great-great-niece', 'great-great-niece');
1715
-							}
1716
-						default:
1717
-							if ($first === 'bro' && $sex1 === 'M') {
1718
-								return I18N::translateContext('(a man’s) brother’s great-grandchild', 'great-great-nephew/niece');
1719
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1720
-								return I18N::translateContext('(a man’s) sister’s great-grandchild', 'great-great-nephew/niece');
1721
-							} else {
1722
-								return I18N::translateContext('(a woman’s) great-great-nephew/niece', 'great-great-nephew/niece');
1723
-							}
1724
-					}
1725
-				case 5:
1726
-					switch ($sex2) {
1727
-						case 'M':
1728
-							if ($first === 'bro' && $sex1 === 'M') {
1729
-								return I18N::translateContext('(a man’s) brother’s great-great-grandson', 'great-great-great-nephew');
1730
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1731
-								return I18N::translateContext('(a man’s) sister’s great-great-grandson', 'great-great-great-nephew');
1732
-							} else {
1733
-								return I18N::translateContext('(a woman’s) great-great-great-nephew', 'great-great-great-nephew');
1734
-							}
1735
-						case 'F':
1736
-							if ($first === 'bro' && $sex1 === 'M') {
1737
-								return I18N::translateContext('(a man’s) brother’s great-great-granddaughter', 'great-great-great-niece');
1738
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1739
-								return I18N::translateContext('(a man’s) sister’s great-great-granddaughter', 'great-great-great-niece');
1740
-							} else {
1741
-								return I18N::translateContext('(a woman’s) great-great-great-niece', 'great-great-great-niece');
1742
-							}
1743
-						default:
1744
-							if ($first === 'bro' && $sex1 === 'M') {
1745
-								return I18N::translateContext('(a man’s) brother’s great-great-grandchild', 'great-great-great-nephew/niece');
1746
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1747
-								return I18N::translateContext('(a man’s) sister’s great-great-grandchild', 'great-great-great-nephew/niece');
1748
-							} else {
1749
-								return I18N::translateContext('(a woman’s) great-great-great-nephew/niece', 'great-great-great-nephew/niece');
1750
-							}
1751
-					}
1752
-				case 6:
1698
+			case 4:
1699
+				switch ($sex2) {
1700
+				case 'M':
1701
+				if ($first === 'bro' && $sex1 === 'M') {
1702
+				return I18N::translateContext('(a man’s) brother’s great-grandson', 'great-great-nephew');
1703
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1704
+				return I18N::translateContext('(a man’s) sister’s great-grandson', 'great-great-nephew');
1705
+				} else {
1706
+				return I18N::translateContext('(a woman’s) great-great-nephew', 'great-great-nephew');
1707
+				}
1708
+				case 'F':
1709
+				if ($first === 'bro' && $sex1 === 'M') {
1710
+				return I18N::translateContext('(a man’s) brother’s great-granddaughter', 'great-great-niece');
1711
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1712
+				return I18N::translateContext('(a man’s) sister’s great-granddaughter', 'great-great-niece');
1713
+				} else {
1714
+				return I18N::translateContext('(a woman’s) great-great-niece', 'great-great-niece');
1715
+				}
1716
+				default:
1717
+				if ($first === 'bro' && $sex1 === 'M') {
1718
+				return I18N::translateContext('(a man’s) brother’s great-grandchild', 'great-great-nephew/niece');
1719
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1720
+				return I18N::translateContext('(a man’s) sister’s great-grandchild', 'great-great-nephew/niece');
1721
+				} else {
1722
+				return I18N::translateContext('(a woman’s) great-great-nephew/niece', 'great-great-nephew/niece');
1723
+				}
1724
+				}
1725
+			case 5:
1726
+				switch ($sex2) {
1727
+				case 'M':
1728
+				if ($first === 'bro' && $sex1 === 'M') {
1729
+				return I18N::translateContext('(a man’s) brother’s great-great-grandson', 'great-great-great-nephew');
1730
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1731
+				return I18N::translateContext('(a man’s) sister’s great-great-grandson', 'great-great-great-nephew');
1732
+				} else {
1733
+				return I18N::translateContext('(a woman’s) great-great-great-nephew', 'great-great-great-nephew');
1734
+				}
1735
+				case 'F':
1736
+				if ($first === 'bro' && $sex1 === 'M') {
1737
+				return I18N::translateContext('(a man’s) brother’s great-great-granddaughter', 'great-great-great-niece');
1738
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1739
+				return I18N::translateContext('(a man’s) sister’s great-great-granddaughter', 'great-great-great-niece');
1740
+				} else {
1741
+				return I18N::translateContext('(a woman’s) great-great-great-niece', 'great-great-great-niece');
1742
+				}
1743
+				default:
1744
+				if ($first === 'bro' && $sex1 === 'M') {
1745
+				return I18N::translateContext('(a man’s) brother’s great-great-grandchild', 'great-great-great-nephew/niece');
1746
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1747
+				return I18N::translateContext('(a man’s) sister’s great-great-grandchild', 'great-great-great-nephew/niece');
1748
+				} else {
1749
+				return I18N::translateContext('(a woman’s) great-great-great-nephew/niece', 'great-great-great-nephew/niece');
1750
+				}
1751
+				}
1752
+			case 6:
1753
+				switch ($sex2) {
1754
+				case 'M':
1755
+				if ($first === 'bro' && $sex1 === 'M') {
1756
+				return I18N::translateContext('(a man’s) brother’s great-great-great-grandson', 'great ×4 nephew');
1757
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1758
+				return I18N::translateContext('(a man’s) sister’s great-great-great-grandson', 'great ×4 nephew');
1759
+				} else {
1760
+				return I18N::translateContext('(a woman’s) great ×4 nephew', 'great ×4 nephew');
1761
+				}
1762
+				case 'F':
1763
+				if ($first === 'bro' && $sex1 === 'M') {
1764
+				return I18N::translateContext('(a man’s) brother’s great-great-great-granddaughter', 'great ×4 niece');
1765
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1766
+				return I18N::translateContext('(a man’s) sister’s great-great-great-granddaughter', 'great ×4 niece');
1767
+				} else {
1768
+				return I18N::translateContext('(a woman’s) great ×4 niece', 'great ×4 niece');
1769
+				}
1770
+				default:
1771
+				if ($first === 'bro' && $sex1 === 'M') {
1772
+				return I18N::translateContext('(a man’s) brother’s great-great-great-grandchild', 'great ×4 nephew/niece');
1773
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1774
+				return I18N::translateContext('(a man’s) sister’s great-great-great-grandchild', 'great ×4 nephew/niece');
1775
+				} else {
1776
+				return I18N::translateContext('(a woman’s) great ×4 nephew/niece', 'great ×4 nephew/niece');
1777
+				}
1778
+				}
1779
+			case 7:
1780
+				switch ($sex2) {
1781
+				case 'M':
1782
+				if ($first === 'bro' && $sex1 === 'M') {
1783
+				return I18N::translateContext('(a man’s) brother’s great ×4 grandson', 'great ×5 nephew');
1784
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1785
+				return I18N::translateContext('(a man’s) sister’s great ×4 grandson', 'great ×5 nephew');
1786
+				} else {
1787
+				return I18N::translateContext('(a woman’s) great ×5 nephew', 'great ×5 nephew');
1788
+				}
1789
+				case 'F':
1790
+				if ($first === 'bro' && $sex1 === 'M') {
1791
+				return I18N::translateContext('(a man’s) brother’s great ×4 granddaughter', 'great ×5 niece');
1792
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1793
+				return I18N::translateContext('(a man’s) sister’s great ×4 granddaughter', 'great ×5 niece');
1794
+				} else {
1795
+				return I18N::translateContext('(a woman’s) great ×5 niece', 'great ×5 niece');
1796
+				}
1797
+				default:
1798
+				if ($first === 'bro' && $sex1 === 'M') {
1799
+				return I18N::translateContext('(a man’s) brother’s great ×4 grandchild', 'great ×5 nephew/niece');
1800
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1801
+				return I18N::translateContext('(a man’s) sister’s great ×4 grandchild', 'great ×5 nephew/niece');
1802
+				} else {
1803
+				return I18N::translateContext('(a woman’s) great ×5 nephew/niece', 'great ×5 nephew/niece');
1804
+				}
1805
+				}
1806
+			default:
1807
+				// Different languages have different rules for naming generations.
1808
+				// An English great ×12 nephew is a Polish great ×11 nephew.
1809
+				//
1810
+				// Need to find out which languages use which rules.
1811
+				switch (WT_LOCALE) {
1812
+				case 'pl': // Source: Lukasz Wilenski
1813
+				switch ($sex2) {
1814
+				case 'M':
1815
+				if ($first === 'bro' && $sex1 === 'M') {
1816
+				return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
1817
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1818
+				return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
1819
+				} else {
1820
+				return I18N::translateContext('(a woman’s) great ×%s nephew', 'great ×%s nephew', I18N::number($down - 3));
1821
+				}
1822
+				case 'F':
1823
+				if ($first === 'bro' && $sex1 === 'M') {
1824
+				return I18N::translateContext('(a man’s) brother’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
1825
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1826
+				return I18N::translateContext('(a man’s) sister’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
1827
+				} else {
1828
+				return I18N::translateContext('(a woman’s) great ×%s niece', 'great ×%s niece', I18N::number($down - 3));
1829
+				}
1830
+				default:
1831
+				if ($first === 'bro' && $sex1 === 'M') {
1832
+				return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandchild', 'great ×%s nephew/niece', I18N::number($down - 3));
1833
+				} elseif ($first === 'sis' && $sex1 === 'M') {
1834
+				return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandchild', 'great ×%s nephew/niece', I18N::number($down - 3));
1835
+				} else {
1836
+				return I18N::translateContext('(a woman’s) great ×%s nephew/niece', 'great ×%s nephew/niece', I18N::number($down - 3));
1837
+				}
1838
+				}
1839
+				case 'he': // Source: Meliza Amity
1753 1840
 					switch ($sex2) {
1754
-						case 'M':
1755
-							if ($first === 'bro' && $sex1 === 'M') {
1756
-								return I18N::translateContext('(a man’s) brother’s great-great-great-grandson', 'great ×4 nephew');
1757
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1758
-								return I18N::translateContext('(a man’s) sister’s great-great-great-grandson', 'great ×4 nephew');
1759
-							} else {
1760
-								return I18N::translateContext('(a woman’s) great ×4 nephew', 'great ×4 nephew');
1761
-							}
1762
-						case 'F':
1763
-							if ($first === 'bro' && $sex1 === 'M') {
1764
-								return I18N::translateContext('(a man’s) brother’s great-great-great-granddaughter', 'great ×4 niece');
1765
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1766
-								return I18N::translateContext('(a man’s) sister’s great-great-great-granddaughter', 'great ×4 niece');
1767
-							} else {
1768
-								return I18N::translateContext('(a woman’s) great ×4 niece', 'great ×4 niece');
1769
-							}
1770
-						default:
1771
-							if ($first === 'bro' && $sex1 === 'M') {
1772
-								return I18N::translateContext('(a man’s) brother’s great-great-great-grandchild', 'great ×4 nephew/niece');
1773
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1774
-								return I18N::translateContext('(a man’s) sister’s great-great-great-grandchild', 'great ×4 nephew/niece');
1775
-							} else {
1776
-								return I18N::translateContext('(a woman’s) great ×4 nephew/niece', 'great ×4 nephew/niece');
1777
-							}
1841
+					case 'M':
1842
+					return I18N::translate('great ×%s nephew', I18N::number($down - 1));
1843
+					case 'F':
1844
+					return I18N::translate('great ×%s niece', I18N::number($down - 1));
1845
+					default:
1846
+					return I18N::translate('great ×%s nephew/niece', I18N::number($down - 1));
1778 1847
 					}
1779
-				case 7:
1848
+				case 'it': // Source: Michele Locati.
1849
+				case 'en_AU':
1850
+				case 'en_GB':
1851
+				case 'en_US':
1852
+				default:
1780 1853
 					switch ($sex2) {
1781
-						case 'M':
1782
-							if ($first === 'bro' && $sex1 === 'M') {
1783
-								return I18N::translateContext('(a man’s) brother’s great ×4 grandson', 'great ×5 nephew');
1784
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1785
-								return I18N::translateContext('(a man’s) sister’s great ×4 grandson', 'great ×5 nephew');
1786
-							} else {
1787
-								return I18N::translateContext('(a woman’s) great ×5 nephew', 'great ×5 nephew');
1788
-							}
1789
-						case 'F':
1790
-							if ($first === 'bro' && $sex1 === 'M') {
1791
-								return I18N::translateContext('(a man’s) brother’s great ×4 granddaughter', 'great ×5 niece');
1792
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1793
-								return I18N::translateContext('(a man’s) sister’s great ×4 granddaughter', 'great ×5 niece');
1794
-							} else {
1795
-								return I18N::translateContext('(a woman’s) great ×5 niece', 'great ×5 niece');
1796
-							}
1797
-						default:
1798
-							if ($first === 'bro' && $sex1 === 'M') {
1799
-								return I18N::translateContext('(a man’s) brother’s great ×4 grandchild', 'great ×5 nephew/niece');
1800
-							} elseif ($first === 'sis' && $sex1 === 'M') {
1801
-								return I18N::translateContext('(a man’s) sister’s great ×4 grandchild', 'great ×5 nephew/niece');
1802
-							} else {
1803
-								return I18N::translateContext('(a woman’s) great ×5 nephew/niece', 'great ×5 nephew/niece');
1804
-							}
1854
+					case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1855
+					return I18N::translate('great ×%s nephew', I18N::number($down - 2));
1856
+					case 'F':
1857
+					return I18N::translate('great ×%s niece', I18N::number($down - 2));
1858
+					default:
1859
+					return I18N::translate('great ×%s nephew/niece', I18N::number($down - 2));
1805 1860
 					}
1806
-				default:
1807
-					// Different languages have different rules for naming generations.
1808
-					// An English great ×12 nephew is a Polish great ×11 nephew.
1809
-					//
1810
-					// Need to find out which languages use which rules.
1811
-					switch (WT_LOCALE) {
1812
-						case 'pl': // Source: Lukasz Wilenski
1813
-							switch ($sex2) {
1814
-								case 'M':
1815
-									if ($first === 'bro' && $sex1 === 'M') {
1816
-										return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
1817
-									} elseif ($first === 'sis' && $sex1 === 'M') {
1818
-										return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
1819
-									} else {
1820
-										return I18N::translateContext('(a woman’s) great ×%s nephew', 'great ×%s nephew', I18N::number($down - 3));
1821
-									}
1822
-								case 'F':
1823
-									if ($first === 'bro' && $sex1 === 'M') {
1824
-										return I18N::translateContext('(a man’s) brother’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
1825
-									} elseif ($first === 'sis' && $sex1 === 'M') {
1826
-										return I18N::translateContext('(a man’s) sister’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
1827
-									} else {
1828
-										return I18N::translateContext('(a woman’s) great ×%s niece', 'great ×%s niece', I18N::number($down - 3));
1829
-									}
1830
-								default:
1831
-									if ($first === 'bro' && $sex1 === 'M') {
1832
-										return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandchild', 'great ×%s nephew/niece', I18N::number($down - 3));
1833
-									} elseif ($first === 'sis' && $sex1 === 'M') {
1834
-										return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandchild', 'great ×%s nephew/niece', I18N::number($down - 3));
1835
-									} else {
1836
-										return I18N::translateContext('(a woman’s) great ×%s nephew/niece', 'great ×%s nephew/niece', I18N::number($down - 3));
1837
-									}
1838
-							}
1839
-						case 'he': // Source: Meliza Amity
1840
-							switch ($sex2) {
1841
-								case 'M':
1842
-									return I18N::translate('great ×%s nephew', I18N::number($down - 1));
1843
-								case 'F':
1844
-									return I18N::translate('great ×%s niece', I18N::number($down - 1));
1845
-								default:
1846
-									return I18N::translate('great ×%s nephew/niece', I18N::number($down - 1));
1847
-							}
1848
-						case 'it': // Source: Michele Locati.
1849
-						case 'en_AU':
1850
-						case 'en_GB':
1851
-						case 'en_US':
1852
-						default:
1853
-							switch ($sex2) {
1854
-								case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1855
-									return I18N::translate('great ×%s nephew', I18N::number($down - 2));
1856
-								case 'F':
1857
-									return I18N::translate('great ×%s niece', I18N::number($down - 2));
1858
-								default:
1859
-									return I18N::translate('great ×%s nephew/niece', I18N::number($down - 2));
1860
-							}
1861 1861
 					}
1862 1862
 			}
1863 1863
 		}
@@ -1865,117 +1865,117 @@  discard block
 block discarded – undo
1865 1865
 			// direct ancestors
1866 1866
 			$up = strlen($match[1]) / 3;
1867 1867
 			switch ($up) {
1868
-				case 4:
1869
-					switch ($sex2) {
1870
-						case 'M':
1871
-							return I18N::translate('great-great-grandfather');
1872
-						case 'F':
1873
-							return I18N::translate('great-great-grandmother');
1874
-						default:
1875
-							return I18N::translate('great-great-grandparent');
1876
-					}
1877
-				case 5:
1878
-					switch ($sex2) {
1879
-						case 'M':
1880
-							return I18N::translate('great-great-great-grandfather');
1881
-						case 'F':
1882
-							return I18N::translate('great-great-great-grandmother');
1883
-						default:
1884
-							return I18N::translate('great-great-great-grandparent');
1885
-					}
1886
-				case 6:
1868
+			case 4:
1869
+				switch ($sex2) {
1870
+				case 'M':
1871
+				return I18N::translate('great-great-grandfather');
1872
+				case 'F':
1873
+				return I18N::translate('great-great-grandmother');
1874
+				default:
1875
+				return I18N::translate('great-great-grandparent');
1876
+				}
1877
+			case 5:
1878
+				switch ($sex2) {
1879
+				case 'M':
1880
+				return I18N::translate('great-great-great-grandfather');
1881
+				case 'F':
1882
+				return I18N::translate('great-great-great-grandmother');
1883
+				default:
1884
+				return I18N::translate('great-great-great-grandparent');
1885
+				}
1886
+			case 6:
1887
+				switch ($sex2) {
1888
+				case 'M':
1889
+				return I18N::translate('great ×4 grandfather');
1890
+				case 'F':
1891
+				return I18N::translate('great ×4 grandmother');
1892
+				default:
1893
+				return I18N::translate('great ×4 grandparent');
1894
+				}
1895
+			case 7:
1896
+				switch ($sex2) {
1897
+				case 'M':
1898
+				return I18N::translate('great ×5 grandfather');
1899
+				case 'F':
1900
+				return I18N::translate('great ×5 grandmother');
1901
+				default:
1902
+				return I18N::translate('great ×5 grandparent');
1903
+				}
1904
+			case 8:
1905
+				switch ($sex2) {
1906
+				case 'M':
1907
+				return I18N::translate('great ×6 grandfather');
1908
+				case 'F':
1909
+				return I18N::translate('great ×6 grandmother');
1910
+				default:
1911
+				return I18N::translate('great ×6 grandparent');
1912
+				}
1913
+			case 9:
1914
+				switch ($sex2) {
1915
+				case 'M':
1916
+				return I18N::translate('great ×7 grandfather');
1917
+				case 'F':
1918
+				return I18N::translate('great ×7 grandmother');
1919
+				default:
1920
+				return I18N::translate('great ×7 grandparent');
1921
+				}
1922
+			default:
1923
+				// Different languages have different rules for naming generations.
1924
+				// An English great ×12 grandfather is a Danish great ×11 grandfather.
1925
+				//
1926
+				// Need to find out which languages use which rules.
1927
+				switch (WT_LOCALE) {
1928
+				case 'da': // Source: Patrick Sorensen
1929
+				switch ($sex2) {
1930
+				case 'M':
1931
+				return I18N::translate('great ×%s grandfather', I18N::number($up - 3));
1932
+				case 'F':
1933
+				return I18N::translate('great ×%s grandmother', I18N::number($up - 3));
1934
+				default:
1935
+				return I18N::translate('great ×%s grandparent', I18N::number($up - 3));
1936
+				}
1937
+				case 'it': // Source: Michele Locati
1938
+				case 'es': // Source: Wes Groleau
1887 1939
 					switch ($sex2) {
1888
-						case 'M':
1889
-							return I18N::translate('great ×4 grandfather');
1890
-						case 'F':
1891
-							return I18N::translate('great ×4 grandmother');
1892
-						default:
1893
-							return I18N::translate('great ×4 grandparent');
1940
+					case 'M':
1941
+					return I18N::translate('great ×%s grandfather', I18N::number($up));
1942
+					case 'F':
1943
+					return I18N::translate('great ×%s grandmother', I18N::number($up));
1944
+					default:
1945
+					return I18N::translate('great ×%s grandparent', I18N::number($up));
1894 1946
 					}
1895
-				case 7:
1947
+				case 'fr': // Source: Jacqueline Tetreault
1948
+				case 'fr_CA':
1896 1949
 					switch ($sex2) {
1897
-						case 'M':
1898
-							return I18N::translate('great ×5 grandfather');
1899
-						case 'F':
1900
-							return I18N::translate('great ×5 grandmother');
1901
-						default:
1902
-							return I18N::translate('great ×5 grandparent');
1950
+					case 'M':
1951
+					return I18N::translate('great ×%s grandfather', I18N::number($up - 1));
1952
+					case 'F':
1953
+					return I18N::translate('great ×%s grandmother', I18N::number($up - 1));
1954
+					default:
1955
+					return I18N::translate('great ×%s grandparent', I18N::number($up - 1));
1903 1956
 					}
1904
-				case 8:
1957
+				case 'nn': // Source: Hogne Røed Nilsen (https://bugs.launchpad.net/webtrees/+bug/1168553)
1958
+				case 'nb':
1905 1959
 					switch ($sex2) {
1906
-						case 'M':
1907
-							return I18N::translate('great ×6 grandfather');
1908
-						case 'F':
1909
-							return I18N::translate('great ×6 grandmother');
1910
-						default:
1911
-							return I18N::translate('great ×6 grandparent');
1960
+					case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1961
+					return I18N::translate('great ×%s grandfather', I18N::number($up - 3));
1962
+					case 'F':
1963
+					return I18N::translate('great ×%s grandmother', I18N::number($up - 3));
1964
+					default:
1965
+					return I18N::translate('great ×%s grandparent', I18N::number($up - 3));
1912 1966
 					}
1913
-				case 9:
1967
+				case 'en_AU':
1968
+				case 'en_GB':
1969
+				case 'en_US':
1970
+				default:
1914 1971
 					switch ($sex2) {
1915
-						case 'M':
1916
-							return I18N::translate('great ×7 grandfather');
1917
-						case 'F':
1918
-							return I18N::translate('great ×7 grandmother');
1919
-						default:
1920
-							return I18N::translate('great ×7 grandparent');
1972
+					case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1973
+					return I18N::translate('great ×%s grandfather', I18N::number($up - 2));
1974
+					case 'F':
1975
+					return I18N::translate('great ×%s grandmother', I18N::number($up - 2));
1976
+					default:
1977
+					return I18N::translate('great ×%s grandparent', I18N::number($up - 2));
1921 1978
 					}
1922
-				default:
1923
-					// Different languages have different rules for naming generations.
1924
-					// An English great ×12 grandfather is a Danish great ×11 grandfather.
1925
-					//
1926
-					// Need to find out which languages use which rules.
1927
-					switch (WT_LOCALE) {
1928
-						case 'da': // Source: Patrick Sorensen
1929
-							switch ($sex2) {
1930
-								case 'M':
1931
-									return I18N::translate('great ×%s grandfather', I18N::number($up - 3));
1932
-								case 'F':
1933
-									return I18N::translate('great ×%s grandmother', I18N::number($up - 3));
1934
-								default:
1935
-									return I18N::translate('great ×%s grandparent', I18N::number($up - 3));
1936
-							}
1937
-						case 'it': // Source: Michele Locati
1938
-						case 'es': // Source: Wes Groleau
1939
-							switch ($sex2) {
1940
-								case 'M':
1941
-									return I18N::translate('great ×%s grandfather', I18N::number($up));
1942
-								case 'F':
1943
-									return I18N::translate('great ×%s grandmother', I18N::number($up));
1944
-								default:
1945
-									return I18N::translate('great ×%s grandparent', I18N::number($up));
1946
-							}
1947
-						case 'fr': // Source: Jacqueline Tetreault
1948
-						case 'fr_CA':
1949
-							switch ($sex2) {
1950
-								case 'M':
1951
-									return I18N::translate('great ×%s grandfather', I18N::number($up - 1));
1952
-								case 'F':
1953
-									return I18N::translate('great ×%s grandmother', I18N::number($up - 1));
1954
-								default:
1955
-									return I18N::translate('great ×%s grandparent', I18N::number($up - 1));
1956
-							}
1957
-						case 'nn': // Source: Hogne Røed Nilsen (https://bugs.launchpad.net/webtrees/+bug/1168553)
1958
-						case 'nb':
1959
-							switch ($sex2) {
1960
-								case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1961
-									return I18N::translate('great ×%s grandfather', I18N::number($up - 3));
1962
-								case 'F':
1963
-									return I18N::translate('great ×%s grandmother', I18N::number($up - 3));
1964
-								default:
1965
-									return I18N::translate('great ×%s grandparent', I18N::number($up - 3));
1966
-							}
1967
-						case 'en_AU':
1968
-						case 'en_GB':
1969
-						case 'en_US':
1970
-						default:
1971
-							switch ($sex2) {
1972
-								case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1973
-									return I18N::translate('great ×%s grandfather', I18N::number($up - 2));
1974
-								case 'F':
1975
-									return I18N::translate('great ×%s grandmother', I18N::number($up - 2));
1976
-								default:
1977
-									return I18N::translate('great ×%s grandparent', I18N::number($up - 2));
1978
-							}
1979 1979
 					}
1980 1980
 			}
1981 1981
 		}
@@ -1983,98 +1983,98 @@  discard block
 block discarded – undo
1983 1983
 			// direct descendants
1984 1984
 			$up = strlen($match[1]) / 3;
1985 1985
 			switch ($up) {
1986
-				case 4:
1987
-					switch ($sex2) {
1988
-						case 'M':
1989
-							return I18N::translate('great-great-grandson');
1990
-						case 'F':
1991
-							return I18N::translate('great-great-granddaughter');
1992
-						default:
1993
-							return I18N::translate('great-great-grandchild');
1994
-					}
1986
+			case 4:
1987
+				switch ($sex2) {
1988
+				case 'M':
1989
+				return I18N::translate('great-great-grandson');
1990
+				case 'F':
1991
+				return I18N::translate('great-great-granddaughter');
1992
+				default:
1993
+				return I18N::translate('great-great-grandchild');
1994
+				}
1995 1995
 
1996
-				case 5:
1997
-					switch ($sex2) {
1998
-						case 'M':
1999
-							return I18N::translate('great-great-great-grandson');
2000
-						case 'F':
2001
-							return I18N::translate('great-great-great-granddaughter');
2002
-						default:
2003
-							return I18N::translate('great-great-great-grandchild');
2004
-					}
1996
+			case 5:
1997
+				switch ($sex2) {
1998
+				case 'M':
1999
+				return I18N::translate('great-great-great-grandson');
2000
+				case 'F':
2001
+				return I18N::translate('great-great-great-granddaughter');
2002
+				default:
2003
+				return I18N::translate('great-great-great-grandchild');
2004
+				}
2005 2005
 
2006
-				case 6:
2007
-					switch ($sex2) {
2008
-						case 'M':
2009
-							return I18N::translate('great ×4 grandson');
2010
-						case 'F':
2011
-							return I18N::translate('great ×4 granddaughter');
2012
-						default:
2013
-							return I18N::translate('great ×4 grandchild');
2014
-					}
2006
+			case 6:
2007
+				switch ($sex2) {
2008
+				case 'M':
2009
+				return I18N::translate('great ×4 grandson');
2010
+				case 'F':
2011
+				return I18N::translate('great ×4 granddaughter');
2012
+				default:
2013
+				return I18N::translate('great ×4 grandchild');
2014
+				}
2015 2015
 
2016
-				case 7:
2017
-					switch ($sex2) {
2018
-						case 'M':
2019
-							return I18N::translate('great ×5 grandson');
2020
-						case 'F':
2021
-							return I18N::translate('great ×5 granddaughter');
2022
-						default:
2023
-							return I18N::translate('great ×5 grandchild');
2024
-					}
2016
+			case 7:
2017
+				switch ($sex2) {
2018
+				case 'M':
2019
+				return I18N::translate('great ×5 grandson');
2020
+				case 'F':
2021
+				return I18N::translate('great ×5 granddaughter');
2022
+				default:
2023
+				return I18N::translate('great ×5 grandchild');
2024
+				}
2025 2025
 
2026
-				case 8:
2027
-					switch ($sex2) {
2028
-						case 'M':
2029
-							return I18N::translate('great ×6 grandson');
2030
-						case 'F':
2031
-							return I18N::translate('great ×6 granddaughter');
2032
-						default:
2033
-							return I18N::translate('great ×6 grandchild');
2034
-					}
2026
+			case 8:
2027
+				switch ($sex2) {
2028
+				case 'M':
2029
+				return I18N::translate('great ×6 grandson');
2030
+				case 'F':
2031
+				return I18N::translate('great ×6 granddaughter');
2032
+				default:
2033
+				return I18N::translate('great ×6 grandchild');
2034
+				}
2035 2035
 
2036
-				case 9:
2037
-					switch ($sex2) {
2038
-						case 'M':
2039
-							return I18N::translate('great ×7 grandson');
2040
-						case 'F':
2041
-							return I18N::translate('great ×7 granddaughter');
2042
-						default:
2043
-							return I18N::translate('great ×7 grandchild');
2044
-					}
2036
+			case 9:
2037
+				switch ($sex2) {
2038
+				case 'M':
2039
+				return I18N::translate('great ×7 grandson');
2040
+				case 'F':
2041
+				return I18N::translate('great ×7 granddaughter');
2042
+				default:
2043
+				return I18N::translate('great ×7 grandchild');
2044
+				}
2045 2045
 
2046
+			default:
2047
+				// Different languages have different rules for naming generations.
2048
+				// An English great ×12 grandson is a Danish great ×11 grandson.
2049
+				//
2050
+				// Need to find out which languages use which rules.
2051
+				switch (WT_LOCALE) {
2052
+				case 'nn': // Source: Hogne Røed Nilsen
2053
+				case 'nb':
2054
+				case 'da': // Source: Patrick Sorensen
2055
+				switch ($sex2) {
2056
+				case 'M':
2057
+				return I18N::translate('great ×%s grandson', I18N::number($up - 3));
2058
+				case 'F':
2059
+				return I18N::translate('great ×%s granddaughter', I18N::number($up - 3));
2046 2060
 				default:
2047
-					// Different languages have different rules for naming generations.
2048
-					// An English great ×12 grandson is a Danish great ×11 grandson.
2049
-					//
2050
-					// Need to find out which languages use which rules.
2051
-					switch (WT_LOCALE) {
2052
-						case 'nn': // Source: Hogne Røed Nilsen
2053
-						case 'nb':
2054
-						case 'da': // Source: Patrick Sorensen
2055
-							switch ($sex2) {
2056
-								case 'M':
2057
-									return I18N::translate('great ×%s grandson', I18N::number($up - 3));
2058
-								case 'F':
2059
-									return I18N::translate('great ×%s granddaughter', I18N::number($up - 3));
2060
-								default:
2061
-									return I18N::translate('great ×%s grandchild', I18N::number($up - 3));
2062
-							}
2063
-						case 'it': // Source: Michele Locati
2064
-						case 'es': // Source: Wes Groleau (adding doesn’t change behavior, but needs to be better researched)
2065
-						case 'en_AU':
2066
-						case 'en_GB':
2067
-						case 'en_US':
2068
-						default:
2069
-							switch ($sex2) {
2061
+				return I18N::translate('great ×%s grandchild', I18N::number($up - 3));
2062
+				}
2063
+				case 'it': // Source: Michele Locati
2064
+				case 'es': // Source: Wes Groleau (adding doesn’t change behavior, but needs to be better researched)
2065
+				case 'en_AU':
2066
+				case 'en_GB':
2067
+				case 'en_US':
2068
+				default:
2069
+					switch ($sex2) {
2070 2070
 
2071
-								case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
2072
-									return I18N::translate('great ×%s grandson', I18N::number($up - 2));
2073
-								case 'F':
2074
-									return I18N::translate('great ×%s granddaughter', I18N::number($up - 2));
2075
-								default:
2076
-									return I18N::translate('great ×%s grandchild', I18N::number($up - 2));
2077
-							}
2071
+					case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
2072
+					return I18N::translate('great ×%s grandson', I18N::number($up - 2));
2073
+					case 'F':
2074
+					return I18N::translate('great ×%s granddaughter', I18N::number($up - 2));
2075
+					default:
2076
+					return I18N::translate('great ×%s grandchild', I18N::number($up - 2));
2077
+					}
2078 2078
 					}
2079 2079
 			}
2080 2080
 		}
@@ -2092,68 +2092,68 @@  discard block
 block discarded – undo
2092 2092
 			//
2093 2093
 			// Need to find out which languages use which rules.
2094 2094
 			switch (WT_LOCALE) {
2095
-				case 'pl': // Source: Lukasz Wilenski
2096
-					return self::cousinName($up + $down + 2, $sex2);
2097
-				case 'it':
2098
-					// Source: Michele Locati. See italian_cousins_names.zip
2099
-					// http://webtrees.net/forums/8-translation/1200-great-xn-grandparent?limit=6&start=6
2100
-					return self::cousinName($up + $down - 3, $sex2);
2101
-				case 'es':
2102
-					// Source: Wes Groleau. See http://UniGen.us/Parentesco.html & http://UniGen.us/Parentesco-D.html
2103
-					if ($down == $up) {
2104
-						return self::cousinName($cousin, $sex2);
2105
-					} elseif ($down < $up) {
2106
-						return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sib' . $descent, null, null));
2107
-					} else {
2108
-						switch ($sex2) {
2109
-							case 'M':
2110
-								return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('bro' . $descent, null, null));
2111
-							case 'F':
2112
-								return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sis' . $descent, null, null));
2113
-							default:
2114
-								return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sib' . $descent, null, null));
2115
-						}
2095
+			case 'pl': // Source: Lukasz Wilenski
2096
+				return self::cousinName($up + $down + 2, $sex2);
2097
+			case 'it':
2098
+				// Source: Michele Locati. See italian_cousins_names.zip
2099
+				// http://webtrees.net/forums/8-translation/1200-great-xn-grandparent?limit=6&start=6
2100
+				return self::cousinName($up + $down - 3, $sex2);
2101
+			case 'es':
2102
+				// Source: Wes Groleau. See http://UniGen.us/Parentesco.html & http://UniGen.us/Parentesco-D.html
2103
+				if ($down == $up) {
2104
+					return self::cousinName($cousin, $sex2);
2105
+				} elseif ($down < $up) {
2106
+					return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sib' . $descent, null, null));
2107
+				} else {
2108
+					switch ($sex2) {
2109
+					case 'M':
2110
+					return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('bro' . $descent, null, null));
2111
+					case 'F':
2112
+					return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sis' . $descent, null, null));
2113
+					default:
2114
+					return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sib' . $descent, null, null));
2116 2115
 					}
2117
-				case 'en_AU': // See: http://en.wikipedia.org/wiki/File:CousinTree.svg
2118
-				case 'en_GB':
2119
-				case 'en_US':
2120
-				default:
2121
-					switch ($removed) {
2122
-						case 0:
2123
-							return self::cousinName($cousin, $sex2);
2124
-						case 1:
2125
-							if ($up > $down) {
2126
-								/* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
2127
-								return I18N::translate('%s once removed ascending', self::cousinName($cousin, $sex2));
2128
-							} else {
2129
-								/* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
2130
-								return I18N::translate('%s once removed descending', self::cousinName($cousin, $sex2));
2131
-							}
2132
-						case 2:
2133
-							if ($up > $down) {
2134
-								/* I18N: %s=“fifth cousin”, etc. */
2135
-								return I18N::translate('%s twice removed ascending', self::cousinName($cousin, $sex2));
2136
-							} else {
2137
-								/* I18N: %s=“fifth cousin”, etc. */
2138
-								return I18N::translate('%s twice removed descending', self::cousinName($cousin, $sex2));
2139
-							}
2140
-						case 3:
2141
-							if ($up > $down) {
2142
-								/* I18N: %s=“fifth cousin”, etc. */
2143
-								return I18N::translate('%s three times removed ascending', self::cousinName($cousin, $sex2));
2144
-							} else {
2145
-								/* I18N: %s=“fifth cousin”, etc. */
2146
-								return I18N::translate('%s three times removed descending', self::cousinName($cousin, $sex2));
2147
-							}
2148
-						default:
2149
-							if ($up > $down) {
2150
-								/* I18N: %1$s=“fifth cousin”, etc., %2$s>=4 */
2151
-								return I18N::translate('%1$s %2$s times removed ascending', self::cousinName($cousin, $sex2), I18N::number($removed));
2152
-							} else {
2153
-								/* I18N: %1$s=“fifth cousin”, etc., %2$s>=4 */
2154
-								return I18N::translate('%1$s %2$s times removed descending', self::cousinName($cousin, $sex2), I18N::number($removed));
2155
-							}
2156 2116
 					}
2117
+			case 'en_AU': // See: http://en.wikipedia.org/wiki/File:CousinTree.svg
2118
+			case 'en_GB':
2119
+			case 'en_US':
2120
+			default:
2121
+				switch ($removed) {
2122
+				case 0:
2123
+				return self::cousinName($cousin, $sex2);
2124
+				case 1:
2125
+				if ($up > $down) {
2126
+				/* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
2127
+				return I18N::translate('%s once removed ascending', self::cousinName($cousin, $sex2));
2128
+				} else {
2129
+				/* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
2130
+				return I18N::translate('%s once removed descending', self::cousinName($cousin, $sex2));
2131
+				}
2132
+				case 2:
2133
+				if ($up > $down) {
2134
+				/* I18N: %s=“fifth cousin”, etc. */
2135
+				return I18N::translate('%s twice removed ascending', self::cousinName($cousin, $sex2));
2136
+				} else {
2137
+				/* I18N: %s=“fifth cousin”, etc. */
2138
+				return I18N::translate('%s twice removed descending', self::cousinName($cousin, $sex2));
2139
+				}
2140
+				case 3:
2141
+				if ($up > $down) {
2142
+				/* I18N: %s=“fifth cousin”, etc. */
2143
+				return I18N::translate('%s three times removed ascending', self::cousinName($cousin, $sex2));
2144
+				} else {
2145
+				/* I18N: %s=“fifth cousin”, etc. */
2146
+				return I18N::translate('%s three times removed descending', self::cousinName($cousin, $sex2));
2147
+				}
2148
+				default:
2149
+				if ($up > $down) {
2150
+				/* I18N: %1$s=“fifth cousin”, etc., %2$s>=4 */
2151
+				return I18N::translate('%1$s %2$s times removed ascending', self::cousinName($cousin, $sex2), I18N::number($removed));
2152
+				} else {
2153
+				/* I18N: %1$s=“fifth cousin”, etc., %2$s>=4 */
2154
+				return I18N::translate('%1$s %2$s times removed descending', self::cousinName($cousin, $sex2), I18N::number($removed));
2155
+				}
2156
+				}
2157 2157
 			}
2158 2158
 		}
2159 2159
 
Please login to merge, or discard this patch.
app/Functions/FunctionsPrintFacts.php 1 patch
Switch Indentation   +290 added lines, -290 removed lines patch added patch discarded remove patch
@@ -60,34 +60,34 @@  discard block
 block discarded – undo
60 60
 
61 61
 		// Some facts don't get printed here ...
62 62
 		switch ($fact->getTag()) {
63
-			case 'NOTE':
64
-				self::printMainNotes($fact, 1);
63
+		case 'NOTE':
64
+			self::printMainNotes($fact, 1);
65 65
 
66
-				return;
67
-			case 'SOUR':
68
-				self::printMainSources($fact, 1);
66
+			return;
67
+		case 'SOUR':
68
+			self::printMainSources($fact, 1);
69 69
 
70
-				return;
71
-			case 'OBJE':
72
-				self::printMainMedia($fact, 1);
70
+			return;
71
+		case 'OBJE':
72
+			self::printMainMedia($fact, 1);
73 73
 
74
+			return;
75
+		case 'FAMC':
76
+		case 'FAMS':
77
+		case 'CHIL':
78
+		case 'HUSB':
79
+		case 'WIFE':
80
+			// These are internal links, not facts
81
+			return;
82
+		case '_WT_OBJE_SORT':
83
+			// These links are used internally to record the sort order.
84
+			return;
85
+		default:
86
+			// Hide unrecognized/custom tags?
87
+			if ($fact->getParent()->getTree()->getPreference('HIDE_GEDCOM_ERRORS') && !GedcomTag::isTag($fact->getTag())) {
74 88
 				return;
75
-			case 'FAMC':
76
-			case 'FAMS':
77
-			case 'CHIL':
78
-			case 'HUSB':
79
-			case 'WIFE':
80
-				// These are internal links, not facts
81
-				return;
82
-			case '_WT_OBJE_SORT':
83
-				// These links are used internally to record the sort order.
84
-				return;
85
-			default:
86
-				// Hide unrecognized/custom tags?
87
-				if ($fact->getParent()->getTree()->getPreference('HIDE_GEDCOM_ERRORS') && !GedcomTag::isTag($fact->getTag())) {
88
-					return;
89
-				}
90
-				break;
89
+			}
90
+			break;
91 91
 		}
92 92
 
93 93
 		// Who is this fact about? Need it to translate fact label correctly
@@ -131,35 +131,35 @@  discard block
 block discarded – undo
131 131
 		}
132 132
 
133 133
 		switch ($fact->getTag()) {
134
-			case 'EVEN':
135
-			case 'FACT':
136
-				if (GedcomTag::isTag($type)) {
137
-					// Some users (just Meliza?) use "1 EVEN/2 TYPE BIRT". Translate the TYPE.
138
-					$label = GedcomTag::getLabel($type, $label_person);
139
-					$type  = ''; // Do not print this again
140
-				} elseif ($type) {
141
-					// We don't have a translation for $type - but a custom translation might exist.
142
-					$label = I18N::translate(Filter::escapeHtml($type));
143
-					$type  = ''; // Do not print this again
144
-				} else {
145
-					// An unspecified fact/event
146
-					$label = $fact->getLabel();
147
-				}
148
-				break;
149
-			case 'MARR':
150
-				// This is a hack for a proprietory extension. Is it still used/needed?
151
-				$utype = strtoupper($type);
152
-				if ($utype == 'CIVIL' || $utype == 'PARTNERS' || $utype == 'RELIGIOUS') {
153
-					$label = GedcomTag::getLabel('MARR_' . $utype, $label_person);
154
-					$type  = ''; // Do not print this again
155
-				} else {
156
-					$label = $fact->getLabel();
157
-				}
158
-				break;
159
-			default:
160
-				// Normal fact/event
134
+		case 'EVEN':
135
+		case 'FACT':
136
+			if (GedcomTag::isTag($type)) {
137
+				// Some users (just Meliza?) use "1 EVEN/2 TYPE BIRT". Translate the TYPE.
138
+				$label = GedcomTag::getLabel($type, $label_person);
139
+				$type  = ''; // Do not print this again
140
+			} elseif ($type) {
141
+				// We don't have a translation for $type - but a custom translation might exist.
142
+				$label = I18N::translate(Filter::escapeHtml($type));
143
+				$type  = ''; // Do not print this again
144
+			} else {
145
+				// An unspecified fact/event
161 146
 				$label = $fact->getLabel();
162
-				break;
147
+			}
148
+			break;
149
+		case 'MARR':
150
+			// This is a hack for a proprietory extension. Is it still used/needed?
151
+			$utype = strtoupper($type);
152
+			if ($utype == 'CIVIL' || $utype == 'PARTNERS' || $utype == 'RELIGIOUS') {
153
+				$label = GedcomTag::getLabel('MARR_' . $utype, $label_person);
154
+				$type  = ''; // Do not print this again
155
+			} else {
156
+				$label = $fact->getLabel();
157
+			}
158
+			break;
159
+		default:
160
+			// Normal fact/event
161
+			$label = $fact->getLabel();
162
+			break;
163 163
 		}
164 164
 
165 165
 		echo '<tr class="', $styleadd, '">';
@@ -208,15 +208,15 @@  discard block
 block discarded – undo
208 208
 		}
209 209
 
210 210
 		switch ($fact->getTag()) {
211
-			case '_BIRT_CHIL':
212
-				echo '<br>', /* I18N: Abbreviation for "number %s" */
213
-				I18N::translate('#%s', ++$n_chil);
214
-				break;
215
-			case '_BIRT_GCHI':
216
-			case '_BIRT_GCH1':
217
-			case '_BIRT_GCH2':
218
-				echo '<br>', I18N::translate('#%s', ++$n_gchi);
219
-				break;
211
+		case '_BIRT_CHIL':
212
+			echo '<br>', /* I18N: Abbreviation for "number %s" */
213
+			I18N::translate('#%s', ++$n_chil);
214
+			break;
215
+		case '_BIRT_GCHI':
216
+		case '_BIRT_GCH1':
217
+		case '_BIRT_GCH2':
218
+			echo '<br>', I18N::translate('#%s', ++$n_gchi);
219
+			break;
220 220
 		}
221 221
 
222 222
 		echo '</td><td class="optionbox ', $styleadd, ' wrap">';
@@ -237,92 +237,92 @@  discard block
 block discarded – undo
237 237
 
238 238
 		// Print the value of this fact/event
239 239
 		switch ($fact->getTag()) {
240
-			case 'ADDR':
241
-				echo $fact->getValue();
242
-				break;
243
-			case 'AFN':
244
-				echo '<div class="field"><a href="https://familysearch.org/search/tree/results#count=20&query=afn:', Filter::escapeUrl($fact->getValue()), '">', Filter::escapeHtml($fact->getValue()), '</a></div>';
245
-				break;
246
-			case 'ASSO':
247
-				// we handle this later, in format_asso_rela_record()
248
-				break;
249
-			case 'EMAIL':
250
-			case 'EMAI':
251
-			case '_EMAIL':
252
-				echo '<div class="field"><a href="mailto:', Filter::escapeHtml($fact->getValue()), '">', Filter::escapeHtml($fact->getValue()), '</a></div>';
253
-				break;
254
-			case 'FILE':
255
-				if (Auth::isEditor($fact->getParent()->getTree())) {
256
-					echo '<div class="field">', Filter::escapeHtml($fact->getValue()), '</div>';
257
-				}
258
-				break;
259
-			case 'RESN':
260
-				echo '<div class="field">';
261
-				switch ($fact->getValue()) {
262
-					case 'none':
263
-						// Note: "1 RESN none" is not valid gedcom.
264
-						// However, webtrees privacy rules will interpret it as "show an otherwise private record to public".
265
-						echo '<i class="icon-resn-none"></i> ', I18N::translate('Show to visitors');
266
-						break;
267
-					case 'privacy':
268
-						echo '<i class="icon-class-none"></i> ', I18N::translate('Show to members');
269
-						break;
270
-					case 'confidential':
271
-						echo '<i class="icon-confidential-none"></i> ', I18N::translate('Show to managers');
272
-						break;
273
-					case 'locked':
274
-						echo '<i class="icon-locked-none"></i> ', I18N::translate('Only managers can edit');
275
-						break;
276
-					default:
277
-						echo Filter::escapeHtml($fact->getValue());
278
-						break;
279
-				}
240
+		case 'ADDR':
241
+			echo $fact->getValue();
242
+			break;
243
+		case 'AFN':
244
+			echo '<div class="field"><a href="https://familysearch.org/search/tree/results#count=20&query=afn:', Filter::escapeUrl($fact->getValue()), '">', Filter::escapeHtml($fact->getValue()), '</a></div>';
245
+			break;
246
+		case 'ASSO':
247
+			// we handle this later, in format_asso_rela_record()
248
+			break;
249
+		case 'EMAIL':
250
+		case 'EMAI':
251
+		case '_EMAIL':
252
+			echo '<div class="field"><a href="mailto:', Filter::escapeHtml($fact->getValue()), '">', Filter::escapeHtml($fact->getValue()), '</a></div>';
253
+			break;
254
+		case 'FILE':
255
+			if (Auth::isEditor($fact->getParent()->getTree())) {
256
+				echo '<div class="field">', Filter::escapeHtml($fact->getValue()), '</div>';
257
+			}
258
+			break;
259
+		case 'RESN':
260
+			echo '<div class="field">';
261
+			switch ($fact->getValue()) {
262
+			case 'none':
263
+			// Note: "1 RESN none" is not valid gedcom.
264
+			// However, webtrees privacy rules will interpret it as "show an otherwise private record to public".
265
+			echo '<i class="icon-resn-none"></i> ', I18N::translate('Show to visitors');
266
+			break;
267
+			case 'privacy':
268
+			echo '<i class="icon-class-none"></i> ', I18N::translate('Show to members');
269
+			break;
270
+			case 'confidential':
271
+			echo '<i class="icon-confidential-none"></i> ', I18N::translate('Show to managers');
272
+			break;
273
+			case 'locked':
274
+			echo '<i class="icon-locked-none"></i> ', I18N::translate('Only managers can edit');
275
+			break;
276
+			default:
277
+			echo Filter::escapeHtml($fact->getValue());
278
+			break;
279
+			}
280 280
 				echo '</div>';
281 281
 				break;
282
-			case 'PUBL': // Publication details might contain URLs.
283
-				echo '<div class="field">', Filter::expandUrls($fact->getValue()), '</div>';
284
-				break;
285
-			case 'REPO':
286
-				if (preg_match('/^@(' . WT_REGEX_XREF . ')@$/', $fact->getValue(), $match)) {
287
-					self::printRepositoryRecord($match[1]);
288
-				} else {
289
-					echo '<div class="error">', Filter::escapeHtml($fact->getValue()), '</div>';
290
-				}
291
-				break;
292
-			case 'URL':
293
-			case '_URL':
294
-			case 'WWW':
295
-				echo '<div class="field"><a href="', Filter::escapeHtml($fact->getValue()), '">', Filter::escapeHtml($fact->getValue()), '</a></div>';
296
-				break;
297
-			case 'TEXT': // 0 SOUR / 1 TEXT
298
-				echo '<div class="field">', nl2br(Filter::escapeHtml($fact->getValue()), false), '</div>';
299
-				break;
282
+		case 'PUBL': // Publication details might contain URLs.
283
+			echo '<div class="field">', Filter::expandUrls($fact->getValue()), '</div>';
284
+			break;
285
+		case 'REPO':
286
+			if (preg_match('/^@(' . WT_REGEX_XREF . ')@$/', $fact->getValue(), $match)) {
287
+				self::printRepositoryRecord($match[1]);
288
+			} else {
289
+				echo '<div class="error">', Filter::escapeHtml($fact->getValue()), '</div>';
290
+			}
291
+			break;
292
+		case 'URL':
293
+		case '_URL':
294
+		case 'WWW':
295
+			echo '<div class="field"><a href="', Filter::escapeHtml($fact->getValue()), '">', Filter::escapeHtml($fact->getValue()), '</a></div>';
296
+			break;
297
+		case 'TEXT': // 0 SOUR / 1 TEXT
298
+			echo '<div class="field">', nl2br(Filter::escapeHtml($fact->getValue()), false), '</div>';
299
+			break;
300
+		default:
301
+			// Display the value for all other facts/events
302
+			switch ($fact->getValue()) {
303
+			case '':
304
+			// Nothing to display
305
+			break;
306
+			case 'N':
307
+			// Not valid GEDCOM
308
+			echo '<div class="field">', I18N::translate('No'), '</div>';
309
+			break;
310
+			case 'Y':
311
+			// Do not display "Yes".
312
+			break;
300 313
 			default:
301
-				// Display the value for all other facts/events
302
-				switch ($fact->getValue()) {
303
-					case '':
304
-						// Nothing to display
305
-						break;
306
-					case 'N':
307
-						// Not valid GEDCOM
308
-						echo '<div class="field">', I18N::translate('No'), '</div>';
309
-						break;
310
-					case 'Y':
311
-						// Do not display "Yes".
312
-						break;
313
-					default:
314
-						if (preg_match('/^@(' . WT_REGEX_XREF . ')@$/', $fact->getValue(), $match)) {
315
-							$target = GedcomRecord::getInstance($match[1], $fact->getParent()->getTree());
316
-							if ($target) {
317
-								echo '<div><a href="', $target->getHtmlUrl(), '">', $target->getFullName(), '</a></div>';
318
-							} else {
319
-								echo '<div class="error">', Filter::escapeHtml($fact->getValue()), '</div>';
320
-							}
321
-						} else {
322
-							echo '<div class="field"><span dir="auto">', Filter::escapeHtml($fact->getValue()), '</span></div>';
323
-						}
324
-						break;
325
-				}
314
+			if (preg_match('/^@(' . WT_REGEX_XREF . ')@$/', $fact->getValue(), $match)) {
315
+			$target = GedcomRecord::getInstance($match[1], $fact->getParent()->getTree());
316
+			if ($target) {
317
+				echo '<div><a href="', $target->getHtmlUrl(), '">', $target->getFullName(), '</a></div>';
318
+			} else {
319
+				echo '<div class="error">', Filter::escapeHtml($fact->getValue()), '</div>';
320
+			}
321
+			} else {
322
+			echo '<div class="field"><span dir="auto">', Filter::escapeHtml($fact->getValue()), '</span></div>';
323
+			}
324
+			break;
325
+			}
326 326
 				break;
327 327
 		}
328 328
 
@@ -362,118 +362,118 @@  discard block
 block discarded – undo
362 362
 		preg_match_all('/\n2 (' . WT_REGEX_TAG . ') (.+)/', $fact->getGedcom(), $matches, PREG_SET_ORDER);
363 363
 		foreach ($matches as $match) {
364 364
 			switch ($match[1]) {
365
-				case 'DATE':
366
-				case 'TIME':
367
-				case 'AGE':
368
-				case 'PLAC':
369
-				case 'ADDR':
370
-				case 'ALIA':
371
-				case 'ASSO':
372
-				case '_ASSO':
373
-				case 'DESC':
374
-				case 'RELA':
375
-				case 'STAT':
376
-				case 'TEMP':
377
-				case 'TYPE':
378
-				case 'FAMS':
379
-				case 'CONT':
380
-					// These were already shown at the beginning
381
-					break;
382
-				case 'NOTE':
383
-				case 'OBJE':
384
-				case 'SOUR':
385
-					// These will be shown at the end
386
-					break;
387
-				case 'EVEN': // 0 SOUR / 1 DATA / 2 EVEN / 3 DATE / 3 PLAC
388
-					$events = array();
389
-					foreach (preg_split('/ *, */', $match[2]) as $event) {
390
-						$events[] = GedcomTag::getLabel($event);
391
-					}
392
-					if (count($events) == 1) {
393
-						echo GedcomTag::getLabelValue('EVEN', $event);
394
-					} else {
395
-						echo GedcomTag::getLabelValue('EVEN', implode(I18N::$list_separator, $events));
396
-					}
397
-					if (preg_match('/\n3 DATE (.+)/', $fact->getGedcom(), $date_match)) {
398
-						$date = new Date($date_match[1]);
399
-						echo GedcomTag::getLabelValue('DATE', $date->display());
400
-					}
401
-					if (preg_match('/\n3 PLAC (.+)/', $fact->getGedcom(), $plac_match)) {
402
-						echo GedcomTag::getLabelValue('PLAC', $plac_match[1]);
403
-					}
404
-					break;
405
-				case 'FAMC': // 0 INDI / 1 ADOP / 2 FAMC / 3 ADOP
406
-					$family = Family::getInstance(str_replace('@', '', $match[2]), $fact->getParent()->getTree());
407
-					if ($family) {
408
-						echo GedcomTag::getLabelValue('FAM', '<a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a>');
409
-						if (preg_match('/\n3 ADOP (HUSB|WIFE|BOTH)/', $fact->getGedcom(), $match)) {
410
-							echo GedcomTag::getLabelValue('ADOP', GedcomCodeAdop::getValue($match[1], $label_person));
411
-						}
412
-					} else {
413
-						echo GedcomTag::getLabelValue('FAM', '<span class="error">' . $match[2] . '</span>');
414
-					}
415
-					break;
416
-				case '_WT_USER':
417
-					$user = User::findByIdentifier($match[2]); // may not exist
418
-					if ($user) {
419
-						echo GedcomTag::getLabelValue('_WT_USER', $user->getRealNameHtml());
420
-					} else {
421
-						echo GedcomTag::getLabelValue('_WT_USER', Filter::escapeHtml($match[2]));
422
-					}
423
-					break;
424
-				case 'RESN':
425
-					switch ($match[2]) {
426
-						case 'none':
427
-							// Note: "2 RESN none" is not valid gedcom.
428
-							// However, webtrees privacy rules will interpret it as "show an otherwise private fact to public".
429
-							echo GedcomTag::getLabelValue('RESN', '<i class="icon-resn-none"></i> ' . I18N::translate('Show to visitors'));
430
-							break;
431
-						case 'privacy':
432
-							echo GedcomTag::getLabelValue('RESN', '<i class="icon-resn-privacy"></i> ' . I18N::translate('Show to members'));
433
-							break;
434
-						case 'confidential':
435
-							echo GedcomTag::getLabelValue('RESN', '<i class="icon-resn-confidential"></i> ' . I18N::translate('Show to managers'));
436
-							break;
437
-						case 'locked':
438
-							echo GedcomTag::getLabelValue('RESN', '<i class="icon-resn-locked"></i> ' . I18N::translate('Only managers can edit'));
439
-							break;
440
-						default:
441
-							echo GedcomTag::getLabelValue('RESN', Filter::escapeHtml($match[2]));
442
-							break;
443
-					}
444
-					break;
445
-				case 'CALN':
446
-					echo GedcomTag::getLabelValue('CALN', Filter::expandUrls($match[2]));
447
-					break;
448
-				case 'FORM': // 0 OBJE / 1 FILE / 2 FORM / 3 TYPE
449
-					echo GedcomTag::getLabelValue('FORM', $match[2]);
450
-					if (preg_match('/\n3 TYPE (.+)/', $fact->getGedcom(), $type_match)) {
451
-						echo GedcomTag::getLabelValue('TYPE', GedcomTag::getFileFormTypeValue($type_match[1]));
365
+			case 'DATE':
366
+			case 'TIME':
367
+			case 'AGE':
368
+			case 'PLAC':
369
+			case 'ADDR':
370
+			case 'ALIA':
371
+			case 'ASSO':
372
+			case '_ASSO':
373
+			case 'DESC':
374
+			case 'RELA':
375
+			case 'STAT':
376
+			case 'TEMP':
377
+			case 'TYPE':
378
+			case 'FAMS':
379
+			case 'CONT':
380
+				// These were already shown at the beginning
381
+				break;
382
+			case 'NOTE':
383
+			case 'OBJE':
384
+			case 'SOUR':
385
+				// These will be shown at the end
386
+				break;
387
+			case 'EVEN': // 0 SOUR / 1 DATA / 2 EVEN / 3 DATE / 3 PLAC
388
+				$events = array();
389
+				foreach (preg_split('/ *, */', $match[2]) as $event) {
390
+					$events[] = GedcomTag::getLabel($event);
391
+				}
392
+				if (count($events) == 1) {
393
+					echo GedcomTag::getLabelValue('EVEN', $event);
394
+				} else {
395
+					echo GedcomTag::getLabelValue('EVEN', implode(I18N::$list_separator, $events));
396
+				}
397
+				if (preg_match('/\n3 DATE (.+)/', $fact->getGedcom(), $date_match)) {
398
+					$date = new Date($date_match[1]);
399
+					echo GedcomTag::getLabelValue('DATE', $date->display());
400
+				}
401
+				if (preg_match('/\n3 PLAC (.+)/', $fact->getGedcom(), $plac_match)) {
402
+					echo GedcomTag::getLabelValue('PLAC', $plac_match[1]);
403
+				}
404
+				break;
405
+			case 'FAMC': // 0 INDI / 1 ADOP / 2 FAMC / 3 ADOP
406
+				$family = Family::getInstance(str_replace('@', '', $match[2]), $fact->getParent()->getTree());
407
+				if ($family) {
408
+					echo GedcomTag::getLabelValue('FAM', '<a href="' . $family->getHtmlUrl() . '">' . $family->getFullName() . '</a>');
409
+					if (preg_match('/\n3 ADOP (HUSB|WIFE|BOTH)/', $fact->getGedcom(), $match)) {
410
+						echo GedcomTag::getLabelValue('ADOP', GedcomCodeAdop::getValue($match[1], $label_person));
452 411
 					}
453
-					break;
454
-				case 'URL':
455
-				case '_URL':
456
-				case 'WWW':
457
-					$link = '<a href="' . Filter::escapeHtml($match[2]) . '">' . Filter::escapeHtml($match[2]) . '</a>';
458
-					echo GedcomTag::getLabelValue($fact->getTag() . ':' . $match[1], $link);
459
-					break;
412
+				} else {
413
+					echo GedcomTag::getLabelValue('FAM', '<span class="error">' . $match[2] . '</span>');
414
+				}
415
+				break;
416
+			case '_WT_USER':
417
+				$user = User::findByIdentifier($match[2]); // may not exist
418
+				if ($user) {
419
+					echo GedcomTag::getLabelValue('_WT_USER', $user->getRealNameHtml());
420
+				} else {
421
+					echo GedcomTag::getLabelValue('_WT_USER', Filter::escapeHtml($match[2]));
422
+				}
423
+				break;
424
+			case 'RESN':
425
+				switch ($match[2]) {
426
+				case 'none':
427
+				// Note: "2 RESN none" is not valid gedcom.
428
+				// However, webtrees privacy rules will interpret it as "show an otherwise private fact to public".
429
+				echo GedcomTag::getLabelValue('RESN', '<i class="icon-resn-none"></i> ' . I18N::translate('Show to visitors'));
430
+				break;
431
+				case 'privacy':
432
+				echo GedcomTag::getLabelValue('RESN', '<i class="icon-resn-privacy"></i> ' . I18N::translate('Show to members'));
433
+				break;
434
+				case 'confidential':
435
+				echo GedcomTag::getLabelValue('RESN', '<i class="icon-resn-confidential"></i> ' . I18N::translate('Show to managers'));
436
+				break;
437
+				case 'locked':
438
+				echo GedcomTag::getLabelValue('RESN', '<i class="icon-resn-locked"></i> ' . I18N::translate('Only managers can edit'));
439
+				break;
460 440
 				default:
461
-					if (!$fact->getParent()->getTree()->getPreference('HIDE_GEDCOM_ERRORS') || GedcomTag::isTag($match[1])) {
462
-						if (preg_match('/^@(' . WT_REGEX_XREF . ')@$/', $match[2], $xmatch)) {
463
-							// Links
464
-							$linked_record = GedcomRecord::getInstance($xmatch[1], $fact->getParent()->getTree());
465
-							if ($linked_record) {
466
-								$link = '<a href="' . $linked_record->getHtmlUrl() . '">' . $linked_record->getFullName() . '</a>';
467
-								echo GedcomTag::getLabelValue($fact->getTag() . ':' . $match[1], $link);
468
-							} else {
469
-								echo GedcomTag::getLabelValue($fact->getTag() . ':' . $match[1], Filter::escapeHtml($match[2]));
470
-							}
441
+				echo GedcomTag::getLabelValue('RESN', Filter::escapeHtml($match[2]));
442
+				break;
443
+				}
444
+					break;
445
+			case 'CALN':
446
+				echo GedcomTag::getLabelValue('CALN', Filter::expandUrls($match[2]));
447
+				break;
448
+			case 'FORM': // 0 OBJE / 1 FILE / 2 FORM / 3 TYPE
449
+				echo GedcomTag::getLabelValue('FORM', $match[2]);
450
+				if (preg_match('/\n3 TYPE (.+)/', $fact->getGedcom(), $type_match)) {
451
+					echo GedcomTag::getLabelValue('TYPE', GedcomTag::getFileFormTypeValue($type_match[1]));
452
+				}
453
+				break;
454
+			case 'URL':
455
+			case '_URL':
456
+			case 'WWW':
457
+				$link = '<a href="' . Filter::escapeHtml($match[2]) . '">' . Filter::escapeHtml($match[2]) . '</a>';
458
+				echo GedcomTag::getLabelValue($fact->getTag() . ':' . $match[1], $link);
459
+				break;
460
+			default:
461
+				if (!$fact->getParent()->getTree()->getPreference('HIDE_GEDCOM_ERRORS') || GedcomTag::isTag($match[1])) {
462
+					if (preg_match('/^@(' . WT_REGEX_XREF . ')@$/', $match[2], $xmatch)) {
463
+						// Links
464
+						$linked_record = GedcomRecord::getInstance($xmatch[1], $fact->getParent()->getTree());
465
+						if ($linked_record) {
466
+							$link = '<a href="' . $linked_record->getHtmlUrl() . '">' . $linked_record->getFullName() . '</a>';
467
+							echo GedcomTag::getLabelValue($fact->getTag() . ':' . $match[1], $link);
471 468
 						} else {
472
-							// Non links
473 469
 							echo GedcomTag::getLabelValue($fact->getTag() . ':' . $match[1], Filter::escapeHtml($match[2]));
474 470
 						}
471
+					} else {
472
+						// Non links
473
+						echo GedcomTag::getLabelValue($fact->getTag() . ':' . $match[1], Filter::escapeHtml($match[2]));
475 474
 					}
476
-					break;
475
+				}
476
+				break;
477 477
 			}
478 478
 		}
479 479
 		echo self::printFactSources($fact->getGedcom(), 2);
@@ -815,23 +815,23 @@  discard block
 block discarded – undo
815 815
 						foreach ($rmatches[1] as $rmatch) {
816 816
 							echo '<br><span class="label">', GedcomTag::getLabel('RESN'), ':</span> <span class="field">';
817 817
 							switch ($rmatch) {
818
-								case 'none':
819
-									// Note: "2 RESN none" is not valid gedcom, and the GUI will not let you add it.
820
-									// However, webtrees privacy rules will interpret it as "show an otherwise private fact to public".
821
-									echo '<i class="icon-resn-none"></i> ', I18N::translate('Show to visitors');
822
-									break;
823
-								case 'privacy':
824
-									echo '<i class="icon-resn-privacy"></i> ', I18N::translate('Show to members');
825
-									break;
826
-								case 'confidential':
827
-									echo '<i class="icon-resn-confidential"></i> ', I18N::translate('Show to managers');
828
-									break;
829
-								case 'locked':
830
-									echo '<i class="icon-resn-locked"></i> ', I18N::translate('Only managers can edit');
831
-									break;
832
-								default:
833
-									echo $rmatch;
834
-									break;
818
+							case 'none':
819
+								// Note: "2 RESN none" is not valid gedcom, and the GUI will not let you add it.
820
+								// However, webtrees privacy rules will interpret it as "show an otherwise private fact to public".
821
+								echo '<i class="icon-resn-none"></i> ', I18N::translate('Show to visitors');
822
+								break;
823
+							case 'privacy':
824
+								echo '<i class="icon-resn-privacy"></i> ', I18N::translate('Show to members');
825
+								break;
826
+							case 'confidential':
827
+								echo '<i class="icon-resn-confidential"></i> ', I18N::translate('Show to managers');
828
+								break;
829
+							case 'locked':
830
+								echo '<i class="icon-resn-locked"></i> ', I18N::translate('Only managers can edit');
831
+								break;
832
+							default:
833
+								echo $rmatch;
834
+								break;
835 835
 							}
836 836
 							echo '</span>';
837 837
 						}
@@ -1081,23 +1081,23 @@  discard block
 block discarded – undo
1081 1081
 				foreach ($matches[1] as $match) {
1082 1082
 					echo '<br><span class="label">', GedcomTag::getLabel('RESN'), ':</span> <span class="field">';
1083 1083
 					switch ($match) {
1084
-						case 'none':
1085
-							// Note: "2 RESN none" is not valid gedcom, and the GUI will not let you add it.
1086
-							// However, webtrees privacy rules will interpret it as "show an otherwise private fact to public".
1087
-							echo '<i class="icon-resn-none"></i> ', I18N::translate('Show to visitors');
1088
-							break;
1089
-						case 'privacy':
1090
-							echo '<i class="icon-resn-privacy"></i> ', I18N::translate('Show to members');
1091
-							break;
1092
-						case 'confidential':
1093
-							echo '<i class="icon-resn-confidential"></i> ', I18N::translate('Show to managers');
1094
-							break;
1095
-						case 'locked':
1096
-							echo '<i class="icon-resn-locked"></i> ', I18N::translate('Only managers can edit');
1097
-							break;
1098
-						default:
1099
-							echo $match;
1100
-							break;
1084
+					case 'none':
1085
+						// Note: "2 RESN none" is not valid gedcom, and the GUI will not let you add it.
1086
+						// However, webtrees privacy rules will interpret it as "show an otherwise private fact to public".
1087
+						echo '<i class="icon-resn-none"></i> ', I18N::translate('Show to visitors');
1088
+						break;
1089
+					case 'privacy':
1090
+						echo '<i class="icon-resn-privacy"></i> ', I18N::translate('Show to members');
1091
+						break;
1092
+					case 'confidential':
1093
+						echo '<i class="icon-resn-confidential"></i> ', I18N::translate('Show to managers');
1094
+						break;
1095
+					case 'locked':
1096
+						echo '<i class="icon-resn-locked"></i> ', I18N::translate('Only managers can edit');
1097
+						break;
1098
+					default:
1099
+						echo $match;
1100
+						break;
1101 1101
 					}
1102 1102
 					echo '</span>';
1103 1103
 				}
@@ -1198,12 +1198,12 @@  discard block
 block discarded – undo
1198 1198
 					}
1199 1199
 
1200 1200
 					switch ($media->isPrimary()) {
1201
-						case 'Y':
1202
-							echo GedcomTag::getLabelValue('_PRIM', I18N::translate('yes'));
1203
-							break;
1204
-						case 'N':
1205
-							echo GedcomTag::getLabelValue('_PRIM', I18N::translate('no'));
1206
-							break;
1201
+					case 'Y':
1202
+						echo GedcomTag::getLabelValue('_PRIM', I18N::translate('yes'));
1203
+						break;
1204
+					case 'N':
1205
+						echo GedcomTag::getLabelValue('_PRIM', I18N::translate('no'));
1206
+						break;
1207 1207
 					}
1208 1208
 					echo FunctionsPrint::printFactNotes($media->getGedcom(), 1);
1209 1209
 					echo self::printFactSources($media->getGedcom(), 1);
Please login to merge, or discard this patch.
app/Module/BatchUpdateModule.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -236,12 +236,15 @@  discard block
 block discarded – undo
236 236
 					<?php // Reset - otherwise we might "undo all changes", which refreshes the ?>
237 237
 					<?php // page, which makes them all again!  ?>
238 238
 					<script>reset_reload();</script>
239
-			<?php else: ?>
239
+			<?php else {
240
+	: ?>
240 241
 					<hr>
241 242
 					<div id="batch_update2" class="col-sm-12">
242 243
 						<?php if ($this->curr_xref): ?>
243 244
 							<?php // Create an object, so we can get the latest version of the name. ?>
244
-								<?php $this->record = GedcomRecord::getInstance($this->curr_xref, $WT_TREE); ?>
245
+								<?php $this->record = GedcomRecord::getInstance($this->curr_xref, $WT_TREE);
246
+}
247
+?>
245 248
 							<div class="form-group">
246 249
 								<?php echo self::createSubmitButton(I18N::translate('previous'), $this->prev_xref) ?>
247 250
 					<?php echo self::createSubmitButton(I18N::translate('next'), $this->next_xref) ?>
@@ -253,8 +256,11 @@  discard block
 block discarded – undo
253 256
 							<div class="form-group">
254 257
 							<?php echo implode(' ', $this->PLUGIN->getActionButtons($this->curr_xref, $this->record)); ?>
255 258
 							</div>
256
-						<?php else: ?>
257
-							<div class="alert alert-info"><?php echo I18N::translate('Nothing found.'); ?></div>
259
+						<?php else {
260
+	: ?>
261
+							<div class="alert alert-info"><?php echo I18N::translate('Nothing found.');
262
+}
263
+?></div>
258 264
 					<?php endif; ?>
259 265
 					</div>
260 266
 				<?php endif; ?>
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * webtrees: online genealogy
4
- * Copyright (C) 2015 webtrees development team
5
- * This program is free software: you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation, either version 3 of the License, or
8
- * (at your option) any later version.
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- * You should have received a copy of the GNU General Public License
14
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
15
- */
3
+							 * webtrees: online genealogy
4
+							 * Copyright (C) 2015 webtrees development team
5
+							 * This program is free software: you can redistribute it and/or modify
6
+							 * it under the terms of the GNU General Public License as published by
7
+							 * the Free Software Foundation, either version 3 of the License, or
8
+							 * (at your option) any later version.
9
+							 * This program is distributed in the hope that it will be useful,
10
+							 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+							 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+							 * GNU General Public License for more details.
13
+							 * You should have received a copy of the GNU General Public License
14
+							 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15
+							 */
16 16
 namespace Fisharebest\Webtrees;
17 17
 
18 18
 use Fisharebest\Webtrees\Controller\PageController;
Please login to merge, or discard this patch.