Completed
Push — develop ( 046500...e6f6e1 )
by Greg
17:00 queued 04:46
created
app/Controller/LifespanController.php 1 patch
Switch Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -506,23 +506,23 @@
 block discarded – undo
506 506
 	 */
507 507
 	public function getCalendarDate($date) {
508 508
 		switch ($this->calendar) {
509
-			case 'julian':
510
-				$caldate = new JulianDate($date);
511
-				break;
512
-			case 'french':
513
-				$caldate = new FrenchDate($date);
514
-				break;
515
-			case 'jewish':
516
-				$caldate = new JewishDate($date);
517
-				break;
518
-			case 'hijri':
519
-				$caldate = new HijriDate($date);
520
-				break;
521
-			case 'jalali':
522
-				$caldate = new JalaliDate($date);
523
-				break;
524
-			default:
525
-				$caldate = new GregorianDate($date);
509
+		case 'julian':
510
+			$caldate = new JulianDate($date);
511
+			break;
512
+		case 'french':
513
+			$caldate = new FrenchDate($date);
514
+			break;
515
+		case 'jewish':
516
+			$caldate = new JewishDate($date);
517
+			break;
518
+		case 'hijri':
519
+			$caldate = new HijriDate($date);
520
+			break;
521
+		case 'jalali':
522
+			$caldate = new JalaliDate($date);
523
+			break;
524
+		default:
525
+			$caldate = new GregorianDate($date);
526 526
 		}
527 527
 
528 528
 		return $caldate;
Please login to merge, or discard this patch.
app/Controller/PedigreeController.php 1 patch
Switch Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -102,26 +102,26 @@  discard block
 block discarded – undo
102 102
 
103 103
 		$this->arrows = new \stdClass();
104 104
 		switch ($this->orientation) {
105
-			case self::PORTRAIT:
106
-				//drop through
107
-			case self::LANDSCAPE:
108
-				$this->arrows->prevGen = I18N::direction() === 'rtl' ? 'icon-larrow' : 'icon-rarrow';
109
-				$this->arrows->menu    = I18N::direction() === 'rtl' ? 'icon-rarrow' : 'icon-larrow';
110
-				$addoffset['x']        = $this->chartHasAncestors ? self::ARROW_SIZE : 0;
111
-				$addoffset['y']        = 0;
112
-				break;
113
-			case self::OLDEST_AT_TOP:
114
-				$this->arrows->prevGen = 'icon-uarrow';
115
-				$this->arrows->menu    = 'icon-darrow';
116
-				$addoffset['x']        = 0;
117
-				$addoffset['y']        = $this->root->getSpouseFamilies() ? self::ARROW_SIZE : 0;
118
-				break;
119
-			case self::OLDEST_AT_BOTTOM:
120
-				$this->arrows->prevGen = 'icon-darrow';
121
-				$this->arrows->menu    = 'icon-uarrow';
122
-				$addoffset['x']        = 0;
123
-				$addoffset['y']        = $this->chartHasAncestors ? self::ARROW_SIZE : 0;
124
-				break;
105
+		case self::PORTRAIT:
106
+			//drop through
107
+		case self::LANDSCAPE:
108
+			$this->arrows->prevGen = I18N::direction() === 'rtl' ? 'icon-larrow' : 'icon-rarrow';
109
+			$this->arrows->menu    = I18N::direction() === 'rtl' ? 'icon-rarrow' : 'icon-larrow';
110
+			$addoffset['x']        = $this->chartHasAncestors ? self::ARROW_SIZE : 0;
111
+			$addoffset['y']        = 0;
112
+			break;
113
+		case self::OLDEST_AT_TOP:
114
+			$this->arrows->prevGen = 'icon-uarrow';
115
+			$this->arrows->menu    = 'icon-darrow';
116
+			$addoffset['x']        = 0;
117
+			$addoffset['y']        = $this->root->getSpouseFamilies() ? self::ARROW_SIZE : 0;
118
+			break;
119
+		case self::OLDEST_AT_BOTTOM:
120
+			$this->arrows->prevGen = 'icon-darrow';
121
+			$this->arrows->menu    = 'icon-uarrow';
122
+			$addoffset['x']        = 0;
123
+			$addoffset['y']        = $this->chartHasAncestors ? self::ARROW_SIZE : 0;
124
+			break;
125 125
 		}
126 126
 
127 127
 		// -- this next section will create and position the DIV layers for the pedigree tree
@@ -150,73 +150,73 @@  discard block
 block discarded – undo
150 150
 
151 151
 			// -- calculate the xoffset
152 152
 			switch ($this->orientation) {
153
-				case self::PORTRAIT:
154
-					$xoffset = ($this->generations - $curgen) * (($this->getBoxDimensions()->width + $bxspacing) / 1.8);
155
-					if(!$i && $this->root->getSpouseFamilies()) {
156
-						$xoffset -= self::ARROW_SIZE;
153
+			case self::PORTRAIT:
154
+				$xoffset = ($this->generations - $curgen) * (($this->getBoxDimensions()->width + $bxspacing) / 1.8);
155
+				if(!$i && $this->root->getSpouseFamilies()) {
156
+					$xoffset -= self::ARROW_SIZE;
157
+				}
158
+				// -- compact the tree
159
+				if ($curgen < $this->generations) {
160
+					if ($i % 2 == 0) {
161
+						$yoffset = $yoffset - (($boxspacing / 2) * ($curgen - 1));
162
+					} else {
163
+						$yoffset = $yoffset + (($boxspacing / 2) * ($curgen - 1));
157 164
 					}
158
-					// -- compact the tree
159
-					if ($curgen < $this->generations) {
160
-						if ($i % 2 == 0) {
161
-							$yoffset = $yoffset - (($boxspacing / 2) * ($curgen - 1));
165
+					$parent = (int) (($i - 1) / 2);
166
+					$pgen   = $curgen;
167
+					while ($parent > 0) {
168
+						if ($parent % 2 == 0) {
169
+							$yoffset = $yoffset - (($boxspacing / 2) * $pgen);
162 170
 						} else {
163
-							$yoffset = $yoffset + (($boxspacing / 2) * ($curgen - 1));
164
-						}
165
-						$parent = (int) (($i - 1) / 2);
166
-						$pgen   = $curgen;
167
-						while ($parent > 0) {
168
-							if ($parent % 2 == 0) {
169
-								$yoffset = $yoffset - (($boxspacing / 2) * $pgen);
170
-							} else {
171
-								$yoffset = $yoffset + (($boxspacing / 2) * $pgen);
172
-							}
173
-							$pgen++;
174
-							if ($pgen > 3) {
175
-								$temp = 0;
176
-								for ($j = 1; $j < ($pgen - 2); $j++) {
177
-									$temp += (pow(2, $j) - 1);
178
-								}
179
-								if ($parent % 2 == 0) {
180
-									$yoffset = $yoffset - (($boxspacing / 2) * $temp);
181
-								} else {
182
-									$yoffset = $yoffset + (($boxspacing / 2) * $temp);
183
-								}
184
-							}
185
-							$parent = (int) (($parent - 1) / 2);
171
+							$yoffset = $yoffset + (($boxspacing / 2) * $pgen);
186 172
 						}
187
-						if ($curgen > 3) {
173
+						$pgen++;
174
+						if ($pgen > 3) {
188 175
 							$temp = 0;
189
-							for ($j = 1; $j < ($curgen - 2); $j++) {
176
+							for ($j = 1; $j < ($pgen - 2); $j++) {
190 177
 								$temp += (pow(2, $j) - 1);
191 178
 							}
192
-							if ($i % 2 == 0) {
179
+							if ($parent % 2 == 0) {
193 180
 								$yoffset = $yoffset - (($boxspacing / 2) * $temp);
194 181
 							} else {
195 182
 								$yoffset = $yoffset + (($boxspacing / 2) * $temp);
196 183
 							}
197 184
 						}
185
+						$parent = (int) (($parent - 1) / 2);
198 186
 					}
199
-					$yoffset -= (($boxspacing / 2) * pow(2, ($this->generations - 2)) - ($boxspacing / 2));
200
-					break;
201
-				case self::LANDSCAPE:
202
-					$xoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->width + $bxspacing);
203
-					if ($curgen == 1) {
204
-						$xoffset += 10;
205
-					}
206
-					break;
207
-				case self::OLDEST_AT_TOP:
208
-					//swap x & y offsets as chart is rotated
209
-					$xoffset = $yoffset;
210
-					$yoffset = $curgen  * ($this->getBoxDimensions()->height + ($byspacing * 4));
211
-					break;
212
-				case self::OLDEST_AT_BOTTOM:
213
-					//swap x & y offsets as chart is rotated
214
-					$xoffset = $yoffset;
215
-					$yoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->height + ($byspacing * 2));
216
-					if ($i && $this->root->getSpouseFamilies()) {
217
-						$yoffset += self::ARROW_SIZE;
187
+					if ($curgen > 3) {
188
+						$temp = 0;
189
+						for ($j = 1; $j < ($curgen - 2); $j++) {
190
+							$temp += (pow(2, $j) - 1);
191
+						}
192
+						if ($i % 2 == 0) {
193
+							$yoffset = $yoffset - (($boxspacing / 2) * $temp);
194
+						} else {
195
+							$yoffset = $yoffset + (($boxspacing / 2) * $temp);
196
+						}
218 197
 					}
219
-					break;
198
+				}
199
+				$yoffset -= (($boxspacing / 2) * pow(2, ($this->generations - 2)) - ($boxspacing / 2));
200
+				break;
201
+			case self::LANDSCAPE:
202
+				$xoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->width + $bxspacing);
203
+				if ($curgen == 1) {
204
+					$xoffset += 10;
205
+				}
206
+				break;
207
+			case self::OLDEST_AT_TOP:
208
+				//swap x & y offsets as chart is rotated
209
+				$xoffset = $yoffset;
210
+				$yoffset = $curgen  * ($this->getBoxDimensions()->height + ($byspacing * 4));
211
+				break;
212
+			case self::OLDEST_AT_BOTTOM:
213
+				//swap x & y offsets as chart is rotated
214
+				$xoffset = $yoffset;
215
+				$yoffset = ($this->generations - $curgen) * ($this->getBoxDimensions()->height + ($byspacing * 2));
216
+				if ($i && $this->root->getSpouseFamilies()) {
217
+					$yoffset += self::ARROW_SIZE;
218
+				}
219
+				break;
220 220
 			}
221 221
 			$this->nodes[$i]["x"] = (int) $xoffset;
222 222
 			$this->nodes[$i]["y"] = (int) $yoffset;
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/FunctionsDate.php 1 patch
Switch Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -32,32 +32,32 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	public static function getAgeAtEvent($age_string, $show_years) {
34 34
 		switch (strtoupper($age_string)) {
35
-			case 'CHILD':
36
-				return I18N::translate('Child');
37
-			case 'INFANT':
38
-				return I18N::translate('Infant');
39
-			case 'STILLBORN':
40
-				return I18N::translate('Stillborn');
41
-			default:
42
-				return preg_replace_callback(
43
-					array(
44
-						'/(\d+)([ymwd])/',
45
-					),
46
-					function ($match) use ($age_string, $show_years) {
47
-						switch ($match[2]) {
48
-							case 'y':
49
-								if ($show_years || preg_match('/[dm]/', $age_string)) {
50
-									return I18N::plural('%s year', '%s years', $match[1], I18N::digits($match[1]));
51
-								} else {
52
-									return I18N::digits($match[1]);
53
-								}
54
-							case 'm':
55
-								return I18N::plural('%s month', '%s months', $match[1], I18N::digits($match[1]));
56
-							case 'w':
57
-								return I18N::plural('%s week', '%s weeks', $match[1], I18N::digits($match[1]));
58
-							case 'd':
59
-								return I18N::plural('%s day', '%s days', $match[1], I18N::digits($match[1]));
60
-						}
35
+		case 'CHILD':
36
+			return I18N::translate('Child');
37
+		case 'INFANT':
38
+			return I18N::translate('Infant');
39
+		case 'STILLBORN':
40
+			return I18N::translate('Stillborn');
41
+		default:
42
+			return preg_replace_callback(
43
+				array(
44
+					'/(\d+)([ymwd])/',
45
+				),
46
+				function ($match) use ($age_string, $show_years) {
47
+					switch ($match[2]) {
48
+					case 'y':
49
+					if ($show_years || preg_match('/[dm]/', $age_string)) {
50
+					return I18N::plural('%s year', '%s years', $match[1], I18N::digits($match[1]));
51
+					} else {
52
+					return I18N::digits($match[1]);
53
+					}
54
+					case 'm':
55
+					return I18N::plural('%s month', '%s months', $match[1], I18N::digits($match[1]));
56
+					case 'w':
57
+					return I18N::plural('%s week', '%s weeks', $match[1], I18N::digits($match[1]));
58
+					case 'd':
59
+					return I18N::plural('%s day', '%s days', $match[1], I18N::digits($match[1]));
60
+					}
61 61
 					},
62 62
 					$age_string
63 63
 				);
@@ -79,40 +79,40 @@  discard block
 block discarded – undo
79 79
 		preg_match_all('/%[^%]/', $time_fmt, $matches);
80 80
 		foreach ($matches[0] as $match) {
81 81
 			switch ($match) {
82
-				case '%a':
83
-					$t = gmdate('His', $time);
84
-					if ($t == '000000') {
85
-						$time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 00:00:00 */
86
-							I18N::translate('midnight'), $time_fmt);
87
-					} elseif ($t < '120000') {
88
-						$time_fmt = str_replace($match, /* I18N: time format “%a” - between 00:00:01 and 11:59:59 */
89
-							I18N::translate('a.m.'), $time_fmt);
90
-					} elseif ($t == '120000') {
91
-						$time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 12:00:00 */
92
-							I18N::translate('noon'), $time_fmt);
93
-					} else {
94
-						$time_fmt = str_replace($match, /* I18N: time format “%a” - between 12:00:01 and 23:59:59 */
95
-							I18N::translate('p.m.'), $time_fmt);
96
-					}
97
-					break;
98
-				case '%A':
99
-					$t = gmdate('His', $time);
100
-					if ($t == '000000') {
101
-						$time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 00:00:00 */
102
-							I18N::translate('Midnight'), $time_fmt);
103
-					} elseif ($t < '120000') {
104
-						$time_fmt = str_replace($match, /* I18N: time format “%A” - between 00:00:01 and 11:59:59 */
105
-							I18N::translate('A.M.'), $time_fmt);
106
-					} elseif ($t == '120000') {
107
-						$time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 12:00:00 */
108
-							I18N::translate('Noon'), $time_fmt);
109
-					} else {
110
-						$time_fmt = str_replace($match, /* I18N: time format “%A” - between 12:00:01 and 23:59:59 */
111
-							I18N::translate('P.M.'), $time_fmt);
112
-					}
113
-					break;
114
-				default:
115
-					$time_fmt = str_replace($match, I18N::digits(gmdate(substr($match, -1), $time)), $time_fmt);
82
+			case '%a':
83
+				$t = gmdate('His', $time);
84
+				if ($t == '000000') {
85
+					$time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 00:00:00 */
86
+						I18N::translate('midnight'), $time_fmt);
87
+				} elseif ($t < '120000') {
88
+					$time_fmt = str_replace($match, /* I18N: time format “%a” - between 00:00:01 and 11:59:59 */
89
+						I18N::translate('a.m.'), $time_fmt);
90
+				} elseif ($t == '120000') {
91
+					$time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 12:00:00 */
92
+						I18N::translate('noon'), $time_fmt);
93
+				} else {
94
+					$time_fmt = str_replace($match, /* I18N: time format “%a” - between 12:00:01 and 23:59:59 */
95
+						I18N::translate('p.m.'), $time_fmt);
96
+				}
97
+				break;
98
+			case '%A':
99
+				$t = gmdate('His', $time);
100
+				if ($t == '000000') {
101
+					$time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 00:00:00 */
102
+						I18N::translate('Midnight'), $time_fmt);
103
+				} elseif ($t < '120000') {
104
+					$time_fmt = str_replace($match, /* I18N: time format “%A” - between 00:00:01 and 11:59:59 */
105
+						I18N::translate('A.M.'), $time_fmt);
106
+				} elseif ($t == '120000') {
107
+					$time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 12:00:00 */
108
+						I18N::translate('Noon'), $time_fmt);
109
+				} else {
110
+					$time_fmt = str_replace($match, /* I18N: time format “%A” - between 12:00:01 and 23:59:59 */
111
+						I18N::translate('P.M.'), $time_fmt);
112
+				}
113
+				break;
114
+			default:
115
+				$time_fmt = str_replace($match, I18N::digits(gmdate(substr($match, -1), $time)), $time_fmt);
116 116
 			}
117 117
 		}
118 118
 
Please login to merge, or discard this patch.
app/Functions/FunctionsDb.php 1 patch
Switch Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -248,18 +248,18 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	public static function searchIndividualsPhonetic($soundex, $lastname, $firstname, $place, array $trees) {
250 250
 		switch ($soundex) {
251
-			case 'Russell':
252
-				$givn_sdx = Soundex::russell($firstname);
253
-				$surn_sdx = Soundex::russell($lastname);
254
-				$plac_sdx = Soundex::russell($place);
255
-				break;
256
-			case 'DaitchM':
257
-				$givn_sdx = Soundex::daitchMokotoff($firstname);
258
-				$surn_sdx = Soundex::daitchMokotoff($lastname);
259
-				$plac_sdx = Soundex::daitchMokotoff($place);
260
-				break;
261
-			default:
262
-				throw new \DomainException('soundex: ' . $soundex);
251
+		case 'Russell':
252
+			$givn_sdx = Soundex::russell($firstname);
253
+			$surn_sdx = Soundex::russell($lastname);
254
+			$plac_sdx = Soundex::russell($place);
255
+			break;
256
+		case 'DaitchM':
257
+			$givn_sdx = Soundex::daitchMokotoff($firstname);
258
+			$surn_sdx = Soundex::daitchMokotoff($lastname);
259
+			$plac_sdx = Soundex::daitchMokotoff($place);
260
+			break;
261
+		default:
262
+			throw new \DomainException('soundex: ' . $soundex);
263 263
 		}
264 264
 
265 265
 		// Nothing to search for?  Return nothing.
@@ -291,12 +291,12 @@  discard block
 block discarded – undo
291 291
 			foreach ($givn_sdx as $n => $sdx) {
292 292
 				$sql .= $n ? " OR " : "";
293 293
 				switch ($soundex) {
294
-					case 'Russell':
295
-						$sql .= "n_soundex_givn_std LIKE CONCAT('%', :given_name_" . $n . ", '%')";
296
-						break;
297
-					case 'DaitchM':
298
-						$sql .= "n_soundex_givn_dm LIKE CONCAT('%', :given_name_" . $n . ", '%')";
299
-						break;
294
+				case 'Russell':
295
+					$sql .= "n_soundex_givn_std LIKE CONCAT('%', :given_name_" . $n . ", '%')";
296
+					break;
297
+				case 'DaitchM':
298
+					$sql .= "n_soundex_givn_dm LIKE CONCAT('%', :given_name_" . $n . ", '%')";
299
+					break;
300 300
 				}
301 301
 				$args['given_name_' . $n] = $sdx;
302 302
 			}
@@ -309,12 +309,12 @@  discard block
 block discarded – undo
309 309
 			foreach ($surn_sdx as $n => $sdx) {
310 310
 				$sql .= $n ? " OR " : "";
311 311
 				switch ($soundex) {
312
-					case 'Russell':
313
-						$sql .= "n_soundex_surn_std LIKE CONCAT('%', :surname_" . $n . ", '%')";
314
-						break;
315
-					case 'DaitchM':
316
-						$sql .= "n_soundex_surn_dm LIKE CONCAT('%', :surname_" . $n . ", '%')";
317
-						break;
312
+				case 'Russell':
313
+					$sql .= "n_soundex_surn_std LIKE CONCAT('%', :surname_" . $n . ", '%')";
314
+					break;
315
+				case 'DaitchM':
316
+					$sql .= "n_soundex_surn_dm LIKE CONCAT('%', :surname_" . $n . ", '%')";
317
+					break;
318 318
 				}
319 319
 				$args['surname_' . $n] = $sdx;
320 320
 			}
@@ -327,12 +327,12 @@  discard block
 block discarded – undo
327 327
 			foreach ($plac_sdx as $n => $sdx) {
328 328
 				$sql .= $n ? " OR " : "";
329 329
 				switch ($soundex) {
330
-					case 'Russell':
331
-						$sql .= "p_std_soundex LIKE CONCAT('%', :place_" . $n . ", '%')";
332
-						break;
333
-					case 'DaitchM':
334
-						$sql .= "p_dm_soundex LIKE CONCAT('%', :place_" . $n . ", '%')";
335
-						break;
330
+				case 'Russell':
331
+					$sql .= "p_std_soundex LIKE CONCAT('%', :place_" . $n . ", '%')";
332
+					break;
333
+				case 'DaitchM':
334
+					$sql .= "p_dm_soundex LIKE CONCAT('%', :place_" . $n . ", '%')";
335
+					break;
336 336
 				}
337 337
 				$args['place_' . $n] = $sdx;
338 338
 			}
@@ -790,82 +790,82 @@  discard block
 block discarded – undo
790 790
 			} else {
791 791
 				// SPECIAL CASES:
792 792
 				switch ($anniv->m) {
793
-					case 2:
794
-						// 29 CSH does not include 30 CSH (but would include an invalid 31 CSH if there were no 30 CSH)
795
-						if ($anniv->d === 1) {
796
-							$where .= " AND d_day <= 1 AND d_mon = 2";
797
-						} elseif ($anniv->d === 30) {
798
-							$where .= " AND d_day >= 30 AND d_mon = 2";
799
-						} elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) {
800
-							$where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2";
801
-						} else {
802
-							$where .= " AND d_day = :day AND d_mon = 2";
803
-							$args['day'] = $anniv->d;
804
-						}
805
-						break;
806
-					case 3:
807
-						// 1 KSL includes 30 CSH (if this year didn’t have 30 CSH)
808
-						// 29 KSL does not include 30 KSL (but would include an invalid 31 KSL if there were no 30 KSL)
809
-						if ($anniv->d === 1) {
810
-							$tmp = new JewishDate(array($anniv->y, 'CSH', 1));
811
-							if ($tmp->daysInMonth() === 29) {
812
-								$where .= " AND (d_day <= 1 AND d_mon = 3 OR d_day = 30 AND d_mon = 2)";
813
-							} else {
814
-								$where .= " AND d_day <= 1 AND d_mon = 3";
815
-							}
816
-						} elseif ($anniv->d === 30) {
817
-							$where .= " AND d_day >= 30 AND d_mon = 3";
818
-						} elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) {
819
-							$where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3";
820
-						} else {
821
-							$where .= " AND d_day = :day AND d_mon = 3";
822
-							$args['day'] = $anniv->d;
823
-						}
824
-						break;
825
-					case 4:
826
-						// 1 TVT includes 30 KSL (if this year didn’t have 30 KSL)
827
-						if ($anniv->d === 1) {
828
-							$tmp = new JewishDate(array($anniv->y, 'KSL', 1));
829
-							if ($tmp->daysInMonth() === 29) {
830
-								$where .= " AND (d_day <=1 AND d_mon = 4 OR d_day = 30 AND d_mon = 3)";
831
-							} else {
832
-								$where .= " AND d_day <= 1 AND d_mon = 4";
833
-							}
834
-						} elseif ($anniv->d === $anniv->daysInMonth()) {
835
-							$where .= " AND d_day >= :day AND d_mon=4";
836
-							$args['day'] = $anniv->d;
793
+				case 2:
794
+					// 29 CSH does not include 30 CSH (but would include an invalid 31 CSH if there were no 30 CSH)
795
+					if ($anniv->d === 1) {
796
+						$where .= " AND d_day <= 1 AND d_mon = 2";
797
+					} elseif ($anniv->d === 30) {
798
+						$where .= " AND d_day >= 30 AND d_mon = 2";
799
+					} elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) {
800
+						$where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2";
801
+					} else {
802
+						$where .= " AND d_day = :day AND d_mon = 2";
803
+						$args['day'] = $anniv->d;
804
+					}
805
+					break;
806
+				case 3:
807
+					// 1 KSL includes 30 CSH (if this year didn’t have 30 CSH)
808
+					// 29 KSL does not include 30 KSL (but would include an invalid 31 KSL if there were no 30 KSL)
809
+					if ($anniv->d === 1) {
810
+						$tmp = new JewishDate(array($anniv->y, 'CSH', 1));
811
+						if ($tmp->daysInMonth() === 29) {
812
+							$where .= " AND (d_day <= 1 AND d_mon = 3 OR d_day = 30 AND d_mon = 2)";
837 813
 						} else {
838
-							$where .= " AND d_day = :day AND d_mon=4";
839
-							$args['day'] = $anniv->d;
814
+							$where .= " AND d_day <= 1 AND d_mon = 3";
840 815
 						}
841
-						break;
842
-					case 7: // ADS includes ADR (non-leap)
843
-						if ($anniv->d === 1) {
844
-							$where .= " AND d_day <= 1";
845
-						} elseif ($anniv->d === $anniv->daysInMonth()) {
846
-							$where .= " AND d_day >= :day";
847
-							$args['day'] = $anniv->d;
816
+					} elseif ($anniv->d === 30) {
817
+						$where .= " AND d_day >= 30 AND d_mon = 3";
818
+					} elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) {
819
+						$where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3";
820
+					} else {
821
+						$where .= " AND d_day = :day AND d_mon = 3";
822
+						$args['day'] = $anniv->d;
823
+					}
824
+					break;
825
+				case 4:
826
+					// 1 TVT includes 30 KSL (if this year didn’t have 30 KSL)
827
+					if ($anniv->d === 1) {
828
+						$tmp = new JewishDate(array($anniv->y, 'KSL', 1));
829
+						if ($tmp->daysInMonth() === 29) {
830
+							$where .= " AND (d_day <=1 AND d_mon = 4 OR d_day = 30 AND d_mon = 3)";
848 831
 						} else {
849
-							$where .= " AND d_day = :day";
850
-							$args['day'] = $anniv->d;
832
+							$where .= " AND d_day <= 1 AND d_mon = 4";
851 833
 						}
852
-						$where .= " AND (d_mon = 6 AND MOD(7 * d_year + 1, 19) >= 7 OR d_mon = 7)";
853
-						break;
854
-					case 8: // 1 NSN includes 30 ADR, if this year is non-leap
855
-						if ($anniv->d === 1) {
856
-							if ($anniv->isLeapYear()) {
857
-								$where .= " AND d_day <= 1 AND d_mon = 8";
858
-							} else {
859
-								$where .= " AND (d_day <= 1 AND d_mon = 8 OR d_day = 30 AND d_mon = 6)";
860
-							}
861
-						} elseif ($anniv->d === $anniv->daysInMonth()) {
862
-							$where .= " AND d_day >= :day AND d_mon = 8";
863
-							$args['day'] = $anniv->d;
834
+					} elseif ($anniv->d === $anniv->daysInMonth()) {
835
+						$where .= " AND d_day >= :day AND d_mon=4";
836
+						$args['day'] = $anniv->d;
837
+					} else {
838
+						$where .= " AND d_day = :day AND d_mon=4";
839
+						$args['day'] = $anniv->d;
840
+					}
841
+					break;
842
+				case 7: // ADS includes ADR (non-leap)
843
+					if ($anniv->d === 1) {
844
+						$where .= " AND d_day <= 1";
845
+					} elseif ($anniv->d === $anniv->daysInMonth()) {
846
+						$where .= " AND d_day >= :day";
847
+						$args['day'] = $anniv->d;
848
+					} else {
849
+						$where .= " AND d_day = :day";
850
+						$args['day'] = $anniv->d;
851
+					}
852
+					$where .= " AND (d_mon = 6 AND MOD(7 * d_year + 1, 19) >= 7 OR d_mon = 7)";
853
+					break;
854
+				case 8: // 1 NSN includes 30 ADR, if this year is non-leap
855
+					if ($anniv->d === 1) {
856
+						if ($anniv->isLeapYear()) {
857
+							$where .= " AND d_day <= 1 AND d_mon = 8";
864 858
 						} else {
865
-							$where .= " AND d_day = :day AND d_mon = 8";
866
-							$args['day'] = $anniv->d;
859
+							$where .= " AND (d_day <= 1 AND d_mon = 8 OR d_day = 30 AND d_mon = 6)";
867 860
 						}
868
-						break;
861
+					} elseif ($anniv->d === $anniv->daysInMonth()) {
862
+						$where .= " AND d_day >= :day AND d_mon = 8";
863
+						$args['day'] = $anniv->d;
864
+					} else {
865
+						$where .= " AND d_day = :day AND d_mon = 8";
866
+						$args['day'] = $anniv->d;
867
+					}
868
+					break;
869 869
 				}
870 870
 			}
871 871
 			// Only events in the past (includes dates without a year)
Please login to merge, or discard this patch.
app/Functions/FunctionsExport.php 1 patch
Switch Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -183,18 +183,18 @@  discard block
 block discarded – undo
183 183
 	 */
184 184
 	public static function exportGedcom(Tree $tree, $gedout, $exportOptions) {
185 185
 		switch ($exportOptions['privatize']) {
186
-			case 'gedadmin':
187
-				$access_level = Auth::PRIV_NONE;
188
-				break;
189
-			case 'user':
190
-				$access_level = Auth::PRIV_USER;
191
-				break;
192
-			case 'visitor':
193
-				$access_level = Auth::PRIV_PRIVATE;
194
-				break;
195
-			case 'none':
196
-				$access_level = Auth::PRIV_HIDE;
197
-				break;
186
+		case 'gedadmin':
187
+			$access_level = Auth::PRIV_NONE;
188
+			break;
189
+		case 'user':
190
+			$access_level = Auth::PRIV_USER;
191
+			break;
192
+		case 'visitor':
193
+			$access_level = Auth::PRIV_PRIVATE;
194
+			break;
195
+		case 'none':
196
+			$access_level = Auth::PRIV_HIDE;
197
+			break;
198 198
 		}
199 199
 
200 200
 		$head = self::gedcomHeader($tree);
@@ -251,15 +251,15 @@  discard block
 block discarded – undo
251 251
 
252 252
 		foreach ($rows as $row) {
253 253
 			switch ($row->type) {
254
-				case 'NOTE':
255
-					$record = Note::getInstance($row->xref, $tree, $row->gedcom);
256
-					break;
257
-				case 'REPO':
258
-					$record = Repository::getInstance($row->xref, $tree, $row->gedcom);
259
-					break;
260
-				default:
261
-					$record = GedcomRecord::getInstance($row->xref, $tree, $row->gedcom);
262
-					break;
254
+			case 'NOTE':
255
+				$record = Note::getInstance($row->xref, $tree, $row->gedcom);
256
+				break;
257
+			case 'REPO':
258
+				$record = Repository::getInstance($row->xref, $tree, $row->gedcom);
259
+				break;
260
+			default:
261
+				$record = GedcomRecord::getInstance($row->xref, $tree, $row->gedcom);
262
+				break;
263 263
 			}
264 264
 
265 265
 			$rec = $record->privatizeGedcom($access_level);
Please login to merge, or discard this patch.
app/Functions/FunctionsImport.php 1 patch
Switch Indentation   +644 added lines, -644 removed lines patch added patch discarded remove patch
@@ -59,477 +59,477 @@  discard block
 block discarded – undo
59 59
 			$tag                               = strtoupper($tag); // Tags should always be upper case
60 60
 			switch ($tag) {
61 61
 				// Convert PhpGedView tags to WT
62
-				case '_PGVU':
63
-					$tag = '_WT_USER';
64
-					break;
65
-				case '_PGV_OBJS':
66
-					$tag = '_WT_OBJE_SORT';
67
-					break;
68
-				// Convert FTM-style "TAG_FORMAL_NAME" into "TAG".
69
-				case 'ABBREVIATION':
70
-					$tag = 'ABBR';
71
-					break;
72
-				case 'ADDRESS':
73
-					$tag = 'ADDR';
74
-					break;
75
-				case 'ADDRESS1':
76
-					$tag = 'ADR1';
77
-					break;
78
-				case 'ADDRESS2':
79
-					$tag = 'ADR2';
80
-					break;
81
-				case 'ADDRESS3':
82
-					$tag = 'ADR3';
83
-					break;
84
-				case 'ADOPTION':
85
-					$tag = 'ADOP';
86
-					break;
87
-				case 'ADULT_CHRISTENING':
88
-					$tag = 'CHRA';
89
-					break;
90
-				case 'AFN':
91
-					// AFN values are upper case
92
-					$data = strtoupper($data);
93
-					break;
94
-				case 'AGENCY':
95
-					$tag = 'AGNC';
96
-					break;
97
-				case 'ALIAS':
98
-					$tag = 'ALIA';
99
-					break;
100
-				case 'ANCESTORS':
101
-					$tag = 'ANCE';
102
-					break;
103
-				case 'ANCES_INTEREST':
104
-					$tag = 'ANCI';
105
-					break;
106
-				case 'ANNULMENT':
107
-					$tag = 'ANUL';
108
-					break;
109
-				case 'ASSOCIATES':
110
-					$tag = 'ASSO';
111
-					break;
112
-				case 'AUTHOR':
113
-					$tag = 'AUTH';
114
-					break;
115
-				case 'BAPTISM':
116
-					$tag = 'BAPM';
117
-					break;
118
-				case 'BAPTISM_LDS':
119
-					$tag = 'BAPL';
120
-					break;
121
-				case 'BAR_MITZVAH':
122
-					$tag = 'BARM';
123
-					break;
124
-				case 'BAS_MITZVAH':
125
-					$tag = 'BASM';
126
-					break;
127
-				case 'BIRTH':
128
-					$tag = 'BIRT';
129
-					break;
130
-				case 'BLESSING':
131
-					$tag = 'BLES';
132
-					break;
133
-				case 'BURIAL':
134
-					$tag = 'BURI';
135
-					break;
136
-				case 'CALL_NUMBER':
137
-					$tag = 'CALN';
138
-					break;
139
-				case 'CASTE':
140
-					$tag = 'CAST';
141
-					break;
142
-				case 'CAUSE':
143
-					$tag = 'CAUS';
144
-					break;
145
-				case 'CENSUS':
146
-					$tag = 'CENS';
147
-					break;
148
-				case 'CHANGE':
149
-					$tag = 'CHAN';
150
-					break;
151
-				case 'CHARACTER':
152
-					$tag = 'CHAR';
153
-					break;
154
-				case 'CHILD':
155
-					$tag = 'CHIL';
156
-					break;
157
-				case 'CHILDREN_COUNT':
158
-					$tag = 'NCHI';
159
-					break;
160
-				case 'CHRISTENING':
161
-					$tag = 'CHR';
162
-					break;
163
-				case 'CONCATENATION':
164
-					$tag = 'CONC';
165
-					break;
166
-				case 'CONFIRMATION':
167
-					$tag = 'CONF';
168
-					break;
169
-				case 'CONFIRMATION_LDS':
170
-					$tag = 'CONL';
171
-					break;
172
-				case 'CONTINUED':
173
-					$tag = 'CONT';
174
-					break;
175
-				case 'COPYRIGHT':
176
-					$tag = 'COPR';
177
-					break;
178
-				case 'CORPORATE':
179
-					$tag = 'CORP';
180
-					break;
181
-				case 'COUNTRY':
182
-					$tag = 'CTRY';
183
-					break;
184
-				case 'CREMATION':
185
-					$tag = 'CREM';
186
-					break;
187
-				case 'DATE':
188
-					// Preserve text from INT dates
189
-					if (strpos($data, '(') !== false) {
190
-						list($date, $text) = explode('(', $data, 2);
191
-						$text              = ' (' . $text;
192
-					} else {
193
-						$date = $data;
194
-						$text = '';
195
-					}
196
-					// Capitals
197
-					$date = strtoupper($date);
198
-					// Temporarily add leading/trailing spaces, to allow efficient matching below
199
-					$date = " {$date} ";
200
-					// Ensure space digits and letters
201
-					$date = preg_replace('/([A-Z])(\d)/', '$1 $2', $date);
202
-					$date = preg_replace('/(\d)([A-Z])/', '$1 $2', $date);
203
-					// Ensure space before/after calendar escapes
204
-					$date = preg_replace('/@#[^@]+@/', ' $0 ', $date);
205
-					// "BET." => "BET"
206
-					$date = preg_replace('/(\w\w)\./', '$1', $date);
207
-					// "CIR" => "ABT"
208
-					$date = str_replace(' CIR ', ' ABT ', $date);
209
-					$date = str_replace(' APX ', ' ABT ', $date);
210
-					// B.C. => BC (temporarily, to allow easier handling of ".")
211
-					$date = str_replace(' B.C. ', ' BC ', $date);
212
-					// "BET X - Y " => "BET X AND Y"
213
-					$date = preg_replace('/^(.* BET .+) - (.+)/', '$1 AND $2', $date);
214
-					$date = preg_replace('/^(.* FROM .+) - (.+)/', '$1 TO $2', $date);
215
-					// "@#ESC@ FROM X TO Y" => "FROM @#ESC@ X TO @#ESC@ Y"
216
-					$date = preg_replace('/^ +(@#[^@]+@) +FROM +(.+) +TO +(.+)/', ' FROM $1 $2 TO $1 $3', $date);
217
-					$date = preg_replace('/^ +(@#[^@]+@) +BET +(.+) +AND +(.+)/', ' BET $1 $2 AND $1 $3', $date);
218
-					// "@#ESC@ AFT X" => "AFT @#ESC@ X"
219
-					$date = preg_replace('/^ +(@#[^@]+@) +(FROM|BET|TO|AND|BEF|AFT|CAL|EST|INT|ABT) +(.+)/', ' $2 $1 $3', $date);
220
-					// Ignore any remaining punctuation, e.g. "14-MAY, 1900" => "14 MAY 1900"
221
-					// (don't change "/" - it is used in NS/OS dates)
222
-					$date = preg_replace('/[.,:;-]/', ' ', $date);
223
-					// BC => B.C.
224
-					$date = str_replace(' BC ', ' B.C. ', $date);
225
-					// Append the "INT" text
226
-					$data = $date . $text;
227
-					break;
228
-				case 'DEATH':
229
-					$tag = 'DEAT';
230
-					break;
231
-				case '_DEATH_OF_SPOUSE':
232
-					$tag = '_DETS';
233
-					break;
234
-				case '_DEGREE':
235
-					$tag = '_DEG';
236
-					break;
237
-				case 'DESCENDANTS':
238
-					$tag = 'DESC';
239
-					break;
240
-				case 'DESCENDANT_INT':
241
-					$tag = 'DESI';
242
-					break;
243
-				case 'DESTINATION':
244
-					$tag = 'DEST';
245
-					break;
246
-				case 'DIVORCE':
247
-					$tag = 'DIV';
248
-					break;
249
-				case 'DIVORCE_FILED':
250
-					$tag = 'DIVF';
251
-					break;
252
-				case 'EDUCATION':
253
-					$tag = 'EDUC';
254
-					break;
255
-				case 'EMIGRATION':
256
-					$tag = 'EMIG';
257
-					break;
258
-				case 'ENDOWMENT':
259
-					$tag = 'ENDL';
260
-					break;
261
-				case 'ENGAGEMENT':
262
-					$tag = 'ENGA';
263
-					break;
264
-				case 'EVENT':
265
-					$tag = 'EVEN';
266
-					break;
267
-				case 'FACSIMILE':
268
-					$tag = 'FAX';
269
-					break;
270
-				case 'FAMILY':
271
-					$tag = 'FAM';
272
-					break;
273
-				case 'FAMILY_CHILD':
274
-					$tag = 'FAMC';
275
-					break;
276
-				case 'FAMILY_FILE':
277
-					$tag = 'FAMF';
278
-					break;
279
-				case 'FAMILY_SPOUSE':
280
-					$tag = 'FAMS';
281
-					break;
282
-				case 'FIRST_COMMUNION':
283
-					$tag = 'FCOM';
284
-					break;
285
-				case '_FILE':
286
-					$tag = 'FILE';
287
-					break;
288
-				case 'FORMAT':
289
-					$tag = 'FORM';
290
-				case 'FORM':
291
-					// Consistent commas
292
-					$data = preg_replace('/ *, */', ', ', $data);
293
-					break;
294
-				case 'GEDCOM':
295
-					$tag = 'GEDC';
296
-					break;
297
-				case 'GIVEN_NAME':
298
-					$tag = 'GIVN';
299
-					break;
300
-				case 'GRADUATION':
301
-					$tag = 'GRAD';
302
-					break;
303
-				case 'HEADER':
304
-					$tag = 'HEAD';
305
-				case 'HEAD':
306
-					// HEAD records don't have an XREF or DATA
307
-					if ($level == '0') {
308
-						$xref = '';
309
-						$data = '';
310
-					}
311
-					break;
312
-				case 'HUSBAND':
313
-					$tag = 'HUSB';
314
-					break;
315
-				case 'IDENT_NUMBER':
316
-					$tag = 'IDNO';
317
-					break;
318
-				case 'IMMIGRATION':
319
-					$tag = 'IMMI';
320
-					break;
321
-				case 'INDIVIDUAL':
322
-					$tag = 'INDI';
323
-					break;
324
-				case 'LANGUAGE':
325
-					$tag = 'LANG';
326
-					break;
327
-				case 'LATITUDE':
328
-					$tag = 'LATI';
329
-					break;
330
-				case 'LONGITUDE':
331
-					$tag = 'LONG';
332
-					break;
333
-				case 'MARRIAGE':
334
-					$tag = 'MARR';
335
-					break;
336
-				case 'MARRIAGE_BANN':
337
-					$tag = 'MARB';
338
-					break;
339
-				case 'MARRIAGE_COUNT':
340
-					$tag = 'NMR';
341
-					break;
342
-				case 'MARRIAGE_CONTRACT':
343
-					$tag = 'MARC';
344
-					break;
345
-				case 'MARRIAGE_LICENSE':
346
-					$tag = 'MARL';
347
-					break;
348
-				case 'MARRIAGE_SETTLEMENT':
349
-					$tag = 'MARS';
350
-					break;
351
-				case 'MEDIA':
352
-					$tag = 'MEDI';
353
-					break;
354
-				case '_MEDICAL':
355
-					$tag = '_MDCL';
356
-					break;
357
-				case '_MILITARY_SERVICE':
358
-					$tag = '_MILT';
359
-					break;
360
-				case 'NAME':
361
-					// Tidy up whitespace
362
-					$data = preg_replace('/  +/', ' ', trim($data));
363
-					break;
364
-				case 'NAME_PREFIX':
365
-					$tag = 'NPFX';
366
-					break;
367
-				case 'NAME_SUFFIX':
368
-					$tag = 'NSFX';
369
-					break;
370
-				case 'NATIONALITY':
371
-					$tag = 'NATI';
372
-					break;
373
-				case 'NATURALIZATION':
374
-					$tag = 'NATU';
375
-					break;
376
-				case 'NICKNAME':
377
-					$tag = 'NICK';
378
-					break;
379
-				case 'OBJECT':
380
-					$tag = 'OBJE';
381
-					break;
382
-				case 'OCCUPATION':
383
-					$tag = 'OCCU';
384
-					break;
385
-				case 'ORDINANCE':
386
-					$tag = 'ORDI';
387
-					break;
388
-				case 'ORDINATION':
389
-					$tag = 'ORDN';
390
-					break;
391
-				case 'PEDIGREE':
392
-					$tag = 'PEDI';
393
-				case 'PEDI':
394
-					// PEDI values are lower case
395
-					$data = strtolower($data);
396
-					break;
397
-				case 'PHONE':
398
-					$tag = 'PHON';
399
-					break;
400
-				case 'PHONETIC':
401
-					$tag = 'FONE';
402
-					break;
403
-				case 'PHY_DESCRIPTION':
404
-					$tag = 'DSCR';
405
-					break;
406
-				case 'PLACE':
407
-					$tag = 'PLAC';
408
-				case 'PLAC':
409
-					// Consistent commas
410
-					$data = preg_replace('/ *(،|,) */', ', ', $data);
411
-					// The Master Genealogist stores LAT/LONG data in the PLAC field, e.g. Pennsylvania, USA, 395945N0751013W
412
-					if (preg_match('/(.*), (\d\d)(\d\d)(\d\d)([NS])(\d\d\d)(\d\d)(\d\d)([EW])$/', $data, $match)) {
413
-						$data =
414
-							$match[1] . "\n" .
415
-							($level + 1) . " MAP\n" .
416
-							($level + 2) . " LATI " . ($match[5] . (round($match[2] + ($match[3] / 60) + ($match[4] / 3600), 4))) . "\n" .
417
-							($level + 2) . " LONG " . ($match[9] . (round($match[6] + ($match[7] / 60) + ($match[8] / 3600), 4)));
418
-					}
419
-					break;
420
-				case 'POSTAL_CODE':
421
-					$tag = 'POST';
422
-					break;
423
-				case 'PROBATE':
424
-					$tag = 'PROB';
425
-					break;
426
-				case 'PROPERTY':
427
-					$tag = 'PROP';
428
-					break;
429
-				case 'PUBLICATION':
430
-					$tag = 'PUBL';
431
-					break;
432
-				case 'QUALITY_OF_DATA':
433
-					$tag = 'QUAL';
434
-					break;
435
-				case 'REC_FILE_NUMBER':
436
-					$tag = 'RFN';
437
-					break;
438
-				case 'REC_ID_NUMBER':
439
-					$tag = 'RIN';
440
-					break;
441
-				case 'REFERENCE':
442
-					$tag = 'REFN';
443
-					break;
444
-				case 'RELATIONSHIP':
445
-					$tag = 'RELA';
446
-					break;
447
-				case 'RELIGION':
448
-					$tag = 'RELI';
449
-					break;
450
-				case 'REPOSITORY':
451
-					$tag = 'REPO';
452
-					break;
453
-				case 'RESIDENCE':
454
-					$tag = 'RESI';
455
-					break;
456
-				case 'RESTRICTION':
457
-					$tag = 'RESN';
458
-				case 'RESN':
459
-					// RESN values are lower case (confidential, privacy, locked, none)
460
-					$data = strtolower($data);
461
-					if ($data == 'invisible') {
462
-						$data = 'confidential'; // From old versions of Legacy.
463
-					}
464
-					break;
465
-				case 'RETIREMENT':
466
-					$tag = 'RETI';
467
-					break;
468
-				case 'ROMANIZED':
469
-					$tag = 'ROMN';
470
-					break;
471
-				case 'SEALING_CHILD':
472
-					$tag = 'SLGC';
473
-					break;
474
-				case 'SEALING_SPOUSE':
475
-					$tag = 'SLGS';
476
-					break;
477
-				case 'SOC_SEC_NUMBER':
478
-					$tag = 'SSN';
479
-					break;
480
-				case 'SEX':
481
-					$data = strtoupper($data);
482
-					break;
483
-				case 'SOURCE':
484
-					$tag = 'SOUR';
485
-					break;
486
-				case 'STATE':
487
-					$tag = 'STAE';
488
-					break;
489
-				case 'STATUS':
490
-					$tag = 'STAT';
491
-				case 'STAT':
492
-					if ($data == 'CANCELLED') {
493
-						// PhpGedView mis-spells this tag - correct it.
494
-						$data = 'CANCELED';
495
-					}
496
-					break;
497
-				case 'SUBMISSION':
498
-					$tag = 'SUBN';
499
-					break;
500
-				case 'SUBMITTER':
501
-					$tag = 'SUBM';
502
-					break;
503
-				case 'SURNAME':
504
-					$tag = 'SURN';
505
-					break;
506
-				case 'SURN_PREFIX':
507
-					$tag = 'SPFX';
508
-					break;
509
-				case 'TEMPLE':
510
-					$tag = 'TEMP';
511
-				case 'TEMP':
512
-					// Temple codes are upper case
513
-					$data = strtoupper($data);
514
-					break;
515
-				case 'TITLE':
516
-					$tag = 'TITL';
517
-					break;
518
-				case 'TRAILER':
519
-					$tag = 'TRLR';
520
-				case 'TRLR':
521
-					// TRLR records don't have an XREF or DATA
522
-					if ($level == '0') {
523
-						$xref = '';
524
-						$data = '';
525
-					}
526
-					break;
527
-				case 'VERSION':
528
-					$tag = 'VERS';
529
-					break;
530
-				case 'WEB':
531
-					$tag = 'WWW';
532
-					break;
62
+			case '_PGVU':
63
+				$tag = '_WT_USER';
64
+				break;
65
+			case '_PGV_OBJS':
66
+				$tag = '_WT_OBJE_SORT';
67
+				break;
68
+			// Convert FTM-style "TAG_FORMAL_NAME" into "TAG".
69
+			case 'ABBREVIATION':
70
+				$tag = 'ABBR';
71
+				break;
72
+			case 'ADDRESS':
73
+				$tag = 'ADDR';
74
+				break;
75
+			case 'ADDRESS1':
76
+				$tag = 'ADR1';
77
+				break;
78
+			case 'ADDRESS2':
79
+				$tag = 'ADR2';
80
+				break;
81
+			case 'ADDRESS3':
82
+				$tag = 'ADR3';
83
+				break;
84
+			case 'ADOPTION':
85
+				$tag = 'ADOP';
86
+				break;
87
+			case 'ADULT_CHRISTENING':
88
+				$tag = 'CHRA';
89
+				break;
90
+			case 'AFN':
91
+				// AFN values are upper case
92
+				$data = strtoupper($data);
93
+				break;
94
+			case 'AGENCY':
95
+				$tag = 'AGNC';
96
+				break;
97
+			case 'ALIAS':
98
+				$tag = 'ALIA';
99
+				break;
100
+			case 'ANCESTORS':
101
+				$tag = 'ANCE';
102
+				break;
103
+			case 'ANCES_INTEREST':
104
+				$tag = 'ANCI';
105
+				break;
106
+			case 'ANNULMENT':
107
+				$tag = 'ANUL';
108
+				break;
109
+			case 'ASSOCIATES':
110
+				$tag = 'ASSO';
111
+				break;
112
+			case 'AUTHOR':
113
+				$tag = 'AUTH';
114
+				break;
115
+			case 'BAPTISM':
116
+				$tag = 'BAPM';
117
+				break;
118
+			case 'BAPTISM_LDS':
119
+				$tag = 'BAPL';
120
+				break;
121
+			case 'BAR_MITZVAH':
122
+				$tag = 'BARM';
123
+				break;
124
+			case 'BAS_MITZVAH':
125
+				$tag = 'BASM';
126
+				break;
127
+			case 'BIRTH':
128
+				$tag = 'BIRT';
129
+				break;
130
+			case 'BLESSING':
131
+				$tag = 'BLES';
132
+				break;
133
+			case 'BURIAL':
134
+				$tag = 'BURI';
135
+				break;
136
+			case 'CALL_NUMBER':
137
+				$tag = 'CALN';
138
+				break;
139
+			case 'CASTE':
140
+				$tag = 'CAST';
141
+				break;
142
+			case 'CAUSE':
143
+				$tag = 'CAUS';
144
+				break;
145
+			case 'CENSUS':
146
+				$tag = 'CENS';
147
+				break;
148
+			case 'CHANGE':
149
+				$tag = 'CHAN';
150
+				break;
151
+			case 'CHARACTER':
152
+				$tag = 'CHAR';
153
+				break;
154
+			case 'CHILD':
155
+				$tag = 'CHIL';
156
+				break;
157
+			case 'CHILDREN_COUNT':
158
+				$tag = 'NCHI';
159
+				break;
160
+			case 'CHRISTENING':
161
+				$tag = 'CHR';
162
+				break;
163
+			case 'CONCATENATION':
164
+				$tag = 'CONC';
165
+				break;
166
+			case 'CONFIRMATION':
167
+				$tag = 'CONF';
168
+				break;
169
+			case 'CONFIRMATION_LDS':
170
+				$tag = 'CONL';
171
+				break;
172
+			case 'CONTINUED':
173
+				$tag = 'CONT';
174
+				break;
175
+			case 'COPYRIGHT':
176
+				$tag = 'COPR';
177
+				break;
178
+			case 'CORPORATE':
179
+				$tag = 'CORP';
180
+				break;
181
+			case 'COUNTRY':
182
+				$tag = 'CTRY';
183
+				break;
184
+			case 'CREMATION':
185
+				$tag = 'CREM';
186
+				break;
187
+			case 'DATE':
188
+				// Preserve text from INT dates
189
+				if (strpos($data, '(') !== false) {
190
+					list($date, $text) = explode('(', $data, 2);
191
+					$text              = ' (' . $text;
192
+				} else {
193
+					$date = $data;
194
+					$text = '';
195
+				}
196
+				// Capitals
197
+				$date = strtoupper($date);
198
+				// Temporarily add leading/trailing spaces, to allow efficient matching below
199
+				$date = " {$date} ";
200
+				// Ensure space digits and letters
201
+				$date = preg_replace('/([A-Z])(\d)/', '$1 $2', $date);
202
+				$date = preg_replace('/(\d)([A-Z])/', '$1 $2', $date);
203
+				// Ensure space before/after calendar escapes
204
+				$date = preg_replace('/@#[^@]+@/', ' $0 ', $date);
205
+				// "BET." => "BET"
206
+				$date = preg_replace('/(\w\w)\./', '$1', $date);
207
+				// "CIR" => "ABT"
208
+				$date = str_replace(' CIR ', ' ABT ', $date);
209
+				$date = str_replace(' APX ', ' ABT ', $date);
210
+				// B.C. => BC (temporarily, to allow easier handling of ".")
211
+				$date = str_replace(' B.C. ', ' BC ', $date);
212
+				// "BET X - Y " => "BET X AND Y"
213
+				$date = preg_replace('/^(.* BET .+) - (.+)/', '$1 AND $2', $date);
214
+				$date = preg_replace('/^(.* FROM .+) - (.+)/', '$1 TO $2', $date);
215
+				// "@#ESC@ FROM X TO Y" => "FROM @#ESC@ X TO @#ESC@ Y"
216
+				$date = preg_replace('/^ +(@#[^@]+@) +FROM +(.+) +TO +(.+)/', ' FROM $1 $2 TO $1 $3', $date);
217
+				$date = preg_replace('/^ +(@#[^@]+@) +BET +(.+) +AND +(.+)/', ' BET $1 $2 AND $1 $3', $date);
218
+				// "@#ESC@ AFT X" => "AFT @#ESC@ X"
219
+				$date = preg_replace('/^ +(@#[^@]+@) +(FROM|BET|TO|AND|BEF|AFT|CAL|EST|INT|ABT) +(.+)/', ' $2 $1 $3', $date);
220
+				// Ignore any remaining punctuation, e.g. "14-MAY, 1900" => "14 MAY 1900"
221
+				// (don't change "/" - it is used in NS/OS dates)
222
+				$date = preg_replace('/[.,:;-]/', ' ', $date);
223
+				// BC => B.C.
224
+				$date = str_replace(' BC ', ' B.C. ', $date);
225
+				// Append the "INT" text
226
+				$data = $date . $text;
227
+				break;
228
+			case 'DEATH':
229
+				$tag = 'DEAT';
230
+				break;
231
+			case '_DEATH_OF_SPOUSE':
232
+				$tag = '_DETS';
233
+				break;
234
+			case '_DEGREE':
235
+				$tag = '_DEG';
236
+				break;
237
+			case 'DESCENDANTS':
238
+				$tag = 'DESC';
239
+				break;
240
+			case 'DESCENDANT_INT':
241
+				$tag = 'DESI';
242
+				break;
243
+			case 'DESTINATION':
244
+				$tag = 'DEST';
245
+				break;
246
+			case 'DIVORCE':
247
+				$tag = 'DIV';
248
+				break;
249
+			case 'DIVORCE_FILED':
250
+				$tag = 'DIVF';
251
+				break;
252
+			case 'EDUCATION':
253
+				$tag = 'EDUC';
254
+				break;
255
+			case 'EMIGRATION':
256
+				$tag = 'EMIG';
257
+				break;
258
+			case 'ENDOWMENT':
259
+				$tag = 'ENDL';
260
+				break;
261
+			case 'ENGAGEMENT':
262
+				$tag = 'ENGA';
263
+				break;
264
+			case 'EVENT':
265
+				$tag = 'EVEN';
266
+				break;
267
+			case 'FACSIMILE':
268
+				$tag = 'FAX';
269
+				break;
270
+			case 'FAMILY':
271
+				$tag = 'FAM';
272
+				break;
273
+			case 'FAMILY_CHILD':
274
+				$tag = 'FAMC';
275
+				break;
276
+			case 'FAMILY_FILE':
277
+				$tag = 'FAMF';
278
+				break;
279
+			case 'FAMILY_SPOUSE':
280
+				$tag = 'FAMS';
281
+				break;
282
+			case 'FIRST_COMMUNION':
283
+				$tag = 'FCOM';
284
+				break;
285
+			case '_FILE':
286
+				$tag = 'FILE';
287
+				break;
288
+			case 'FORMAT':
289
+				$tag = 'FORM';
290
+			case 'FORM':
291
+				// Consistent commas
292
+				$data = preg_replace('/ *, */', ', ', $data);
293
+				break;
294
+			case 'GEDCOM':
295
+				$tag = 'GEDC';
296
+				break;
297
+			case 'GIVEN_NAME':
298
+				$tag = 'GIVN';
299
+				break;
300
+			case 'GRADUATION':
301
+				$tag = 'GRAD';
302
+				break;
303
+			case 'HEADER':
304
+				$tag = 'HEAD';
305
+			case 'HEAD':
306
+				// HEAD records don't have an XREF or DATA
307
+				if ($level == '0') {
308
+					$xref = '';
309
+					$data = '';
310
+				}
311
+				break;
312
+			case 'HUSBAND':
313
+				$tag = 'HUSB';
314
+				break;
315
+			case 'IDENT_NUMBER':
316
+				$tag = 'IDNO';
317
+				break;
318
+			case 'IMMIGRATION':
319
+				$tag = 'IMMI';
320
+				break;
321
+			case 'INDIVIDUAL':
322
+				$tag = 'INDI';
323
+				break;
324
+			case 'LANGUAGE':
325
+				$tag = 'LANG';
326
+				break;
327
+			case 'LATITUDE':
328
+				$tag = 'LATI';
329
+				break;
330
+			case 'LONGITUDE':
331
+				$tag = 'LONG';
332
+				break;
333
+			case 'MARRIAGE':
334
+				$tag = 'MARR';
335
+				break;
336
+			case 'MARRIAGE_BANN':
337
+				$tag = 'MARB';
338
+				break;
339
+			case 'MARRIAGE_COUNT':
340
+				$tag = 'NMR';
341
+				break;
342
+			case 'MARRIAGE_CONTRACT':
343
+				$tag = 'MARC';
344
+				break;
345
+			case 'MARRIAGE_LICENSE':
346
+				$tag = 'MARL';
347
+				break;
348
+			case 'MARRIAGE_SETTLEMENT':
349
+				$tag = 'MARS';
350
+				break;
351
+			case 'MEDIA':
352
+				$tag = 'MEDI';
353
+				break;
354
+			case '_MEDICAL':
355
+				$tag = '_MDCL';
356
+				break;
357
+			case '_MILITARY_SERVICE':
358
+				$tag = '_MILT';
359
+				break;
360
+			case 'NAME':
361
+				// Tidy up whitespace
362
+				$data = preg_replace('/  +/', ' ', trim($data));
363
+				break;
364
+			case 'NAME_PREFIX':
365
+				$tag = 'NPFX';
366
+				break;
367
+			case 'NAME_SUFFIX':
368
+				$tag = 'NSFX';
369
+				break;
370
+			case 'NATIONALITY':
371
+				$tag = 'NATI';
372
+				break;
373
+			case 'NATURALIZATION':
374
+				$tag = 'NATU';
375
+				break;
376
+			case 'NICKNAME':
377
+				$tag = 'NICK';
378
+				break;
379
+			case 'OBJECT':
380
+				$tag = 'OBJE';
381
+				break;
382
+			case 'OCCUPATION':
383
+				$tag = 'OCCU';
384
+				break;
385
+			case 'ORDINANCE':
386
+				$tag = 'ORDI';
387
+				break;
388
+			case 'ORDINATION':
389
+				$tag = 'ORDN';
390
+				break;
391
+			case 'PEDIGREE':
392
+				$tag = 'PEDI';
393
+			case 'PEDI':
394
+				// PEDI values are lower case
395
+				$data = strtolower($data);
396
+				break;
397
+			case 'PHONE':
398
+				$tag = 'PHON';
399
+				break;
400
+			case 'PHONETIC':
401
+				$tag = 'FONE';
402
+				break;
403
+			case 'PHY_DESCRIPTION':
404
+				$tag = 'DSCR';
405
+				break;
406
+			case 'PLACE':
407
+				$tag = 'PLAC';
408
+			case 'PLAC':
409
+				// Consistent commas
410
+				$data = preg_replace('/ *(،|,) */', ', ', $data);
411
+				// The Master Genealogist stores LAT/LONG data in the PLAC field, e.g. Pennsylvania, USA, 395945N0751013W
412
+				if (preg_match('/(.*), (\d\d)(\d\d)(\d\d)([NS])(\d\d\d)(\d\d)(\d\d)([EW])$/', $data, $match)) {
413
+					$data =
414
+						$match[1] . "\n" .
415
+						($level + 1) . " MAP\n" .
416
+						($level + 2) . " LATI " . ($match[5] . (round($match[2] + ($match[3] / 60) + ($match[4] / 3600), 4))) . "\n" .
417
+						($level + 2) . " LONG " . ($match[9] . (round($match[6] + ($match[7] / 60) + ($match[8] / 3600), 4)));
418
+				}
419
+				break;
420
+			case 'POSTAL_CODE':
421
+				$tag = 'POST';
422
+				break;
423
+			case 'PROBATE':
424
+				$tag = 'PROB';
425
+				break;
426
+			case 'PROPERTY':
427
+				$tag = 'PROP';
428
+				break;
429
+			case 'PUBLICATION':
430
+				$tag = 'PUBL';
431
+				break;
432
+			case 'QUALITY_OF_DATA':
433
+				$tag = 'QUAL';
434
+				break;
435
+			case 'REC_FILE_NUMBER':
436
+				$tag = 'RFN';
437
+				break;
438
+			case 'REC_ID_NUMBER':
439
+				$tag = 'RIN';
440
+				break;
441
+			case 'REFERENCE':
442
+				$tag = 'REFN';
443
+				break;
444
+			case 'RELATIONSHIP':
445
+				$tag = 'RELA';
446
+				break;
447
+			case 'RELIGION':
448
+				$tag = 'RELI';
449
+				break;
450
+			case 'REPOSITORY':
451
+				$tag = 'REPO';
452
+				break;
453
+			case 'RESIDENCE':
454
+				$tag = 'RESI';
455
+				break;
456
+			case 'RESTRICTION':
457
+				$tag = 'RESN';
458
+			case 'RESN':
459
+				// RESN values are lower case (confidential, privacy, locked, none)
460
+				$data = strtolower($data);
461
+				if ($data == 'invisible') {
462
+					$data = 'confidential'; // From old versions of Legacy.
463
+				}
464
+				break;
465
+			case 'RETIREMENT':
466
+				$tag = 'RETI';
467
+				break;
468
+			case 'ROMANIZED':
469
+				$tag = 'ROMN';
470
+				break;
471
+			case 'SEALING_CHILD':
472
+				$tag = 'SLGC';
473
+				break;
474
+			case 'SEALING_SPOUSE':
475
+				$tag = 'SLGS';
476
+				break;
477
+			case 'SOC_SEC_NUMBER':
478
+				$tag = 'SSN';
479
+				break;
480
+			case 'SEX':
481
+				$data = strtoupper($data);
482
+				break;
483
+			case 'SOURCE':
484
+				$tag = 'SOUR';
485
+				break;
486
+			case 'STATE':
487
+				$tag = 'STAE';
488
+				break;
489
+			case 'STATUS':
490
+				$tag = 'STAT';
491
+			case 'STAT':
492
+				if ($data == 'CANCELLED') {
493
+					// PhpGedView mis-spells this tag - correct it.
494
+					$data = 'CANCELED';
495
+				}
496
+				break;
497
+			case 'SUBMISSION':
498
+				$tag = 'SUBN';
499
+				break;
500
+			case 'SUBMITTER':
501
+				$tag = 'SUBM';
502
+				break;
503
+			case 'SURNAME':
504
+				$tag = 'SURN';
505
+				break;
506
+			case 'SURN_PREFIX':
507
+				$tag = 'SPFX';
508
+				break;
509
+			case 'TEMPLE':
510
+				$tag = 'TEMP';
511
+			case 'TEMP':
512
+				// Temple codes are upper case
513
+				$data = strtoupper($data);
514
+				break;
515
+			case 'TITLE':
516
+				$tag = 'TITL';
517
+				break;
518
+			case 'TRAILER':
519
+				$tag = 'TRLR';
520
+			case 'TRLR':
521
+				// TRLR records don't have an XREF or DATA
522
+				if ($level == '0') {
523
+					$xref = '';
524
+					$data = '';
525
+				}
526
+				break;
527
+			case 'VERSION':
528
+				$tag = 'VERS';
529
+				break;
530
+			case 'WEB':
531
+				$tag = 'WWW';
532
+				break;
533 533
 			}
534 534
 			// Suppress "Y", for facts/events with a DATE or PLAC
535 535
 			if ($data == 'y') {
@@ -545,40 +545,40 @@  discard block
 block discarded – undo
545 545
 			}
546 546
 			// Reassemble components back into a single line
547 547
 			switch ($tag) {
548
-				default:
549
-					// Remove tabs and multiple/leading/trailing spaces
550
-					if (strpos($data, "\t") !== false) {
551
-						$data = str_replace("\t", ' ', $data);
552
-					}
553
-					if (substr($data, 0, 1) == ' ' || substr($data, -1, 1) == ' ') {
554
-						$data = trim($data);
555
-					}
556
-					while (strpos($data, '  ')) {
557
-						$data = str_replace('  ', ' ', $data);
558
-					}
559
-					$newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data);
560
-					break;
561
-				case 'NOTE':
562
-				case 'TEXT':
563
-				case 'DATA':
564
-				case 'CONT':
565
-					$newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data);
566
-					break;
567
-				case 'FILE':
568
-					// Strip off the user-defined path prefix
569
-					$GEDCOM_MEDIA_PATH = $tree->getPreference('GEDCOM_MEDIA_PATH');
570
-					if ($GEDCOM_MEDIA_PATH && strpos($data, $GEDCOM_MEDIA_PATH) === 0) {
571
-						$data = substr($data, strlen($GEDCOM_MEDIA_PATH));
572
-					}
573
-					// convert backslashes in filenames to forward slashes
574
-					$data = preg_replace("/\\\/", "/", $data);
548
+			default:
549
+				// Remove tabs and multiple/leading/trailing spaces
550
+				if (strpos($data, "\t") !== false) {
551
+					$data = str_replace("\t", ' ', $data);
552
+				}
553
+				if (substr($data, 0, 1) == ' ' || substr($data, -1, 1) == ' ') {
554
+					$data = trim($data);
555
+				}
556
+				while (strpos($data, '  ')) {
557
+					$data = str_replace('  ', ' ', $data);
558
+				}
559
+				$newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data);
560
+				break;
561
+			case 'NOTE':
562
+			case 'TEXT':
563
+			case 'DATA':
564
+			case 'CONT':
565
+				$newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data);
566
+				break;
567
+			case 'FILE':
568
+				// Strip off the user-defined path prefix
569
+				$GEDCOM_MEDIA_PATH = $tree->getPreference('GEDCOM_MEDIA_PATH');
570
+				if ($GEDCOM_MEDIA_PATH && strpos($data, $GEDCOM_MEDIA_PATH) === 0) {
571
+					$data = substr($data, strlen($GEDCOM_MEDIA_PATH));
572
+				}
573
+				// convert backslashes in filenames to forward slashes
574
+				$data = preg_replace("/\\\/", "/", $data);
575 575
 
576
-					$newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data);
577
-					break;
578
-				case 'CONC':
579
-					// Merge CONC lines, to simplify access later on.
580
-					$newrec .= ($tree->getPreference('WORD_WRAPPED_NOTES') ? ' ' : '') . $data;
581
-					break;
576
+				$newrec .= ($newrec ? "\n" : '') . $level . ' ' . ($level == '0' && $xref ? $xref . ' ' : '') . $tag . ($data === '' && $tag != "NOTE" ? '' : ' ' . $data);
577
+				break;
578
+			case 'CONC':
579
+				// Merge CONC lines, to simplify access later on.
580
+				$newrec .= ($tree->getPreference('WORD_WRAPPED_NOTES') ? ' ' : '') . $data;
581
+				break;
582 582
 			}
583 583
 		}
584 584
 
@@ -635,136 +635,136 @@  discard block
 block discarded – undo
635 635
 		}
636 636
 
637 637
 		switch ($type) {
638
-			case 'INDI':
639
-				// Convert inline media into media objects
640
-				$gedrec = self::convertInlineMedia($tree, $gedrec);
638
+		case 'INDI':
639
+			// Convert inline media into media objects
640
+			$gedrec = self::convertInlineMedia($tree, $gedrec);
641 641
 
642
-				$record = new Individual($xref, $gedrec, null, $tree);
643
-				if ($tree->getPreference('USE_RIN') && preg_match('/\n1 RIN (.+)/', $gedrec, $match)) {
644
-					$rin = $match[1];
645
-				} else {
646
-					$rin = $xref;
647
-				}
648
-				Database::prepare(
649
-					"INSERT INTO `##individuals` (i_id, i_file, i_rin, i_sex, i_gedcom) VALUES (?, ?, ?, ?, ?)"
650
-				)->execute(array(
651
-					$xref, $tree_id, $rin, $record->getSex(), $gedrec,
652
-				));
653
-				// Update the cross-reference/index tables.
654
-				self::updatePlaces($xref, $tree_id, $gedrec);
655
-				self::updateDates($xref, $tree_id, $gedrec);
656
-				self::updateLinks($xref, $tree_id, $gedrec);
657
-				self::updateNames($xref, $tree_id, $record);
658
-				break;
659
-			case 'FAM':
660
-				// Convert inline media into media objects
661
-				$gedrec = self::convertInlineMedia($tree, $gedrec);
642
+			$record = new Individual($xref, $gedrec, null, $tree);
643
+			if ($tree->getPreference('USE_RIN') && preg_match('/\n1 RIN (.+)/', $gedrec, $match)) {
644
+				$rin = $match[1];
645
+			} else {
646
+				$rin = $xref;
647
+			}
648
+			Database::prepare(
649
+				"INSERT INTO `##individuals` (i_id, i_file, i_rin, i_sex, i_gedcom) VALUES (?, ?, ?, ?, ?)"
650
+			)->execute(array(
651
+				$xref, $tree_id, $rin, $record->getSex(), $gedrec,
652
+			));
653
+			// Update the cross-reference/index tables.
654
+			self::updatePlaces($xref, $tree_id, $gedrec);
655
+			self::updateDates($xref, $tree_id, $gedrec);
656
+			self::updateLinks($xref, $tree_id, $gedrec);
657
+			self::updateNames($xref, $tree_id, $record);
658
+			break;
659
+		case 'FAM':
660
+			// Convert inline media into media objects
661
+			$gedrec = self::convertInlineMedia($tree, $gedrec);
662 662
 
663
-				if (preg_match('/\n1 HUSB @(' . WT_REGEX_XREF . ')@/', $gedrec, $match)) {
664
-					$husb = $match[1];
665
-				} else {
666
-					$husb = '';
667
-				}
668
-				if (preg_match('/\n1 WIFE @(' . WT_REGEX_XREF . ')@/', $gedrec, $match)) {
669
-					$wife = $match[1];
670
-				} else {
671
-					$wife = '';
672
-				}
673
-				$nchi = preg_match_all('/\n1 CHIL @(' . WT_REGEX_XREF . ')@/', $gedrec, $match);
674
-				if (preg_match('/\n1 NCHI (\d+)/', $gedrec, $match)) {
675
-					$nchi = max($nchi, $match[1]);
676
-				}
677
-				Database::prepare(
678
-					"INSERT INTO `##families` (f_id, f_file, f_husb, f_wife, f_gedcom, f_numchil) VALUES (?, ?, ?, ?, ?, ?)"
679
-				)->execute(array(
680
-					$xref, $tree_id, $husb, $wife, $gedrec, $nchi,
681
-				));
682
-				// Update the cross-reference/index tables.
683
-				self::updatePlaces($xref, $tree_id, $gedrec);
684
-				self::updateDates($xref, $tree_id, $gedrec);
685
-				self::updateLinks($xref, $tree_id, $gedrec);
686
-				break;
687
-			case 'SOUR':
688
-				// Convert inline media into media objects
689
-				$gedrec = self::convertInlineMedia($tree, $gedrec);
663
+			if (preg_match('/\n1 HUSB @(' . WT_REGEX_XREF . ')@/', $gedrec, $match)) {
664
+				$husb = $match[1];
665
+			} else {
666
+				$husb = '';
667
+			}
668
+			if (preg_match('/\n1 WIFE @(' . WT_REGEX_XREF . ')@/', $gedrec, $match)) {
669
+				$wife = $match[1];
670
+			} else {
671
+				$wife = '';
672
+			}
673
+			$nchi = preg_match_all('/\n1 CHIL @(' . WT_REGEX_XREF . ')@/', $gedrec, $match);
674
+			if (preg_match('/\n1 NCHI (\d+)/', $gedrec, $match)) {
675
+				$nchi = max($nchi, $match[1]);
676
+			}
677
+			Database::prepare(
678
+				"INSERT INTO `##families` (f_id, f_file, f_husb, f_wife, f_gedcom, f_numchil) VALUES (?, ?, ?, ?, ?, ?)"
679
+			)->execute(array(
680
+				$xref, $tree_id, $husb, $wife, $gedrec, $nchi,
681
+			));
682
+			// Update the cross-reference/index tables.
683
+			self::updatePlaces($xref, $tree_id, $gedrec);
684
+			self::updateDates($xref, $tree_id, $gedrec);
685
+			self::updateLinks($xref, $tree_id, $gedrec);
686
+			break;
687
+		case 'SOUR':
688
+			// Convert inline media into media objects
689
+			$gedrec = self::convertInlineMedia($tree, $gedrec);
690 690
 
691
-				$record = new Source($xref, $gedrec, null, $tree);
692
-				if (preg_match('/\n1 TITL (.+)/', $gedrec, $match)) {
693
-					$name = $match[1];
694
-				} elseif (preg_match('/\n1 ABBR (.+)/', $gedrec, $match)) {
695
-					$name = $match[1];
696
-				} else {
697
-					$name = $xref;
698
-				}
699
-				Database::prepare(
700
-					"INSERT INTO `##sources` (s_id, s_file, s_name, s_gedcom) VALUES (?, ?, LEFT(?, 255), ?)"
701
-				)->execute(array(
702
-					$xref, $tree_id, $name, $gedrec,
703
-				));
704
-				// Update the cross-reference/index tables.
705
-				self::updateLinks($xref, $tree_id, $gedrec);
706
-				self::updateNames($xref, $tree_id, $record);
707
-				break;
708
-			case 'REPO':
709
-				// Convert inline media into media objects
710
-				$gedrec = self::convertInlineMedia($tree, $gedrec);
691
+			$record = new Source($xref, $gedrec, null, $tree);
692
+			if (preg_match('/\n1 TITL (.+)/', $gedrec, $match)) {
693
+				$name = $match[1];
694
+			} elseif (preg_match('/\n1 ABBR (.+)/', $gedrec, $match)) {
695
+				$name = $match[1];
696
+			} else {
697
+				$name = $xref;
698
+			}
699
+			Database::prepare(
700
+				"INSERT INTO `##sources` (s_id, s_file, s_name, s_gedcom) VALUES (?, ?, LEFT(?, 255), ?)"
701
+			)->execute(array(
702
+				$xref, $tree_id, $name, $gedrec,
703
+			));
704
+			// Update the cross-reference/index tables.
705
+			self::updateLinks($xref, $tree_id, $gedrec);
706
+			self::updateNames($xref, $tree_id, $record);
707
+			break;
708
+		case 'REPO':
709
+			// Convert inline media into media objects
710
+			$gedrec = self::convertInlineMedia($tree, $gedrec);
711 711
 
712
-				$record = new Repository($xref, $gedrec, null, $tree);
713
-				Database::prepare(
714
-					"INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?, ?, 'REPO', ?)"
715
-				)->execute(array(
716
-					$xref, $tree_id, $gedrec,
717
-				));
718
-				// Update the cross-reference/index tables.
719
-				self::updateLinks($xref, $tree_id, $gedrec);
720
-				self::updateNames($xref, $tree_id, $record);
721
-				break;
722
-			case 'NOTE':
723
-				$record = new Note($xref, $gedrec, null, $tree);
724
-				Database::prepare(
725
-					"INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?, ?, 'NOTE', ?)"
726
-				)->execute(array(
727
-					$xref, $tree_id, $gedrec,
728
-				));
729
-				// Update the cross-reference/index tables.
730
-				self::updateLinks($xref, $tree_id, $gedrec);
731
-				self::updateNames($xref, $tree_id, $record);
732
-				break;
733
-			case 'OBJE':
734
-				$record = new Media($xref, $gedrec, null, $tree);
735
-				Database::prepare(
736
-					"INSERT INTO `##media` (m_id, m_ext, m_type, m_titl, m_filename, m_file, m_gedcom) VALUES (?, ?, ?, ?, ?, ?, ?)"
737
-				)->execute(array(
738
-					$xref, $record->extension(), $record->getMediaType(), $record->getTitle(), $record->getFilename(), $tree_id, $gedrec,
739
-				));
740
-				// Update the cross-reference/index tables.
741
-				self::updateLinks($xref, $tree_id, $gedrec);
742
-				self::updateNames($xref, $tree_id, $record);
743
-				break;
744
-			case 'HEAD':
745
-				// Force HEAD records to have a creation date.
746
-				if (!strpos($gedrec, "\n1 DATE ")) {
747
-					$gedrec .= "\n1 DATE " . date('j M Y');
748
-				}
749
-			// No break;
750
-			case 'TRLR':
751
-			case 'SUBM':
752
-			case 'SUBN':
753
-				Database::prepare(
754
-					"INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?, ?, ?, ?)"
755
-				)->execute(array($xref, $tree_id, $type, $gedrec));
756
-				// Update the cross-reference/index tables.
712
+			$record = new Repository($xref, $gedrec, null, $tree);
713
+			Database::prepare(
714
+				"INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?, ?, 'REPO', ?)"
715
+			)->execute(array(
716
+				$xref, $tree_id, $gedrec,
717
+			));
718
+			// Update the cross-reference/index tables.
757 719
 			self::updateLinks($xref, $tree_id, $gedrec);
758
-				break;
759
-			default:
760
-				$record = new GedcomRecord($xref, $gedrec, null, $tree);
761
-				Database::prepare(
762
-					"INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?, ?, ?, ?)"
763
-				)->execute(array($xref, $tree_id, $type, $gedrec));
764
-				// Update the cross-reference/index tables.
765
-				self::updateLinks($xref, $tree_id, $gedrec);
766
-				self::updateNames($xref, $tree_id, $record);
767
-				break;
720
+			self::updateNames($xref, $tree_id, $record);
721
+			break;
722
+		case 'NOTE':
723
+			$record = new Note($xref, $gedrec, null, $tree);
724
+			Database::prepare(
725
+				"INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?, ?, 'NOTE', ?)"
726
+			)->execute(array(
727
+				$xref, $tree_id, $gedrec,
728
+			));
729
+			// Update the cross-reference/index tables.
730
+			self::updateLinks($xref, $tree_id, $gedrec);
731
+			self::updateNames($xref, $tree_id, $record);
732
+			break;
733
+		case 'OBJE':
734
+			$record = new Media($xref, $gedrec, null, $tree);
735
+			Database::prepare(
736
+				"INSERT INTO `##media` (m_id, m_ext, m_type, m_titl, m_filename, m_file, m_gedcom) VALUES (?, ?, ?, ?, ?, ?, ?)"
737
+			)->execute(array(
738
+				$xref, $record->extension(), $record->getMediaType(), $record->getTitle(), $record->getFilename(), $tree_id, $gedrec,
739
+			));
740
+			// Update the cross-reference/index tables.
741
+			self::updateLinks($xref, $tree_id, $gedrec);
742
+			self::updateNames($xref, $tree_id, $record);
743
+			break;
744
+		case 'HEAD':
745
+			// Force HEAD records to have a creation date.
746
+			if (!strpos($gedrec, "\n1 DATE ")) {
747
+				$gedrec .= "\n1 DATE " . date('j M Y');
748
+			}
749
+		// No break;
750
+		case 'TRLR':
751
+		case 'SUBM':
752
+		case 'SUBN':
753
+			Database::prepare(
754
+				"INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?, ?, ?, ?)"
755
+			)->execute(array($xref, $tree_id, $type, $gedrec));
756
+			// Update the cross-reference/index tables.
757
+		self::updateLinks($xref, $tree_id, $gedrec);
758
+			break;
759
+		default:
760
+			$record = new GedcomRecord($xref, $gedrec, null, $tree);
761
+			Database::prepare(
762
+				"INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?, ?, ?, ?)"
763
+			)->execute(array($xref, $tree_id, $type, $gedrec));
764
+			// Update the cross-reference/index tables.
765
+			self::updateLinks($xref, $tree_id, $gedrec);
766
+			self::updateNames($xref, $tree_id, $record);
767
+			break;
768 768
 		}
769 769
 	}
770 770
 
@@ -1137,21 +1137,21 @@  discard block
 block discarded – undo
1137 1137
 		Database::prepare("DELETE FROM `##link` WHERE l_from=? AND l_file=?")->execute(array($gid, $ged_id));
1138 1138
 
1139 1139
 		switch ($type) {
1140
-			case 'INDI':
1141
-				Database::prepare("DELETE FROM `##individuals` WHERE i_id=? AND i_file=?")->execute(array($gid, $ged_id));
1142
-				break;
1143
-			case 'FAM':
1144
-				Database::prepare("DELETE FROM `##families` WHERE f_id=? AND f_file=?")->execute(array($gid, $ged_id));
1145
-				break;
1146
-			case 'SOUR':
1147
-				Database::prepare("DELETE FROM `##sources` WHERE s_id=? AND s_file=?")->execute(array($gid, $ged_id));
1148
-				break;
1149
-			case 'OBJE':
1150
-				Database::prepare("DELETE FROM `##media` WHERE m_id=? AND m_file=?")->execute(array($gid, $ged_id));
1151
-				break;
1152
-			default:
1153
-				Database::prepare("DELETE FROM `##other` WHERE o_id=? AND o_file=?")->execute(array($gid, $ged_id));
1154
-				break;
1140
+		case 'INDI':
1141
+			Database::prepare("DELETE FROM `##individuals` WHERE i_id=? AND i_file=?")->execute(array($gid, $ged_id));
1142
+			break;
1143
+		case 'FAM':
1144
+			Database::prepare("DELETE FROM `##families` WHERE f_id=? AND f_file=?")->execute(array($gid, $ged_id));
1145
+			break;
1146
+		case 'SOUR':
1147
+			Database::prepare("DELETE FROM `##sources` WHERE s_id=? AND s_file=?")->execute(array($gid, $ged_id));
1148
+			break;
1149
+		case 'OBJE':
1150
+			Database::prepare("DELETE FROM `##media` WHERE m_id=? AND m_file=?")->execute(array($gid, $ged_id));
1151
+			break;
1152
+		default:
1153
+			Database::prepare("DELETE FROM `##other` WHERE o_id=? AND o_file=?")->execute(array($gid, $ged_id));
1154
+			break;
1155 1155
 		}
1156 1156
 
1157 1157
 		if (!$delete) {
Please login to merge, or discard this patch.
app/Functions/FunctionsMedia.php 1 patch
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -34,17 +34,17 @@
 block discarded – undo
34 34
 			$val = -1;
35 35
 		}
36 36
 		switch (substr($val, -1)) {
37
-			case 'g':
38
-			case 'G':
39
-				return (int) $val * 1024 * 1024 * 1024;
40
-			case 'm':
41
-			case 'M':
42
-				return (int) $val * 1024 * 1024;
43
-			case 'k':
44
-			case 'K':
45
-				return (int) $val * 1024;
46
-			default:
47
-				return (int) $val;
37
+		case 'g':
38
+		case 'G':
39
+			return (int) $val * 1024 * 1024 * 1024;
40
+		case 'm':
41
+		case 'M':
42
+			return (int) $val * 1024 * 1024;
43
+		case 'k':
44
+		case 'K':
45
+			return (int) $val * 1024;
46
+		default:
47
+			return (int) $val;
48 48
 		}
49 49
 	}
50 50
 
Please login to merge, or discard this patch.
app/Functions/FunctionsPrint.php 1 patch
Switch Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -50,20 +50,20 @@  discard block
 block discarded – undo
50 50
 	public static function printPedigreePerson(Individual $person = null, $show_full = 1) {
51 51
 
52 52
 		switch ($show_full) {
53
-			case 0:
54
-				if ($person) {
55
-					echo Theme::theme()->individualBoxSmall($person);
56
-				} else {
57
-					echo Theme::theme()->individualBoxSmallEmpty();
58
-				}
59
-				break;
60
-			case 1:
61
-				if ($person) {
62
-					echo Theme::theme()->individualBox($person);
63
-				} else {
64
-					echo Theme::theme()->individualBoxEmpty();
65
-				}
66
-				break;
53
+		case 0:
54
+			if ($person) {
55
+				echo Theme::theme()->individualBoxSmall($person);
56
+			} else {
57
+				echo Theme::theme()->individualBoxSmallEmpty();
58
+			}
59
+			break;
60
+		case 1:
61
+			if ($person) {
62
+				echo Theme::theme()->individualBox($person);
63
+			} else {
64
+				echo Theme::theme()->individualBoxEmpty();
65
+			}
66
+			break;
67 67
 		}
68 68
 	}
69 69
 
@@ -259,25 +259,25 @@  discard block
 block discarded – undo
259 259
 					$age      = Date::getAge($parent->getBirthDate(), $birth_date, 2);
260 260
 					$deatdate = $parent->getDeathDate();
261 261
 					switch ($parent->getSex()) {
262
-						case 'F':
263
-							// Highlight mothers who die in childbirth or shortly afterwards
264
-							if ($deatdate->isOK() && $deatdate->maximumJulianDay() < $birth_date->minimumJulianDay() + 90) {
265
-								$html .= ' <span title="' . GedcomTag::getLabel('_DEAT_PARE', $parent) . '" class="parentdeath">' . $sex . $age . '</span>';
266
-							} else {
267
-								$html .= ' <span title="' . I18N::translate('Mother’s age') . '">' . $sex . $age . '</span>';
268
-							}
269
-							break;
270
-						case 'M':
271
-							// Highlight fathers who die before the birth
272
-							if ($deatdate->isOK() && $deatdate->maximumJulianDay() < $birth_date->minimumJulianDay()) {
273
-								$html .= ' <span title="' . GedcomTag::getLabel('_DEAT_PARE', $parent) . '" class="parentdeath">' . $sex . $age . '</span>';
274
-							} else {
275
-								$html .= ' <span title="' . I18N::translate('Father’s age') . '">' . $sex . $age . '</span>';
276
-							}
277
-							break;
278
-						default:
279
-							$html .= ' <span title="' . I18N::translate('Parent’s age') . '">' . $sex . $age . '</span>';
280
-							break;
262
+					case 'F':
263
+						// Highlight mothers who die in childbirth or shortly afterwards
264
+						if ($deatdate->isOK() && $deatdate->maximumJulianDay() < $birth_date->minimumJulianDay() + 90) {
265
+							$html .= ' <span title="' . GedcomTag::getLabel('_DEAT_PARE', $parent) . '" class="parentdeath">' . $sex . $age . '</span>';
266
+						} else {
267
+							$html .= ' <span title="' . I18N::translate('Mother’s age') . '">' . $sex . $age . '</span>';
268
+						}
269
+						break;
270
+					case 'M':
271
+						// Highlight fathers who die before the birth
272
+						if ($deatdate->isOK() && $deatdate->maximumJulianDay() < $birth_date->minimumJulianDay()) {
273
+							$html .= ' <span title="' . GedcomTag::getLabel('_DEAT_PARE', $parent) . '" class="parentdeath">' . $sex . $age . '</span>';
274
+						} else {
275
+							$html .= ' <span title="' . I18N::translate('Father’s age') . '">' . $sex . $age . '</span>';
276
+						}
277
+						break;
278
+					default:
279
+						$html .= ' <span title="' . I18N::translate('Parent’s age') . '">' . $sex . $age . '</span>';
280
+						break;
281 281
 					}
282 282
 				}
283 283
 			}
@@ -578,33 +578,33 @@  discard block
 block discarded – undo
578 578
 
579 579
 		// -- Add from pick list
580 580
 		switch ($type) {
581
-			case "INDI":
582
-				$addfacts    = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
583
-				$uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
584
-				$quickfacts  = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
585
-				break;
586
-			case "FAM":
587
-				$addfacts    = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
588
-				$uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
589
-				$quickfacts  = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
590
-				break;
591
-			case "SOUR":
592
-				$addfacts    = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
593
-				$uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
594
-				$quickfacts  = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
595
-				break;
596
-			case "NOTE":
597
-				$addfacts    = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
598
-				$uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
599
-				$quickfacts  = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
600
-				break;
601
-			case "REPO":
602
-				$addfacts    = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
603
-				$uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
604
-				$quickfacts  = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
605
-				break;
606
-			default:
607
-				return;
581
+		case "INDI":
582
+			$addfacts    = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
583
+			$uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
584
+			$quickfacts  = preg_split("/[, ;:]+/", $WT_TREE->getPreference('INDI_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
585
+			break;
586
+		case "FAM":
587
+			$addfacts    = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
588
+			$uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
589
+			$quickfacts  = preg_split("/[, ;:]+/", $WT_TREE->getPreference('FAM_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
590
+			break;
591
+		case "SOUR":
592
+			$addfacts    = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
593
+			$uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
594
+			$quickfacts  = preg_split("/[, ;:]+/", $WT_TREE->getPreference('SOUR_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
595
+			break;
596
+		case "NOTE":
597
+			$addfacts    = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
598
+			$uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
599
+			$quickfacts  = preg_split("/[, ;:]+/", $WT_TREE->getPreference('NOTE_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
600
+			break;
601
+		case "REPO":
602
+			$addfacts    = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_ADD'), -1, PREG_SPLIT_NO_EMPTY);
603
+			$uniquefacts = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_UNIQUE'), -1, PREG_SPLIT_NO_EMPTY);
604
+			$quickfacts  = preg_split("/[, ;:]+/", $WT_TREE->getPreference('REPO_FACTS_QUICK'), -1, PREG_SPLIT_NO_EMPTY);
605
+			break;
606
+		default:
607
+			return;
608 608
 		}
609 609
 		$addfacts            = array_merge(self::checkFactUnique($uniquefacts, $usedfacts, $type), $addfacts);
610 610
 		$quickfacts          = array_intersect($quickfacts, $addfacts);
Please login to merge, or discard this patch.