Completed
Push — 1.7 ( ce7091...0d97cf )
by Greg
14:14 queued 07:41
created
app/Mail.php 1 patch
Switch Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -98,30 +98,30 @@
 block discarded – undo
98 98
 	 */
99 99
 	public static function transport() {
100 100
 		switch (Site::getPreference('SMTP_ACTIVE')) {
101
-		case 'internal':
102
-			return Swift_MailTransport::newInstance();
103
-		case 'sendmail':
104
-			return Swift_SendmailTransport::newInstance();
105
-		case 'external':
106
-            $transport = Swift_SmtpTransport::newInstance()
107
-                ->setHost(Site::getPreference('SMTP_HOST'))
108
-                ->setPort(Site::getPreference('SMTP_PORT'))
109
-                ->setLocalDomain(Site::getPreference('SMTP_HELO'));
101
+		    case 'internal':
102
+			    return Swift_MailTransport::newInstance();
103
+		    case 'sendmail':
104
+			    return Swift_SendmailTransport::newInstance();
105
+		    case 'external':
106
+                $transport = Swift_SmtpTransport::newInstance()
107
+                    ->setHost(Site::getPreference('SMTP_HOST'))
108
+                    ->setPort(Site::getPreference('SMTP_PORT'))
109
+                    ->setLocalDomain(Site::getPreference('SMTP_HELO'));
110 110
 
111
-            if (Site::getPreference('SMTP_AUTH')) {
112
-                $transport
113
-                    ->setUsername(Site::getPreference('SMTP_AUTH_USER'))
114
-                    ->setPassword(Site::getPreference('SMTP_AUTH_PASS'));
115
-            }
111
+                if (Site::getPreference('SMTP_AUTH')) {
112
+                    $transport
113
+                        ->setUsername(Site::getPreference('SMTP_AUTH_USER'))
114
+                        ->setPassword(Site::getPreference('SMTP_AUTH_PASS'));
115
+                }
116 116
 
117
-            if (Site::getPreference('SMTP_SSL') !== 'none') {
118
-                $transport->setEncryption(Site::getPreference('SMTP_SSL'));
119
-            }
117
+                if (Site::getPreference('SMTP_SSL') !== 'none') {
118
+                    $transport->setEncryption(Site::getPreference('SMTP_SSL'));
119
+                }
120 120
 
121
-			return $transport;
122
-		default:
123
-			// For testing
124
-			return Swift_NullTransport::newInstance();
121
+			    return $transport;
122
+		    default:
123
+			    // For testing
124
+			    return Swift_NullTransport::newInstance();
125 125
 		}
126 126
 	}
127 127
 }
Please login to merge, or discard this patch.
app/Report/ReportHtmlImage.php 1 patch
Switch Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -43,20 +43,20 @@
 block discarded – undo
43 43
 
44 44
 		// Image alignment
45 45
 		switch ($this->align) {
46
-		case "L":
47
-			echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:left;\">\n";
48
-			echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n";
49
-			break;
50
-		case "C":
51
-			echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:center;\">\n";
52
-			echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n";
53
-			break;
54
-		case "R":
55
-			echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:right;\">\n";
56
-			echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n";
57
-			break;
58
-		default:
59
-			echo "<img src=\"", $this->file, "\" style=\"position:absolute;", $renderer->alignRTL, ":", $this->x, "pt;top:", $this->y, "pt;width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n";
46
+		    case "L":
47
+			    echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:left;\">\n";
48
+			    echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n";
49
+			    break;
50
+		    case "C":
51
+			    echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:center;\">\n";
52
+			    echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n";
53
+			    break;
54
+		    case "R":
55
+			    echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:right;\">\n";
56
+			    echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n";
57
+			    break;
58
+		    default:
59
+			    echo "<img src=\"", $this->file, "\" style=\"position:absolute;", $renderer->alignRTL, ":", $this->x, "pt;top:", $this->y, "pt;width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n";
60 60
 		}
61 61
 
62 62
 		$lastpicpage   = $renderer->pageNo();
Please login to merge, or discard this patch.
app/Report/ReportHtmlCell.php 1 patch
Switch Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -147,15 +147,15 @@
 block discarded – undo
147 147
 
148 148
 		// Text alignment
149 149
 		switch ($this->align) {
150
-		case "C":
151
-			echo " text-align:center;";
152
-			break;
153
-		case "L":
154
-			echo " text-align:left;";
155
-			break;
156
-		case "R":
157
-			echo " text-align:right;";
158
-			break;
150
+		    case "C":
151
+			    echo " text-align:center;";
152
+			    break;
153
+		    case "L":
154
+			    echo " text-align:left;";
155
+			    break;
156
+		    case "R":
157
+			    echo " text-align:right;";
158
+			    break;
159 159
 		}
160 160
 
161 161
 		// Print the collected HTML code
Please login to merge, or discard this patch.
app/Report/ReportBase.php 1 patch
Switch Indentation   +252 added lines, -252 removed lines patch added patch discarded remove patch
@@ -139,258 +139,258 @@
 block discarded – undo
139 139
 			 */
140 140
 			switch ($this->pageFormat) {
141 141
 				// ISO A series
142
-			case '4A0': // ISO 216, 1682 mm x 2378 mm
143
-				$sizes = array(4767.86, 6740.79);
144
-				break;
145
-			case '2A0': // ISO 216, 1189 mm x 1682 mm
146
-				$sizes = array(3370.39, 4767.86);
147
-				break;
148
-			case 'A0': // ISO 216, 841 mm x 1189mm
149
-				$sizes = array(2383.94, 3370.39);
150
-				break;
151
-			case 'A1': // ISO 216, 594 mm x 841 mm
152
-				$sizes = array(1683.78, 2383.94);
153
-				break;
154
-			case 'A2': // ISO 216, 420 mm x 594 mm
155
-				$sizes = array(1190.55, 1683.78);
156
-				break;
157
-			case 'A3': // ISO 216, 297 mm x 420 mm
158
-				$sizes = array(841.89, 1190.55);
159
-				break;
160
-			case 'A4': // ISO 216, 210 mm 297 mm
161
-				$sizes = array(595.28, 841.89);
162
-				break;
163
-			case 'A5': // ISO 216, 148 mm x 210 mm
164
-				$sizes = array(419.53, 595.28);
165
-				break;
166
-			case 'A6': // ISO 216, 105 mm x 148 mm
167
-				$sizes = array(297.64, 419.53);
168
-				break;
169
-			case 'A7': // ISO 216, 74 mm x 105 mm
170
-				$sizes = array(209.76, 297.64);
171
-				break;
172
-			case 'A8': // ISO 216, 52 mm x 74 mm
173
-				$sizes = array(147.40, 209.76);
174
-				break;
175
-			case 'A9': // ISO 216, 37 mm x 52 mm
176
-				$sizes = array(104.88, 147.40);
177
-				break;
178
-			case 'A10': // ISO 216, 26 mm x 37 mm
179
-				$sizes = array(73.70, 104.88);
180
-				break;
181
-
182
-			// ISO B series
183
-			case 'B0': // ISO 216, 1000 mm x 1414 mm
184
-				$sizes = array(2834.65, 4008.19);
185
-				break;
186
-			case 'B1': // ISO 216, 707 mm x 1000 mm
187
-				$sizes = array(2004.09, 2834.65);
188
-				break;
189
-			case 'B2': // ISO 216, 500 mm x 707 mm
190
-				$sizes = array(1417.32, 2004.09);
191
-				break;
192
-			case 'B3': // ISO 216, 353 mm x 500 mm
193
-				$sizes = array(1000.63, 1417.32);
194
-				break;
195
-			case 'B4': // ISO 216, 250 mm x 353 mm
196
-				$sizes = array(708.66, 1000.63);
197
-				break;
198
-			case 'B5': // ISO 216, 176 mm x 250 mm
199
-				$sizes = array(498.90, 708.66);
200
-				break;
201
-			case 'B6': // ISO 216, 125 mm x 176 mm
202
-				$sizes = array(354.33, 498.90);
203
-				break;
204
-			case 'B7': // ISO 216, 88 mm x 125 mm
205
-				$sizes = array(249.45, 354.33);
206
-				break;
207
-			case 'B8': // ISO 216, 62 mm x 88 mm
208
-				$sizes = array(175.75, 249.45);
209
-				break;
210
-			case 'B9': // ISO 216, 44 mm x 62 mm
211
-				$sizes = array(124.72, 175.75);
212
-				break;
213
-			case 'B10': // ISO 216, 31 mm x 44 mm
214
-				$sizes = array(87.87, 124.72);
215
-				break;
216
-
217
-			// ISO C series, Envelope
218
-			case 'C0': // ISO 269, 917 mm x 1297 mm, For flat A0 sheet
219
-				$sizes = array(2599.37, 3676.54);
220
-				break;
221
-			case 'C1': // ISO 269, 648 mm x 917 mm, For flat A1 sheet
222
-				$sizes = array(1836.85, 2599.37);
223
-				break;
224
-			case 'C2': // ISO 269, 458 mm x 648 mm, For flat A2 sheet, A1 folded in half
225
-				$sizes = array(1298.27, 1836.85);
226
-				break;
227
-			case 'C3': // ISO 269, 324 mm x 458 mm, For flat A3 sheet, A2 folded in half
228
-				$sizes = array(918.43, 1298.27);
229
-				break;
230
-			case 'C4': // ISO 269, 229 mm x 324 mm, For flat A4 sheet, A3 folded in half
231
-				$sizes = array(649.13, 918.43);
232
-				break;
233
-			case 'C5': // ISO 269, 162 mm x 229 mm, For flat A5 sheet, A4 folded in half
234
-				$sizes = array(459.21, 649.13);
235
-				break;
236
-			case 'C6/5': // ISO 269, 114 mm x 229 mm. A5 folded twice = 1/3 A4. Alternative for the DL envelope
237
-				$sizes = array(323.15, 649.13);
238
-				break;
239
-			case 'C6': // ISO 269, 114 mm x 162 mm, For A5 folded in half
240
-				$sizes = array(323.15, 459.21);
241
-				break;
242
-			case 'C7/6': // ISO 269, 81 mm x 162 mm, For A5 sheet folded in thirds
243
-				$sizes = array(229.61, 459.21);
244
-				break;
245
-			case 'C7': // ISO 269, 81 mm x 114 mm, For A5 folded in quarters
246
-				$sizes = array(229.61, 323.15);
247
-				break;
248
-			case 'C8': // ISO 269, 57 mm x 81 mm
249
-				$sizes = array(161.57, 229.61);
250
-				break;
251
-			case 'C9': // ISO 269, 40 mm x 57 mm
252
-				$sizes = array(113.39, 161.57);
253
-				break;
254
-			case 'C10': // ISO 269, 28 mm x 40 mm
255
-				$sizes = array(79.37, 113.39);
256
-				break;
257
-			case 'DL': // Original DIN 678 but ISO 269 now has this C6/5 , 110 mm x 220 mm, For A4 sheet folded in thirds, A5 in half
258
-				$sizes = array(311.81, 623.62);
259
-				break;
260
-
261
-			// Untrimmed stock sizes for the ISO-A Series - ISO primary range
262
-			case 'RA0': // ISO 478, 860 mm x 1220 mm
263
-				$sizes = array(2437.80, 3458.27);
264
-				break;
265
-			case 'RA1': // ISO 478, 610 mm x 860 mm
266
-				$sizes = array(1729.13, 2437.80);
267
-				break;
268
-			case 'RA2': // ISO 478, 430 mm x 610 mm
269
-				$sizes = array(1218.90, 1729.13);
270
-				break;
271
-			case 'RA3': // ISO 478, 305 mm x 430 mm
272
-				$sizes = array(864.57, 1218.90);
273
-				break;
274
-			case 'RA4': // ISO 478, 215 mm x 305 mm
275
-				$sizes = array(609.45, 864.57);
276
-				break;
277
-
278
-			// Untrimmed stock sizes for the ISO-A Series - ISO supplementary range
279
-			case 'SRA0': // ISO 593, 900 mm x 1280 mm
280
-				$sizes = array(2551.18, 3628.35);
281
-				break;
282
-			case 'SRA1': // ISO 593, 640 mm x 900 mm
283
-				$sizes = array(1814.17, 2551.18);
284
-				break;
285
-			case 'SRA2': // ISO 593, 450 mm x 640 mm
286
-				$sizes = array(1275.59, 1814.17);
287
-				break;
288
-			case 'SRA3': // ISO 593, 320 mm x 450 mm
289
-				$sizes = array(907.09, 1275.59);
290
-				break;
291
-			case 'SRA4': // ISO 593, 225 mm x 320 mm
292
-				$sizes = array(637.80, 907.09);
293
-				break;
294
-
295
-			// ISO size variations
296
-			case 'A2EXTRA': // ISO 216, 445 mm x 619 mm
297
-				$sizes = array(1261.42, 1754.65);
298
-				break;
299
-			case 'A2SUPER': // ISO 216, 305 mm x 508 mm
300
-				$sizes = array(864.57, 1440.00);
301
-				break;
302
-			case 'A3EXTRA': // ISO 216, 322 mm x 445 mm
303
-				$sizes = array(912.76, 1261.42);
304
-				break;
305
-			case 'SUPERA3': // ISO 216, 305 mm x 487 mm
306
-				$sizes = array(864.57, 1380.47);
307
-				break;
308
-			case 'A4EXTRA': // ISO 216, 235 mm x 322 mm
309
-				$sizes = array(666.14, 912.76);
310
-				break;
311
-			case 'A4LONG': // ISO 216, 210 mm x 348 mm
312
-				$sizes = array(595.28, 986.46);
313
-				break;
314
-			case 'A4SUPER': // ISO 216, 229 mm x 322 mm
315
-				$sizes = array(649.13, 912.76);
316
-				break;
317
-			case 'SUPERA4': // ISO 216, 227 mm x 356 mm
318
-				$sizes = array(643.46, 1009.13);
319
-				break;
320
-			case 'A5EXTRA': // ISO 216, 173 mm x 235 mm
321
-				$sizes = array(490.39, 666.14);
322
-				break;
323
-			case 'SOB5EXTRA': // ISO 216, 202 mm x 276 mm
324
-				$sizes = array(572.60, 782.36);
325
-				break;
326
-
327
-			// Japanese version of the ISO 216 B series
328
-			case 'JB0': // JIS P 0138-61, 1030 mm x 1456 mm
329
-				$sizes = array(2919.69, 4127.24);
330
-				break;
331
-			case 'JB1': // JIS P 0138-61, 728 mm x 1030 mm
332
-				$sizes = array(2063.62, 2919.69);
333
-				break;
334
-			case 'JB2': // JIS P 0138-61, 515 mm x 728 mm
335
-				$sizes = array(1459.84, 2063.62);
336
-				break;
337
-			case 'JB3': // JIS P 0138-61, 364 mm x 515 mm
338
-				$sizes = array(1031.81, 1459.84);
339
-				break;
340
-			case 'JB4': // JIS P 0138-61, 257 mm x 364 mm
341
-				$sizes = array(728.50, 1031.81);
342
-				break;
343
-			case 'JB5': // JIS P 0138-61, 182 mm x 257 mm
344
-				$sizes = array(515.91, 728.50);
345
-				break;
346
-			case 'JB6': // JIS P 0138-61, 128 mm x 182 mm
347
-				$sizes = array(362.83, 515.91);
348
-				break;
349
-			case 'JB7': // JIS P 0138-61, 91 mm x 128 mm
350
-				$sizes = array(257.95, 362.83);
351
-				break;
352
-			case 'JB8': // JIS P 0138-61, 64 mm x 91 mm
353
-				$sizes = array(181.42, 257.95);
354
-				break;
355
-			case 'JB9': // JIS P 0138-61, 45 mm x 64 mm
356
-				$sizes = array(127.56, 181.42);
357
-				break;
358
-			case 'JB10': // JIS P 0138-61, 32 mm x 45 mm
359
-				$sizes = array(90.71, 127.56);
360
-				break;
361
-
362
-			// US pages
363
-			case 'EXECUTIVE': // 7.25 in x 10.5 in
364
-				$sizes = array(522.00, 756.00);
365
-				break;
366
-			case 'FOLIO': // 8.5 in x 13 in
367
-				$sizes = array(612.00, 936.00);
368
-				break;
369
-			case 'FOOLSCAP': // 13.5 in x 17 in
370
-				$sizes = array(972.00, 1224.00);
371
-				break;
372
-			case 'LEDGER': // 11 in x 17 in
373
-				$sizes = array(792.00, 1224.00);
374
-				break;
375
-			case 'LEGAL': // 8.5 in x 14 in
376
-				$sizes = array(612.00, 1008.00);
377
-				break;
378
-			case 'LETTER': // 8.5 in x 11 in
379
-				$sizes = array(612.00, 792.00);
380
-				break;
381
-			case 'QUARTO': // 8.46 in x 10.8 in
382
-				$sizes = array(609.12, 777.50);
383
-				break;
384
-			case 'STATEMENT': // 5.5 in x 8.5 in
385
-				$sizes = array(396.00, 612.00);
386
-				break;
387
-			case 'USGOVT': // 8 in x 11 in
388
-				$sizes = array(576.00, 792.00);
389
-				break;
390
-			default:
391
-				$this->pageFormat = 'A4';
392
-				$sizes            = array(595.28, 841.89);
393
-				break;
142
+			    case '4A0': // ISO 216, 1682 mm x 2378 mm
143
+				    $sizes = array(4767.86, 6740.79);
144
+				    break;
145
+			    case '2A0': // ISO 216, 1189 mm x 1682 mm
146
+				    $sizes = array(3370.39, 4767.86);
147
+				    break;
148
+			    case 'A0': // ISO 216, 841 mm x 1189mm
149
+				    $sizes = array(2383.94, 3370.39);
150
+				    break;
151
+			    case 'A1': // ISO 216, 594 mm x 841 mm
152
+				    $sizes = array(1683.78, 2383.94);
153
+				    break;
154
+			    case 'A2': // ISO 216, 420 mm x 594 mm
155
+				    $sizes = array(1190.55, 1683.78);
156
+				    break;
157
+			    case 'A3': // ISO 216, 297 mm x 420 mm
158
+				    $sizes = array(841.89, 1190.55);
159
+				    break;
160
+			    case 'A4': // ISO 216, 210 mm 297 mm
161
+				    $sizes = array(595.28, 841.89);
162
+				    break;
163
+			    case 'A5': // ISO 216, 148 mm x 210 mm
164
+				    $sizes = array(419.53, 595.28);
165
+				    break;
166
+			    case 'A6': // ISO 216, 105 mm x 148 mm
167
+				    $sizes = array(297.64, 419.53);
168
+				    break;
169
+			    case 'A7': // ISO 216, 74 mm x 105 mm
170
+				    $sizes = array(209.76, 297.64);
171
+				    break;
172
+			    case 'A8': // ISO 216, 52 mm x 74 mm
173
+				    $sizes = array(147.40, 209.76);
174
+				    break;
175
+			    case 'A9': // ISO 216, 37 mm x 52 mm
176
+				    $sizes = array(104.88, 147.40);
177
+				    break;
178
+			    case 'A10': // ISO 216, 26 mm x 37 mm
179
+				    $sizes = array(73.70, 104.88);
180
+				    break;
181
+
182
+			    // ISO B series
183
+			    case 'B0': // ISO 216, 1000 mm x 1414 mm
184
+				    $sizes = array(2834.65, 4008.19);
185
+				    break;
186
+			    case 'B1': // ISO 216, 707 mm x 1000 mm
187
+				    $sizes = array(2004.09, 2834.65);
188
+				    break;
189
+			    case 'B2': // ISO 216, 500 mm x 707 mm
190
+				    $sizes = array(1417.32, 2004.09);
191
+				    break;
192
+			    case 'B3': // ISO 216, 353 mm x 500 mm
193
+				    $sizes = array(1000.63, 1417.32);
194
+				    break;
195
+			    case 'B4': // ISO 216, 250 mm x 353 mm
196
+				    $sizes = array(708.66, 1000.63);
197
+				    break;
198
+			    case 'B5': // ISO 216, 176 mm x 250 mm
199
+				    $sizes = array(498.90, 708.66);
200
+				    break;
201
+			    case 'B6': // ISO 216, 125 mm x 176 mm
202
+				    $sizes = array(354.33, 498.90);
203
+				    break;
204
+			    case 'B7': // ISO 216, 88 mm x 125 mm
205
+				    $sizes = array(249.45, 354.33);
206
+				    break;
207
+			    case 'B8': // ISO 216, 62 mm x 88 mm
208
+				    $sizes = array(175.75, 249.45);
209
+				    break;
210
+			    case 'B9': // ISO 216, 44 mm x 62 mm
211
+				    $sizes = array(124.72, 175.75);
212
+				    break;
213
+			    case 'B10': // ISO 216, 31 mm x 44 mm
214
+				    $sizes = array(87.87, 124.72);
215
+				    break;
216
+
217
+			    // ISO C series, Envelope
218
+			    case 'C0': // ISO 269, 917 mm x 1297 mm, For flat A0 sheet
219
+				    $sizes = array(2599.37, 3676.54);
220
+				    break;
221
+			    case 'C1': // ISO 269, 648 mm x 917 mm, For flat A1 sheet
222
+				    $sizes = array(1836.85, 2599.37);
223
+				    break;
224
+			    case 'C2': // ISO 269, 458 mm x 648 mm, For flat A2 sheet, A1 folded in half
225
+				    $sizes = array(1298.27, 1836.85);
226
+				    break;
227
+			    case 'C3': // ISO 269, 324 mm x 458 mm, For flat A3 sheet, A2 folded in half
228
+				    $sizes = array(918.43, 1298.27);
229
+				    break;
230
+			    case 'C4': // ISO 269, 229 mm x 324 mm, For flat A4 sheet, A3 folded in half
231
+				    $sizes = array(649.13, 918.43);
232
+				    break;
233
+			    case 'C5': // ISO 269, 162 mm x 229 mm, For flat A5 sheet, A4 folded in half
234
+				    $sizes = array(459.21, 649.13);
235
+				    break;
236
+			    case 'C6/5': // ISO 269, 114 mm x 229 mm. A5 folded twice = 1/3 A4. Alternative for the DL envelope
237
+				    $sizes = array(323.15, 649.13);
238
+				    break;
239
+			    case 'C6': // ISO 269, 114 mm x 162 mm, For A5 folded in half
240
+				    $sizes = array(323.15, 459.21);
241
+				    break;
242
+			    case 'C7/6': // ISO 269, 81 mm x 162 mm, For A5 sheet folded in thirds
243
+				    $sizes = array(229.61, 459.21);
244
+				    break;
245
+			    case 'C7': // ISO 269, 81 mm x 114 mm, For A5 folded in quarters
246
+				    $sizes = array(229.61, 323.15);
247
+				    break;
248
+			    case 'C8': // ISO 269, 57 mm x 81 mm
249
+				    $sizes = array(161.57, 229.61);
250
+				    break;
251
+			    case 'C9': // ISO 269, 40 mm x 57 mm
252
+				    $sizes = array(113.39, 161.57);
253
+				    break;
254
+			    case 'C10': // ISO 269, 28 mm x 40 mm
255
+				    $sizes = array(79.37, 113.39);
256
+				    break;
257
+			    case 'DL': // Original DIN 678 but ISO 269 now has this C6/5 , 110 mm x 220 mm, For A4 sheet folded in thirds, A5 in half
258
+				    $sizes = array(311.81, 623.62);
259
+				    break;
260
+
261
+			    // Untrimmed stock sizes for the ISO-A Series - ISO primary range
262
+			    case 'RA0': // ISO 478, 860 mm x 1220 mm
263
+				    $sizes = array(2437.80, 3458.27);
264
+				    break;
265
+			    case 'RA1': // ISO 478, 610 mm x 860 mm
266
+				    $sizes = array(1729.13, 2437.80);
267
+				    break;
268
+			    case 'RA2': // ISO 478, 430 mm x 610 mm
269
+				    $sizes = array(1218.90, 1729.13);
270
+				    break;
271
+			    case 'RA3': // ISO 478, 305 mm x 430 mm
272
+				    $sizes = array(864.57, 1218.90);
273
+				    break;
274
+			    case 'RA4': // ISO 478, 215 mm x 305 mm
275
+				    $sizes = array(609.45, 864.57);
276
+				    break;
277
+
278
+			    // Untrimmed stock sizes for the ISO-A Series - ISO supplementary range
279
+			    case 'SRA0': // ISO 593, 900 mm x 1280 mm
280
+				    $sizes = array(2551.18, 3628.35);
281
+				    break;
282
+			    case 'SRA1': // ISO 593, 640 mm x 900 mm
283
+				    $sizes = array(1814.17, 2551.18);
284
+				    break;
285
+			    case 'SRA2': // ISO 593, 450 mm x 640 mm
286
+				    $sizes = array(1275.59, 1814.17);
287
+				    break;
288
+			    case 'SRA3': // ISO 593, 320 mm x 450 mm
289
+				    $sizes = array(907.09, 1275.59);
290
+				    break;
291
+			    case 'SRA4': // ISO 593, 225 mm x 320 mm
292
+				    $sizes = array(637.80, 907.09);
293
+				    break;
294
+
295
+			    // ISO size variations
296
+			    case 'A2EXTRA': // ISO 216, 445 mm x 619 mm
297
+				    $sizes = array(1261.42, 1754.65);
298
+				    break;
299
+			    case 'A2SUPER': // ISO 216, 305 mm x 508 mm
300
+				    $sizes = array(864.57, 1440.00);
301
+				    break;
302
+			    case 'A3EXTRA': // ISO 216, 322 mm x 445 mm
303
+				    $sizes = array(912.76, 1261.42);
304
+				    break;
305
+			    case 'SUPERA3': // ISO 216, 305 mm x 487 mm
306
+				    $sizes = array(864.57, 1380.47);
307
+				    break;
308
+			    case 'A4EXTRA': // ISO 216, 235 mm x 322 mm
309
+				    $sizes = array(666.14, 912.76);
310
+				    break;
311
+			    case 'A4LONG': // ISO 216, 210 mm x 348 mm
312
+				    $sizes = array(595.28, 986.46);
313
+				    break;
314
+			    case 'A4SUPER': // ISO 216, 229 mm x 322 mm
315
+				    $sizes = array(649.13, 912.76);
316
+				    break;
317
+			    case 'SUPERA4': // ISO 216, 227 mm x 356 mm
318
+				    $sizes = array(643.46, 1009.13);
319
+				    break;
320
+			    case 'A5EXTRA': // ISO 216, 173 mm x 235 mm
321
+				    $sizes = array(490.39, 666.14);
322
+				    break;
323
+			    case 'SOB5EXTRA': // ISO 216, 202 mm x 276 mm
324
+				    $sizes = array(572.60, 782.36);
325
+				    break;
326
+
327
+			    // Japanese version of the ISO 216 B series
328
+			    case 'JB0': // JIS P 0138-61, 1030 mm x 1456 mm
329
+				    $sizes = array(2919.69, 4127.24);
330
+				    break;
331
+			    case 'JB1': // JIS P 0138-61, 728 mm x 1030 mm
332
+				    $sizes = array(2063.62, 2919.69);
333
+				    break;
334
+			    case 'JB2': // JIS P 0138-61, 515 mm x 728 mm
335
+				    $sizes = array(1459.84, 2063.62);
336
+				    break;
337
+			    case 'JB3': // JIS P 0138-61, 364 mm x 515 mm
338
+				    $sizes = array(1031.81, 1459.84);
339
+				    break;
340
+			    case 'JB4': // JIS P 0138-61, 257 mm x 364 mm
341
+				    $sizes = array(728.50, 1031.81);
342
+				    break;
343
+			    case 'JB5': // JIS P 0138-61, 182 mm x 257 mm
344
+				    $sizes = array(515.91, 728.50);
345
+				    break;
346
+			    case 'JB6': // JIS P 0138-61, 128 mm x 182 mm
347
+				    $sizes = array(362.83, 515.91);
348
+				    break;
349
+			    case 'JB7': // JIS P 0138-61, 91 mm x 128 mm
350
+				    $sizes = array(257.95, 362.83);
351
+				    break;
352
+			    case 'JB8': // JIS P 0138-61, 64 mm x 91 mm
353
+				    $sizes = array(181.42, 257.95);
354
+				    break;
355
+			    case 'JB9': // JIS P 0138-61, 45 mm x 64 mm
356
+				    $sizes = array(127.56, 181.42);
357
+				    break;
358
+			    case 'JB10': // JIS P 0138-61, 32 mm x 45 mm
359
+				    $sizes = array(90.71, 127.56);
360
+				    break;
361
+
362
+			    // US pages
363
+			    case 'EXECUTIVE': // 7.25 in x 10.5 in
364
+				    $sizes = array(522.00, 756.00);
365
+				    break;
366
+			    case 'FOLIO': // 8.5 in x 13 in
367
+				    $sizes = array(612.00, 936.00);
368
+				    break;
369
+			    case 'FOOLSCAP': // 13.5 in x 17 in
370
+				    $sizes = array(972.00, 1224.00);
371
+				    break;
372
+			    case 'LEDGER': // 11 in x 17 in
373
+				    $sizes = array(792.00, 1224.00);
374
+				    break;
375
+			    case 'LEGAL': // 8.5 in x 14 in
376
+				    $sizes = array(612.00, 1008.00);
377
+				    break;
378
+			    case 'LETTER': // 8.5 in x 11 in
379
+				    $sizes = array(612.00, 792.00);
380
+				    break;
381
+			    case 'QUARTO': // 8.46 in x 10.8 in
382
+				    $sizes = array(609.12, 777.50);
383
+				    break;
384
+			    case 'STATEMENT': // 5.5 in x 8.5 in
385
+				    $sizes = array(396.00, 612.00);
386
+				    break;
387
+			    case 'USGOVT': // 8 in x 11 in
388
+				    $sizes = array(576.00, 792.00);
389
+				    break;
390
+			    default:
391
+				    $this->pageFormat = 'A4';
392
+				    $sizes            = array(595.28, 841.89);
393
+				    break;
394 394
 			}
395 395
 			$this->pagew = $sizes[0];
396 396
 			$this->pageh = $sizes[1];
Please login to merge, or discard this patch.
app/Report/ReportParserGenerate.php 1 patch
Switch Indentation   +332 added lines, -332 removed lines patch added patch discarded remove patch
@@ -934,14 +934,14 @@  discard block
 block discarded – undo
934 934
 				$tags  = preg_split('/[: ]/', $tag);
935 935
 				$value = $this->getGedcomValue($tag, $level, $this->gedrec);
936 936
 				switch (end($tags)) {
937
-				case 'DATE':
938
-					$tmp   = new Date($value);
939
-					$value = $tmp->display();
940
-					break;
941
-				case 'PLAC':
942
-					$tmp   = new Place($value, $WT_TREE);
943
-					$value = $tmp->getShortName();
944
-					break;
937
+				    case 'DATE':
938
+					    $tmp   = new Date($value);
939
+					    $value = $tmp->display();
940
+					    break;
941
+				    case 'PLAC':
942
+					    $tmp   = new Place($value, $WT_TREE);
943
+					    $value = $tmp->getShortName();
944
+					    break;
945 945
 				}
946 946
 				if ($useBreak == "1") {
947 947
 					// Insert <br> when multiple dates exist.
@@ -1335,22 +1335,22 @@  discard block
 block discarded – undo
1335 1335
 		// Arithmetic functions
1336 1336
 		if (preg_match("/(\d+)\s*([\-\+\*\/])\s*(\d+)/", $value, $match)) {
1337 1337
 			switch ($match[2]) {
1338
-			case "+":
1339
-				$t     = $match[1] + $match[3];
1340
-				$value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
1341
-				break;
1342
-			case "-":
1343
-				$t     = $match[1] - $match[3];
1344
-				$value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
1345
-				break;
1346
-			case "*":
1347
-				$t     = $match[1] * $match[3];
1348
-				$value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
1349
-				break;
1350
-			case "/":
1351
-				$t     = $match[1] / $match[3];
1352
-				$value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
1353
-				break;
1338
+			    case "+":
1339
+				    $t     = $match[1] + $match[3];
1340
+				    $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
1341
+				    break;
1342
+			    case "-":
1343
+				    $t     = $match[1] - $match[3];
1344
+				    $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
1345
+				    break;
1346
+			    case "*":
1347
+				    $t     = $match[1] * $match[3];
1348
+				    $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
1349
+				    break;
1350
+			    case "/":
1351
+				    $t     = $match[1] / $match[3];
1352
+				    $value = preg_replace("/" . $match[1] . "\s*([\-\+\*\/])\s*" . $match[3] . "/", $t, $value);
1353
+				    break;
1354 1354
 			}
1355 1355
 		}
1356 1356
 		if (strpos($value, "@") !== false) {
@@ -1859,180 +1859,180 @@  discard block
 block discarded – undo
1859 1859
 		}
1860 1860
 		// Some filters/sorts can be applied using SQL, while others require PHP
1861 1861
 		switch ($listname) {
1862
-		case "pending":
1863
-			$rows = Database::prepare(
1864
-				"SELECT xref, CASE new_gedcom WHEN '' THEN old_gedcom ELSE new_gedcom END AS gedcom" .
1865
-				" FROM `##change`" . " WHERE (xref, change_id) IN (" .
1866
-				"  SELECT xref, MAX(change_id)" .
1867
-				"  FROM `##change`" .
1868
-				"  WHERE status = 'pending' AND gedcom_id = :tree_id" .
1869
-				"  GROUP BY xref" .
1870
-				" )"
1871
-			)->execute(array(
1872
-				'tree_id' => $WT_TREE->getTreeId(),
1873
-			))->fetchAll();
1874
-			$this->list = array();
1875
-			foreach ($rows as $row) {
1876
-				$this->list[] = GedcomRecord::getInstance($row->xref, $WT_TREE, $row->gedcom);
1877
-			}
1878
-			break;
1879
-		case 'individual':
1880
-			$sql_select   = "SELECT i_id AS xref, i_gedcom AS gedcom FROM `##individuals` ";
1881
-			$sql_join     = "";
1882
-			$sql_where    = " WHERE i_file = :tree_id";
1883
-			$sql_order_by = "";
1884
-			$sql_params   = array('tree_id' => $WT_TREE->getTreeId());
1885
-			foreach ($attrs as $attr => $value) {
1886
-				if (strpos($attr, 'filter') === 0 && $value) {
1887
-					$value = $this->substituteVars($value, false);
1888
-					// Convert the various filters into SQL
1889
-					if (preg_match('/^(\w+):DATE (LTE|GTE) (.+)$/', $value, $match)) {
1890
-						$sql_join .= " JOIN `##dates` AS {$attr} ON ({$attr}.d_file=i_file AND {$attr}.d_gid=i_id)";
1891
-						$sql_where .= " AND {$attr}.d_fact = :{$attr}fact";
1892
-						$sql_params[$attr . 'fact'] = $match[1];
1893
-						$date                       = new Date($match[3]);
1894
-						if ($match[2] == "LTE") {
1895
-							$sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date";
1896
-							$sql_params[$attr . 'date'] = $date->maximumJulianDay();
1897
-						} else {
1898
-							$sql_where .= " AND {$attr}.d_julianday1 >= :{$attr}date";
1899
-							$sql_params[$attr . 'date'] = $date->minimumJulianDay();
1900
-						}
1901
-						if ($sortby == $match[1]) {
1902
-							$sortby = "";
1903
-							$sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1";
1904
-						}
1905
-						unset($attrs[$attr]); // This filter has been fully processed
1906
-					} elseif (preg_match('/^NAME CONTAINS (.*)$/', $value, $match)) {
1907
-						// Do nothing, unless you have to
1908
-						if ($match[1] != '' || $sortby == 'NAME') {
1909
-							$sql_join .= " JOIN `##name` AS {$attr} ON (n_file=i_file AND n_id=i_id)";
1910
-							// Search the DB only if there is any name supplied
1911
-							if ($match[1] != "") {
1912
-								$names = explode(" ", $match[1]);
1913
-								foreach ($names as $n => $name) {
1914
-									$sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')";
1915
-									$sql_params[$attr . 'name' . $n] = $name;
1916
-								}
1917
-							}
1918
-							// Let the DB do the name sorting even when no name was entered
1919
-							if ($sortby == "NAME") {
1920
-								$sortby = "";
1921
-								$sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.n_sort";
1922
-							}
1923
-						}
1924
-						unset($attrs[$attr]); // This filter has been fully processed
1925
-					} elseif (preg_match('/^REGEXP \/(.+)\//', $value, $match)) {
1926
-						$sql_where .= " AND i_gedcom REGEXP :{$attr}gedcom";
1927
-						// PDO helpfully escapes backslashes for us, preventing us from matching "\n1 FACT"
1928
-						$sql_params[$attr . 'gedcom'] = str_replace('\n', "\n", $match[1]);
1929
-						unset($attrs[$attr]); // This filter has been fully processed
1930
-					} elseif (preg_match('/^(?:\w+):PLAC CONTAINS (.+)$/', $value, $match)) {
1931
-						$sql_join .= " JOIN `##places` AS {$attr}a ON ({$attr}a.p_file = i_file)";
1932
-						$sql_join .= " JOIN `##placelinks` AS {$attr}b ON ({$attr}a.p_file = {$attr}b.pl_file AND {$attr}b.pl_p_id = {$attr}a.p_id AND {$attr}b.pl_gid = i_id)";
1933
-						$sql_where .= " AND {$attr}a.p_place LIKE CONCAT('%', :{$attr}place, '%')";
1934
-						$sql_params[$attr . 'place'] = $match[1];
1935
-						// Don't unset this filter. This is just initial filtering
1936
-					} elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) {
1937
-						$sql_where .= " AND i_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')";
1938
-						$sql_params[$attr . 'contains1'] = $match[1];
1939
-						$sql_params[$attr . 'contains2'] = $match[2];
1940
-						$sql_params[$attr . 'contains3'] = $match[3];
1941
-						// Don't unset this filter. This is just initial filtering
1942
-					}
1943
-				}
1944
-			}
1945
-
1946
-			$this->list = array();
1947
-			$rows       = Database::prepare(
1948
-				$sql_select . $sql_join . $sql_where . $sql_order_by
1949
-			)->execute($sql_params)->fetchAll();
1950
-
1951
-			foreach ($rows as $row) {
1952
-				$this->list[$row->xref] = Individual::getInstance($row->xref, $WT_TREE, $row->gedcom);
1953
-			}
1954
-			break;
1955
-
1956
-		case 'family':
1957
-			$sql_select   = "SELECT f_id AS xref, f_gedcom AS gedcom FROM `##families`";
1958
-			$sql_join     = "";
1959
-			$sql_where    = " WHERE f_file = :tree_id";
1960
-			$sql_order_by = "";
1961
-			$sql_params   = array('tree_id' => $WT_TREE->getTreeId());
1962
-			foreach ($attrs as $attr => $value) {
1963
-				if (strpos($attr, 'filter') === 0 && $value) {
1964
-					$value = $this->substituteVars($value, false);
1965
-					// Convert the various filters into SQL
1966
-					if (preg_match('/^(\w+):DATE (LTE|GTE) (.+)$/', $value, $match)) {
1967
-						$sql_join .= " JOIN `##dates` AS {$attr} ON ({$attr}.d_file=f_file AND {$attr}.d_gid=f_id)";
1968
-						$sql_where .= " AND {$attr}.d_fact = :{$attr}fact";
1969
-						$sql_params[$attr . 'fact'] = $match[1];
1970
-						$date                       = new Date($match[3]);
1971
-						if ($match[2] == "LTE") {
1972
-							$sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date";
1973
-							$sql_params[$attr . 'date'] = $date->maximumJulianDay();
1974
-						} else {
1975
-							$sql_where .= " AND {$attr}.d_julianday1 >= :{$attr}date";
1976
-							$sql_params[$attr . 'date'] = $date->minimumJulianDay();
1977
-						}
1978
-						if ($sortby == $match[1]) {
1979
-							$sortby = "";
1980
-							$sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1";
1981
-						}
1982
-						unset($attrs[$attr]); // This filter has been fully processed
1983
-					} elseif (preg_match('/^REGEXP \/(.+)\//', $value, $match)) {
1984
-						$sql_where .= " AND f_gedcom REGEXP :{$attr}gedcom";
1985
-						// PDO helpfully escapes backslashes for us, preventing us from matching "\n1 FACT"
1986
-						$sql_params[$attr . 'gedcom'] = str_replace('\n', "\n", $match[1]);
1987
-						unset($attrs[$attr]); // This filter has been fully processed
1988
-					} elseif (preg_match('/^NAME CONTAINS (.+)$/', $value, $match)) {
1989
-						// Do nothing, unless you have to
1990
-						if ($match[1] != '' || $sortby == 'NAME') {
1991
-							$sql_join .= " JOIN `##name` AS {$attr} ON n_file = f_file AND n_id IN (f_husb, f_wife)";
1992
-							// Search the DB only if there is any name supplied
1993
-							if ($match[1] != "") {
1994
-								$names = explode(" ", $match[1]);
1995
-								foreach ($names as $n => $name) {
1996
-									$sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')";
1997
-									$sql_params[$attr . 'name' . $n] = $name;
1998
-								}
1999
-							}
2000
-							// Let the DB do the name sorting even when no name was entered
2001
-							if ($sortby == "NAME") {
2002
-								$sortby = "";
2003
-								$sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.n_sort";
2004
-							}
2005
-						}
2006
-						unset($attrs[$attr]); // This filter has been fully processed
2007
-
2008
-					} elseif (preg_match('/^(?:\w+):PLAC CONTAINS (.+)$/', $value, $match)) {
2009
-						$sql_join .= " JOIN `##places` AS {$attr}a ON ({$attr}a.p_file=f_file)";
2010
-						$sql_join .= " JOIN `##placelinks` AS {$attr}b ON ({$attr}a.p_file={$attr}b.pl_file AND {$attr}b.pl_p_id={$attr}a.p_id AND {$attr}b.pl_gid=f_id)";
2011
-						$sql_where .= " AND {$attr}a.p_place LIKE CONCAT('%', :{$attr}place, '%')";
2012
-						$sql_params[$attr . 'place'] = $match[1];
2013
-						// Don't unset this filter. This is just initial filtering
2014
-					} elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) {
2015
-						$sql_where .= " AND f_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')";
2016
-						$sql_params[$attr . 'contains1'] = $match[1];
2017
-						$sql_params[$attr . 'contains2'] = $match[2];
2018
-						$sql_params[$attr . 'contains3'] = $match[3];
2019
-						// Don't unset this filter. This is just initial filtering
2020
-					}
2021
-				}
2022
-			}
2023
-
2024
-			$this->list = array();
2025
-			$rows       = Database::prepare(
2026
-				$sql_select . $sql_join . $sql_where . $sql_order_by
2027
-			)->execute($sql_params)->fetchAll();
2028
-
2029
-			foreach ($rows as $row) {
2030
-				$this->list[$row->xref] = Family::getInstance($row->xref, $WT_TREE, $row->gedcom);
2031
-			}
2032
-			break;
2033
-
2034
-		default:
2035
-			throw new \DomainException('Invalid list name: ' . $listname);
1862
+		    case "pending":
1863
+			    $rows = Database::prepare(
1864
+				    "SELECT xref, CASE new_gedcom WHEN '' THEN old_gedcom ELSE new_gedcom END AS gedcom" .
1865
+				    " FROM `##change`" . " WHERE (xref, change_id) IN (" .
1866
+				    "  SELECT xref, MAX(change_id)" .
1867
+				    "  FROM `##change`" .
1868
+				    "  WHERE status = 'pending' AND gedcom_id = :tree_id" .
1869
+				    "  GROUP BY xref" .
1870
+				    " )"
1871
+			    )->execute(array(
1872
+				    'tree_id' => $WT_TREE->getTreeId(),
1873
+			    ))->fetchAll();
1874
+			    $this->list = array();
1875
+			    foreach ($rows as $row) {
1876
+				    $this->list[] = GedcomRecord::getInstance($row->xref, $WT_TREE, $row->gedcom);
1877
+			    }
1878
+			    break;
1879
+		    case 'individual':
1880
+			    $sql_select   = "SELECT i_id AS xref, i_gedcom AS gedcom FROM `##individuals` ";
1881
+			    $sql_join     = "";
1882
+			    $sql_where    = " WHERE i_file = :tree_id";
1883
+			    $sql_order_by = "";
1884
+			    $sql_params   = array('tree_id' => $WT_TREE->getTreeId());
1885
+			    foreach ($attrs as $attr => $value) {
1886
+				    if (strpos($attr, 'filter') === 0 && $value) {
1887
+					    $value = $this->substituteVars($value, false);
1888
+					    // Convert the various filters into SQL
1889
+					    if (preg_match('/^(\w+):DATE (LTE|GTE) (.+)$/', $value, $match)) {
1890
+						    $sql_join .= " JOIN `##dates` AS {$attr} ON ({$attr}.d_file=i_file AND {$attr}.d_gid=i_id)";
1891
+						    $sql_where .= " AND {$attr}.d_fact = :{$attr}fact";
1892
+						    $sql_params[$attr . 'fact'] = $match[1];
1893
+						    $date                       = new Date($match[3]);
1894
+						    if ($match[2] == "LTE") {
1895
+							    $sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date";
1896
+							    $sql_params[$attr . 'date'] = $date->maximumJulianDay();
1897
+						    } else {
1898
+							    $sql_where .= " AND {$attr}.d_julianday1 >= :{$attr}date";
1899
+							    $sql_params[$attr . 'date'] = $date->minimumJulianDay();
1900
+						    }
1901
+						    if ($sortby == $match[1]) {
1902
+							    $sortby = "";
1903
+							    $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1";
1904
+						    }
1905
+						    unset($attrs[$attr]); // This filter has been fully processed
1906
+					    } elseif (preg_match('/^NAME CONTAINS (.*)$/', $value, $match)) {
1907
+						    // Do nothing, unless you have to
1908
+						    if ($match[1] != '' || $sortby == 'NAME') {
1909
+							    $sql_join .= " JOIN `##name` AS {$attr} ON (n_file=i_file AND n_id=i_id)";
1910
+							    // Search the DB only if there is any name supplied
1911
+							    if ($match[1] != "") {
1912
+								    $names = explode(" ", $match[1]);
1913
+								    foreach ($names as $n => $name) {
1914
+									    $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')";
1915
+									    $sql_params[$attr . 'name' . $n] = $name;
1916
+								    }
1917
+							    }
1918
+							    // Let the DB do the name sorting even when no name was entered
1919
+							    if ($sortby == "NAME") {
1920
+								    $sortby = "";
1921
+								    $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.n_sort";
1922
+							    }
1923
+						    }
1924
+						    unset($attrs[$attr]); // This filter has been fully processed
1925
+					    } elseif (preg_match('/^REGEXP \/(.+)\//', $value, $match)) {
1926
+						    $sql_where .= " AND i_gedcom REGEXP :{$attr}gedcom";
1927
+						    // PDO helpfully escapes backslashes for us, preventing us from matching "\n1 FACT"
1928
+						    $sql_params[$attr . 'gedcom'] = str_replace('\n', "\n", $match[1]);
1929
+						    unset($attrs[$attr]); // This filter has been fully processed
1930
+					    } elseif (preg_match('/^(?:\w+):PLAC CONTAINS (.+)$/', $value, $match)) {
1931
+						    $sql_join .= " JOIN `##places` AS {$attr}a ON ({$attr}a.p_file = i_file)";
1932
+						    $sql_join .= " JOIN `##placelinks` AS {$attr}b ON ({$attr}a.p_file = {$attr}b.pl_file AND {$attr}b.pl_p_id = {$attr}a.p_id AND {$attr}b.pl_gid = i_id)";
1933
+						    $sql_where .= " AND {$attr}a.p_place LIKE CONCAT('%', :{$attr}place, '%')";
1934
+						    $sql_params[$attr . 'place'] = $match[1];
1935
+						    // Don't unset this filter. This is just initial filtering
1936
+					    } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) {
1937
+						    $sql_where .= " AND i_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')";
1938
+						    $sql_params[$attr . 'contains1'] = $match[1];
1939
+						    $sql_params[$attr . 'contains2'] = $match[2];
1940
+						    $sql_params[$attr . 'contains3'] = $match[3];
1941
+						    // Don't unset this filter. This is just initial filtering
1942
+					    }
1943
+				    }
1944
+			    }
1945
+
1946
+			    $this->list = array();
1947
+			    $rows       = Database::prepare(
1948
+				    $sql_select . $sql_join . $sql_where . $sql_order_by
1949
+			    )->execute($sql_params)->fetchAll();
1950
+
1951
+			    foreach ($rows as $row) {
1952
+				    $this->list[$row->xref] = Individual::getInstance($row->xref, $WT_TREE, $row->gedcom);
1953
+			    }
1954
+			    break;
1955
+
1956
+		    case 'family':
1957
+			    $sql_select   = "SELECT f_id AS xref, f_gedcom AS gedcom FROM `##families`";
1958
+			    $sql_join     = "";
1959
+			    $sql_where    = " WHERE f_file = :tree_id";
1960
+			    $sql_order_by = "";
1961
+			    $sql_params   = array('tree_id' => $WT_TREE->getTreeId());
1962
+			    foreach ($attrs as $attr => $value) {
1963
+				    if (strpos($attr, 'filter') === 0 && $value) {
1964
+					    $value = $this->substituteVars($value, false);
1965
+					    // Convert the various filters into SQL
1966
+					    if (preg_match('/^(\w+):DATE (LTE|GTE) (.+)$/', $value, $match)) {
1967
+						    $sql_join .= " JOIN `##dates` AS {$attr} ON ({$attr}.d_file=f_file AND {$attr}.d_gid=f_id)";
1968
+						    $sql_where .= " AND {$attr}.d_fact = :{$attr}fact";
1969
+						    $sql_params[$attr . 'fact'] = $match[1];
1970
+						    $date                       = new Date($match[3]);
1971
+						    if ($match[2] == "LTE") {
1972
+							    $sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date";
1973
+							    $sql_params[$attr . 'date'] = $date->maximumJulianDay();
1974
+						    } else {
1975
+							    $sql_where .= " AND {$attr}.d_julianday1 >= :{$attr}date";
1976
+							    $sql_params[$attr . 'date'] = $date->minimumJulianDay();
1977
+						    }
1978
+						    if ($sortby == $match[1]) {
1979
+							    $sortby = "";
1980
+							    $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.d_julianday1";
1981
+						    }
1982
+						    unset($attrs[$attr]); // This filter has been fully processed
1983
+					    } elseif (preg_match('/^REGEXP \/(.+)\//', $value, $match)) {
1984
+						    $sql_where .= " AND f_gedcom REGEXP :{$attr}gedcom";
1985
+						    // PDO helpfully escapes backslashes for us, preventing us from matching "\n1 FACT"
1986
+						    $sql_params[$attr . 'gedcom'] = str_replace('\n', "\n", $match[1]);
1987
+						    unset($attrs[$attr]); // This filter has been fully processed
1988
+					    } elseif (preg_match('/^NAME CONTAINS (.+)$/', $value, $match)) {
1989
+						    // Do nothing, unless you have to
1990
+						    if ($match[1] != '' || $sortby == 'NAME') {
1991
+							    $sql_join .= " JOIN `##name` AS {$attr} ON n_file = f_file AND n_id IN (f_husb, f_wife)";
1992
+							    // Search the DB only if there is any name supplied
1993
+							    if ($match[1] != "") {
1994
+								    $names = explode(" ", $match[1]);
1995
+								    foreach ($names as $n => $name) {
1996
+									    $sql_where .= " AND {$attr}.n_full LIKE CONCAT('%', :{$attr}name{$n}, '%')";
1997
+									    $sql_params[$attr . 'name' . $n] = $name;
1998
+								    }
1999
+							    }
2000
+							    // Let the DB do the name sorting even when no name was entered
2001
+							    if ($sortby == "NAME") {
2002
+								    $sortby = "";
2003
+								    $sql_order_by .= ($sql_order_by ? ", " : " ORDER BY ") . "{$attr}.n_sort";
2004
+							    }
2005
+						    }
2006
+						    unset($attrs[$attr]); // This filter has been fully processed
2007
+
2008
+					    } elseif (preg_match('/^(?:\w+):PLAC CONTAINS (.+)$/', $value, $match)) {
2009
+						    $sql_join .= " JOIN `##places` AS {$attr}a ON ({$attr}a.p_file=f_file)";
2010
+						    $sql_join .= " JOIN `##placelinks` AS {$attr}b ON ({$attr}a.p_file={$attr}b.pl_file AND {$attr}b.pl_p_id={$attr}a.p_id AND {$attr}b.pl_gid=f_id)";
2011
+						    $sql_where .= " AND {$attr}a.p_place LIKE CONCAT('%', :{$attr}place, '%')";
2012
+						    $sql_params[$attr . 'place'] = $match[1];
2013
+						    // Don't unset this filter. This is just initial filtering
2014
+					    } elseif (preg_match('/^(\w*):*(\w*) CONTAINS (.+)$/', $value, $match)) {
2015
+						    $sql_where .= " AND f_gedcom LIKE CONCAT('%', :{$attr}contains1, '%', :{$attr}contains2, '%', :{$attr}contains3, '%')";
2016
+						    $sql_params[$attr . 'contains1'] = $match[1];
2017
+						    $sql_params[$attr . 'contains2'] = $match[2];
2018
+						    $sql_params[$attr . 'contains3'] = $match[3];
2019
+						    // Don't unset this filter. This is just initial filtering
2020
+					    }
2021
+				    }
2022
+			    }
2023
+
2024
+			    $this->list = array();
2025
+			    $rows       = Database::prepare(
2026
+				    $sql_select . $sql_join . $sql_where . $sql_order_by
2027
+			    )->execute($sql_params)->fetchAll();
2028
+
2029
+			    foreach ($rows as $row) {
2030
+				    $this->list[$row->xref] = Family::getInstance($row->xref, $WT_TREE, $row->gedcom);
2031
+			    }
2032
+			    break;
2033
+
2034
+		    default:
2035
+			    throw new \DomainException('Invalid list name: ' . $listname);
2036 2036
 		}
2037 2037
 
2038 2038
 		$filters  = array();
@@ -2093,17 +2093,17 @@  discard block
 block discarded – undo
2093 2093
 								$searchstr = "1 " . $tag;
2094 2094
 							}
2095 2095
 							switch ($expr) {
2096
-							case "CONTAINS":
2097
-								if ($t == "PLAC") {
2098
-									$searchstr .= "[^\n]*[, ]*" . $val;
2099
-								} else {
2100
-									$searchstr .= "[^\n]*" . $val;
2101
-								}
2102
-								$filters[] = $searchstr;
2103
-								break;
2104
-							default:
2105
-								$filters2[] = array("tag" => $tag, "expr" => $expr, "val" => $val);
2106
-								break;
2096
+							    case "CONTAINS":
2097
+								    if ($t == "PLAC") {
2098
+									    $searchstr .= "[^\n]*[, ]*" . $val;
2099
+								    } else {
2100
+									    $searchstr .= "[^\n]*" . $val;
2101
+								    }
2102
+								    $filters[] = $searchstr;
2103
+								    break;
2104
+							    default:
2105
+								    $filters2[] = array("tag" => $tag, "expr" => $expr, "val" => $val);
2106
+								    break;
2107 2107
 							}
2108 2108
 						}
2109 2109
 					}
@@ -2147,31 +2147,31 @@  discard block
 block discarded – undo
2147 2147
 						}
2148 2148
 
2149 2149
 						switch ($expr) {
2150
-						case "GTE":
2151
-							if ($t == "DATE") {
2152
-								$date1 = new Date($v);
2153
-								$date2 = new Date($val);
2154
-								$keep  = (Date::compare($date1, $date2) >= 0);
2155
-							} elseif ($val >= $v) {
2156
-								$keep = true;
2157
-							}
2158
-							break;
2159
-						case "LTE":
2160
-							if ($t == "DATE") {
2161
-								$date1 = new Date($v);
2162
-								$date2 = new Date($val);
2163
-								$keep  = (Date::compare($date1, $date2) <= 0);
2164
-							} elseif ($val >= $v) {
2165
-								$keep = true;
2166
-							}
2167
-							break;
2168
-						default:
2169
-							if ($v == $val) {
2170
-								$keep = true;
2171
-							} else {
2172
-								$keep = false;
2173
-							}
2174
-							break;
2150
+						    case "GTE":
2151
+							    if ($t == "DATE") {
2152
+								    $date1 = new Date($v);
2153
+								    $date2 = new Date($val);
2154
+								    $keep  = (Date::compare($date1, $date2) >= 0);
2155
+							    } elseif ($val >= $v) {
2156
+								    $keep = true;
2157
+							    }
2158
+							    break;
2159
+						    case "LTE":
2160
+							    if ($t == "DATE") {
2161
+								    $date1 = new Date($v);
2162
+								    $date2 = new Date($val);
2163
+								    $keep  = (Date::compare($date1, $date2) <= 0);
2164
+							    } elseif ($val >= $v) {
2165
+								    $keep = true;
2166
+							    }
2167
+							    break;
2168
+						    default:
2169
+							    if ($v == $val) {
2170
+								    $keep = true;
2171
+							    } else {
2172
+								    $keep = false;
2173
+							    }
2174
+							    break;
2175 2175
 						}
2176 2176
 					}
2177 2177
 				}
@@ -2183,26 +2183,26 @@  discard block
 block discarded – undo
2183 2183
 		}
2184 2184
 
2185 2185
 		switch ($sortby) {
2186
-		case 'NAME':
2187
-			uasort($this->list, '\Fisharebest\Webtrees\GedcomRecord::compare');
2188
-			break;
2189
-		case 'CHAN':
2190
-			uasort($this->list, function (GedcomRecord $x, GedcomRecord $y) {
2191
-				return $y->lastChangeTimestamp(true) - $x->lastChangeTimestamp(true);
2192
-			});
2193
-			break;
2194
-		case 'BIRT:DATE':
2195
-			uasort($this->list, '\Fisharebest\Webtrees\Individual::compareBirthDate');
2196
-			break;
2197
-		case 'DEAT:DATE':
2198
-			uasort($this->list, '\Fisharebest\Webtrees\Individual::compareDeathDate');
2199
-			break;
2200
-		case 'MARR:DATE':
2201
-			uasort($this->list, '\Fisharebest\Webtrees\Family::compareMarrDate');
2202
-			break;
2203
-		default:
2204
-			// unsorted or already sorted by SQL
2205
-			break;
2186
+		    case 'NAME':
2187
+			    uasort($this->list, '\Fisharebest\Webtrees\GedcomRecord::compare');
2188
+			    break;
2189
+		    case 'CHAN':
2190
+			    uasort($this->list, function (GedcomRecord $x, GedcomRecord $y) {
2191
+				    return $y->lastChangeTimestamp(true) - $x->lastChangeTimestamp(true);
2192
+			    });
2193
+			    break;
2194
+		    case 'BIRT:DATE':
2195
+			    uasort($this->list, '\Fisharebest\Webtrees\Individual::compareBirthDate');
2196
+			    break;
2197
+		    case 'DEAT:DATE':
2198
+			    uasort($this->list, '\Fisharebest\Webtrees\Individual::compareDeathDate');
2199
+			    break;
2200
+		    case 'MARR:DATE':
2201
+			    uasort($this->list, '\Fisharebest\Webtrees\Family::compareMarrDate');
2202
+			    break;
2203
+		    default:
2204
+			    // unsorted or already sorted by SQL
2205
+			    break;
2206 2206
 		}
2207 2207
 
2208 2208
 		array_push($this->repeats_stack, array($this->repeats, $this->repeat_bytes));
@@ -2353,88 +2353,88 @@  discard block
 block discarded – undo
2353 2353
 		if (!empty($person)) {
2354 2354
 			$this->list[$id] = $person;
2355 2355
 			switch ($group) {
2356
-			case "child-family":
2357
-				foreach ($person->getChildFamilies() as $family) {
2358
-					$husband = $family->getHusband();
2359
-					$wife    = $family->getWife();
2360
-					if (!empty($husband)) {
2361
-						$this->list[$husband->getXref()] = $husband;
2362
-					}
2363
-					if (!empty($wife)) {
2364
-						$this->list[$wife->getXref()] = $wife;
2365
-					}
2366
-					$children = $family->getChildren();
2367
-					foreach ($children as $child) {
2368
-						if (!empty($child)) {
2369
-							$this->list[$child->getXref()] = $child;
2370
-						}
2371
-					}
2372
-				}
2373
-				break;
2374
-			case "spouse-family":
2375
-				foreach ($person->getSpouseFamilies() as $family) {
2376
-					$husband = $family->getHusband();
2377
-					$wife    = $family->getWife();
2378
-					if (!empty($husband)) {
2379
-						$this->list[$husband->getXref()] = $husband;
2380
-					}
2381
-					if (!empty($wife)) {
2382
-						$this->list[$wife->getXref()] = $wife;
2383
-					}
2384
-					$children = $family->getChildren();
2385
-					foreach ($children as $child) {
2386
-						if (!empty($child)) {
2387
-							$this->list[$child->getXref()] = $child;
2388
-						}
2389
-					}
2390
-				}
2391
-				break;
2392
-			case "direct-ancestors":
2393
-				$this->addAncestors($this->list, $id, false, $maxgen);
2394
-				break;
2395
-			case "ancestors":
2396
-				$this->addAncestors($this->list, $id, true, $maxgen);
2397
-				break;
2398
-			case "descendants":
2399
-				$this->list[$id]->generation = 1;
2400
-				$this->addDescendancy($this->list, $id, false, $maxgen);
2401
-				break;
2402
-			case "all":
2403
-				$this->addAncestors($this->list, $id, true, $maxgen);
2404
-				$this->addDescendancy($this->list, $id, true, $maxgen);
2405
-				break;
2356
+			    case "child-family":
2357
+				    foreach ($person->getChildFamilies() as $family) {
2358
+					    $husband = $family->getHusband();
2359
+					    $wife    = $family->getWife();
2360
+					    if (!empty($husband)) {
2361
+						    $this->list[$husband->getXref()] = $husband;
2362
+					    }
2363
+					    if (!empty($wife)) {
2364
+						    $this->list[$wife->getXref()] = $wife;
2365
+					    }
2366
+					    $children = $family->getChildren();
2367
+					    foreach ($children as $child) {
2368
+						    if (!empty($child)) {
2369
+							    $this->list[$child->getXref()] = $child;
2370
+						    }
2371
+					    }
2372
+				    }
2373
+				    break;
2374
+			    case "spouse-family":
2375
+				    foreach ($person->getSpouseFamilies() as $family) {
2376
+					    $husband = $family->getHusband();
2377
+					    $wife    = $family->getWife();
2378
+					    if (!empty($husband)) {
2379
+						    $this->list[$husband->getXref()] = $husband;
2380
+					    }
2381
+					    if (!empty($wife)) {
2382
+						    $this->list[$wife->getXref()] = $wife;
2383
+					    }
2384
+					    $children = $family->getChildren();
2385
+					    foreach ($children as $child) {
2386
+						    if (!empty($child)) {
2387
+							    $this->list[$child->getXref()] = $child;
2388
+						    }
2389
+					    }
2390
+				    }
2391
+				    break;
2392
+			    case "direct-ancestors":
2393
+				    $this->addAncestors($this->list, $id, false, $maxgen);
2394
+				    break;
2395
+			    case "ancestors":
2396
+				    $this->addAncestors($this->list, $id, true, $maxgen);
2397
+				    break;
2398
+			    case "descendants":
2399
+				    $this->list[$id]->generation = 1;
2400
+				    $this->addDescendancy($this->list, $id, false, $maxgen);
2401
+				    break;
2402
+			    case "all":
2403
+				    $this->addAncestors($this->list, $id, true, $maxgen);
2404
+				    $this->addDescendancy($this->list, $id, true, $maxgen);
2405
+				    break;
2406 2406
 			}
2407 2407
 		}
2408 2408
 
2409 2409
 		switch ($sortby) {
2410
-		case 'NAME':
2411
-			uasort($this->list, '\Fisharebest\Webtrees\GedcomRecord::compare');
2412
-			break;
2413
-		case 'BIRT:DATE':
2414
-			uasort($this->list, '\Fisharebest\Webtrees\Individual::compareBirthDate');
2415
-			break;
2416
-		case 'DEAT:DATE':
2417
-			uasort($this->list, '\Fisharebest\Webtrees\Individual::compareDeathDate');
2418
-			break;
2419
-		case 'generation':
2420
-			$newarray = array();
2421
-			reset($this->list);
2422
-			$genCounter = 1;
2423
-			while (count($newarray) < count($this->list)) {
2424
-				foreach ($this->list as $key => $value) {
2425
-					$this->generation = $value->generation;
2426
-					if ($this->generation == $genCounter) {
2427
-						$newarray[$key]             = new \stdClass;
2428
-						$newarray[$key]->generation = $this->generation;
2429
-					}
2430
-				}
2431
-				$genCounter++;
2432
-			}
2433
-			$this->list = $newarray;
2434
-			break;
2435
-		default:
2436
-			// unsorted
2437
-			break;
2410
+		    case 'NAME':
2411
+			    uasort($this->list, '\Fisharebest\Webtrees\GedcomRecord::compare');
2412
+			    break;
2413
+		    case 'BIRT:DATE':
2414
+			    uasort($this->list, '\Fisharebest\Webtrees\Individual::compareBirthDate');
2415
+			    break;
2416
+		    case 'DEAT:DATE':
2417
+			    uasort($this->list, '\Fisharebest\Webtrees\Individual::compareDeathDate');
2418
+			    break;
2419
+		    case 'generation':
2420
+			    $newarray = array();
2421
+			    reset($this->list);
2422
+			    $genCounter = 1;
2423
+			    while (count($newarray) < count($this->list)) {
2424
+				    foreach ($this->list as $key => $value) {
2425
+					    $this->generation = $value->generation;
2426
+					    if ($this->generation == $genCounter) {
2427
+						    $newarray[$key]             = new \stdClass;
2428
+						    $newarray[$key]->generation = $this->generation;
2429
+					    }
2430
+				    }
2431
+				    $genCounter++;
2432
+			    }
2433
+			    $this->list = $newarray;
2434
+			    break;
2435
+		    default:
2436
+			    // unsorted
2437
+			    break;
2438 2438
 		}
2439 2439
 		array_push($this->repeats_stack, array($this->repeats, $this->repeat_bytes));
2440 2440
 		$this->repeat_bytes = xml_get_current_line_number($this->parser) + 1;
Please login to merge, or discard this patch.
app/Date.php 1 patch
Switch Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -169,22 +169,22 @@  discard block
 block discarded – undo
169 169
 		}
170 170
 		// Now construct an object of the correct type
171 171
 		switch ($cal) {
172
-		case '@#DGREGORIAN@':
173
-			return new GregorianDate(array($y, $m, $d));
174
-		case '@#DJULIAN@':
175
-			return new JulianDate(array($y, $m, $d));
176
-		case '@#DHEBREW@':
177
-			return new JewishDate(array($y, $m, $d));
178
-		case '@#DHIJRI@':
179
-			return new HijriDate(array($y, $m, $d));
180
-		case '@#DFRENCH R@':
181
-			return new FrenchDate(array($y, $m, $d));
182
-		case '@#DJALALI@':
183
-			return new JalaliDate(array($y, $m, $d));
184
-		case '@#DROMAN@':
185
-			return new RomanDate(array($y, $m, $d));
186
-		default:
187
-			throw new \DomainException('Invalid calendar');
172
+		    case '@#DGREGORIAN@':
173
+			    return new GregorianDate(array($y, $m, $d));
174
+		    case '@#DJULIAN@':
175
+			    return new JulianDate(array($y, $m, $d));
176
+		    case '@#DHEBREW@':
177
+			    return new JewishDate(array($y, $m, $d));
178
+		    case '@#DHIJRI@':
179
+			    return new HijriDate(array($y, $m, $d));
180
+		    case '@#DFRENCH R@':
181
+			    return new FrenchDate(array($y, $m, $d));
182
+		    case '@#DJALALI@':
183
+			    return new JalaliDate(array($y, $m, $d));
184
+		    case '@#DROMAN@':
185
+			    return new RomanDate(array($y, $m, $d));
186
+		    default:
187
+			    throw new \DomainException('Invalid calendar');
188 188
 		}
189 189
 	}
190 190
 
@@ -291,42 +291,42 @@  discard block
 block discarded – undo
291 291
 
292 292
 		// Localise the date
293 293
 		switch ($q1 . $q2) {
294
-		case '':
295
-			$tmp = $d1 . $conv1;
296
-			break;
297
-		case 'ABT':
298
-			$tmp = /* I18N: Gedcom ABT dates */ I18N::translate('about %s', $d1 . $conv1);
299
-			break;
300
-		case 'CAL':
301
-			$tmp = /* I18N: Gedcom CAL dates */ I18N::translate('calculated %s', $d1 . $conv1);
302
-			break;
303
-		case 'EST':
304
-			$tmp = /* I18N: Gedcom EST dates */ I18N::translate('estimated %s', $d1 . $conv1);
305
-			break;
306
-		case 'INT':
307
-			$tmp = /* I18N: Gedcom INT dates */ I18N::translate('interpreted %s (%s)', $d1 . $conv1, Filter::escapeHtml($this->text));
308
-			break;
309
-		case 'BEF':
310
-			$tmp = /* I18N: Gedcom BEF dates */ I18N::translate('before %s', $d1 . $conv1);
311
-			break;
312
-		case 'AFT':
313
-			$tmp = /* I18N: Gedcom AFT dates */ I18N::translate('after %s', $d1 . $conv1);
314
-			break;
315
-		case 'FROM':
316
-			$tmp = /* I18N: Gedcom FROM dates */ I18N::translate('from %s', $d1 . $conv1);
317
-			break;
318
-		case 'TO':
319
-			$tmp = /* I18N: Gedcom TO dates */ I18N::translate('to %s', $d1 . $conv1);
320
-			break;
321
-		case 'BETAND':
322
-			$tmp = /* I18N: Gedcom BET-AND dates */ I18N::translate('between %s and %s', $d1 . $conv1, $d2 . $conv2);
323
-			break;
324
-		case 'FROMTO':
325
-			$tmp = /* I18N: Gedcom FROM-TO dates */ I18N::translate('from %s to %s', $d1 . $conv1, $d2 . $conv2);
326
-			break;
327
-		default:
328
-			$tmp = I18N::translate('Invalid date');
329
-			break; // e.g. BET without AND
294
+		    case '':
295
+			    $tmp = $d1 . $conv1;
296
+			    break;
297
+		    case 'ABT':
298
+			    $tmp = /* I18N: Gedcom ABT dates */ I18N::translate('about %s', $d1 . $conv1);
299
+			    break;
300
+		    case 'CAL':
301
+			    $tmp = /* I18N: Gedcom CAL dates */ I18N::translate('calculated %s', $d1 . $conv1);
302
+			    break;
303
+		    case 'EST':
304
+			    $tmp = /* I18N: Gedcom EST dates */ I18N::translate('estimated %s', $d1 . $conv1);
305
+			    break;
306
+		    case 'INT':
307
+			    $tmp = /* I18N: Gedcom INT dates */ I18N::translate('interpreted %s (%s)', $d1 . $conv1, Filter::escapeHtml($this->text));
308
+			    break;
309
+		    case 'BEF':
310
+			    $tmp = /* I18N: Gedcom BEF dates */ I18N::translate('before %s', $d1 . $conv1);
311
+			    break;
312
+		    case 'AFT':
313
+			    $tmp = /* I18N: Gedcom AFT dates */ I18N::translate('after %s', $d1 . $conv1);
314
+			    break;
315
+		    case 'FROM':
316
+			    $tmp = /* I18N: Gedcom FROM dates */ I18N::translate('from %s', $d1 . $conv1);
317
+			    break;
318
+		    case 'TO':
319
+			    $tmp = /* I18N: Gedcom TO dates */ I18N::translate('to %s', $d1 . $conv1);
320
+			    break;
321
+		    case 'BETAND':
322
+			    $tmp = /* I18N: Gedcom BET-AND dates */ I18N::translate('between %s and %s', $d1 . $conv1, $d2 . $conv2);
323
+			    break;
324
+		    case 'FROMTO':
325
+			    $tmp = /* I18N: Gedcom FROM-TO dates */ I18N::translate('from %s to %s', $d1 . $conv1, $d2 . $conv2);
326
+			    break;
327
+		    default:
328
+			    $tmp = I18N::translate('Invalid date');
329
+			    break; // e.g. BET without AND
330 330
 		}
331 331
 		if ($this->text && !$q1) {
332 332
 			$tmp = I18N::translate('%1$s (%2$s)', $tmp, $this->text);
@@ -445,33 +445,33 @@  discard block
 block discarded – undo
445 445
 		}
446 446
 
447 447
 		switch ($format) {
448
-		case 0:
449
-			// Years - integer only (for statistics, rather than for display)
450
-			if ($jd && $d1->minimumJulianDay() && $d1->minimumJulianDay() <= $jd) {
451
-				return $d1->minimumDate()->getAge(false, $jd, false);
452
-			} else {
453
-				return -1;
454
-			}
455
-		case 1:
456
-			// Days - integer only (for sorting, rather than for display)
457
-			if ($jd && $d1->minimumJulianDay()) {
458
-				return $jd - $d1->minimumJulianDay();
459
-			} else {
460
-				return -1;
461
-			}
462
-		case 2:
463
-			// Just years, in local digits, with warning for negative/
464
-			if ($jd && $d1->minimumJulianDay()) {
465
-				if ($d1->minimumJulianDay() > $jd) {
466
-					return '<i class="icon-warning"></i>';
467
-				} else {
468
-					return I18N::number($d1->minimumDate()->getAge(false, $jd));
469
-				}
470
-			} else {
471
-				return '';
472
-			}
473
-		default:
474
-			throw new \InvalidArgumentException('format: ' . $format);
448
+		    case 0:
449
+			    // Years - integer only (for statistics, rather than for display)
450
+			    if ($jd && $d1->minimumJulianDay() && $d1->minimumJulianDay() <= $jd) {
451
+				    return $d1->minimumDate()->getAge(false, $jd, false);
452
+			    } else {
453
+				    return -1;
454
+			    }
455
+		    case 1:
456
+			    // Days - integer only (for sorting, rather than for display)
457
+			    if ($jd && $d1->minimumJulianDay()) {
458
+				    return $jd - $d1->minimumJulianDay();
459
+			    } else {
460
+				    return -1;
461
+			    }
462
+		    case 2:
463
+			    // Just years, in local digits, with warning for negative/
464
+			    if ($jd && $d1->minimumJulianDay()) {
465
+				    if ($d1->minimumJulianDay() > $jd) {
466
+					    return '<i class="icon-warning"></i>';
467
+				    } else {
468
+					    return I18N::number($d1->minimumDate()->getAge(false, $jd));
469
+				    }
470
+			    } else {
471
+				    return '';
472
+			    }
473
+		    default:
474
+			    throw new \InvalidArgumentException('format: ' . $format);
475 475
 		}
476 476
 	}
477 477
 
@@ -515,32 +515,32 @@  discard block
 block discarded – undo
515 515
 	public static function compare(Date $a, Date $b) {
516 516
 		// Get min/max JD for each date.
517 517
 		switch ($a->qual1) {
518
-		case 'BEF':
519
-			$amin = $a->minimumJulianDay() - 1;
520
-			$amax = $amin;
521
-			break;
522
-		case 'AFT':
523
-			$amax = $a->maximumJulianDay() + 1;
524
-			$amin = $amax;
525
-			break;
526
-		default:
527
-			$amin = $a->minimumJulianDay();
528
-			$amax = $a->maximumJulianDay();
529
-			break;
518
+		    case 'BEF':
519
+			    $amin = $a->minimumJulianDay() - 1;
520
+			    $amax = $amin;
521
+			    break;
522
+		    case 'AFT':
523
+			    $amax = $a->maximumJulianDay() + 1;
524
+			    $amin = $amax;
525
+			    break;
526
+		    default:
527
+			    $amin = $a->minimumJulianDay();
528
+			    $amax = $a->maximumJulianDay();
529
+			    break;
530 530
 		}
531 531
 		switch ($b->qual1) {
532
-		case 'BEF':
533
-			$bmin = $b->minimumJulianDay() - 1;
534
-			$bmax = $bmin;
535
-			break;
536
-		case 'AFT':
537
-			$bmax = $b->maximumJulianDay() + 1;
538
-			$bmin = $bmax;
539
-			break;
540
-		default:
541
-			$bmin = $b->minimumJulianDay();
542
-			$bmax = $b->maximumJulianDay();
543
-			break;
532
+		    case 'BEF':
533
+			    $bmin = $b->minimumJulianDay() - 1;
534
+			    $bmax = $bmin;
535
+			    break;
536
+		    case 'AFT':
537
+			    $bmax = $b->maximumJulianDay() + 1;
538
+			    $bmin = $bmax;
539
+			    break;
540
+		    default:
541
+			    $bmin = $b->minimumJulianDay();
542
+			    $bmax = $b->maximumJulianDay();
543
+			    break;
544 544
 		}
545 545
 		if ($amax < $bmin) {
546 546
 			return -1;
Please login to merge, or discard this patch.
app/Functions/Functions.php 1 patch
Switch Indentation   +1483 added lines, -1483 removed lines patch added patch discarded remove patch
@@ -65,29 +65,29 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	public static function fileUploadErrorText($error_code) {
67 67
 		switch ($error_code) {
68
-		case UPLOAD_ERR_OK:
69
-			return I18N::translate('File successfully uploaded');
70
-		case UPLOAD_ERR_INI_SIZE:
71
-		case UPLOAD_ERR_FORM_SIZE:
72
-			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
73
-			return I18N::translate('The uploaded file exceeds the allowed size.');
74
-		case UPLOAD_ERR_PARTIAL:
75
-			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
76
-			return I18N::translate('The file was only partially uploaded. Please try again.');
77
-		case UPLOAD_ERR_NO_FILE:
78
-			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
79
-			return I18N::translate('No file was received. Please try again.');
80
-		case UPLOAD_ERR_NO_TMP_DIR:
81
-			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
82
-			return I18N::translate('The PHP temporary folder is missing.');
83
-		case UPLOAD_ERR_CANT_WRITE:
84
-			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
85
-			return I18N::translate('PHP failed to write to disk.');
86
-		case UPLOAD_ERR_EXTENSION:
87
-			// I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
88
-			return I18N::translate('PHP blocked the file because of its extension.');
89
-		default:
90
-			return 'Error: ' . $error_code;
68
+		    case UPLOAD_ERR_OK:
69
+			    return I18N::translate('File successfully uploaded');
70
+		    case UPLOAD_ERR_INI_SIZE:
71
+		    case UPLOAD_ERR_FORM_SIZE:
72
+			    // I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
73
+			    return I18N::translate('The uploaded file exceeds the allowed size.');
74
+		    case UPLOAD_ERR_PARTIAL:
75
+			    // I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
76
+			    return I18N::translate('The file was only partially uploaded. Please try again.');
77
+		    case UPLOAD_ERR_NO_FILE:
78
+			    // I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
79
+			    return I18N::translate('No file was received. Please try again.');
80
+		    case UPLOAD_ERR_NO_TMP_DIR:
81
+			    // I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
82
+			    return I18N::translate('The PHP temporary folder is missing.');
83
+		    case UPLOAD_ERR_CANT_WRITE:
84
+			    // I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
85
+			    return I18N::translate('PHP failed to write to disk.');
86
+		    case UPLOAD_ERR_EXTENSION:
87
+			    // I18N: PHP internal error message - php.net/manual/en/features.file-upload.errors.php
88
+			    return I18N::translate('PHP blocked the file because of its extension.');
89
+		    default:
90
+			    return 'Error: ' . $error_code;
91 91
 		}
92 92
 	}
93 93
 
@@ -273,12 +273,12 @@  discard block
 block discarded – undo
273 273
 	 */
274 274
 	private static function reflexivePronoun(Individual $individual) {
275 275
 		switch ($individual->getSex()) {
276
-		case 'M':
277
-			return /* I18N: reflexive pronoun */ I18N::translate('himself');
278
-		case 'F':
279
-			return /* I18N: reflexive pronoun */ I18N::translate('herself');
280
-		default:
281
-			return /* I18N: reflexive pronoun - gender neutral version of himself/herself */ I18N::translate('themself');
276
+		    case 'M':
277
+			    return /* I18N: reflexive pronoun */ I18N::translate('himself');
278
+		    case 'F':
279
+			    return /* I18N: reflexive pronoun */ I18N::translate('herself');
280
+		    default:
281
+			    return /* I18N: reflexive pronoun - gender neutral version of himself/herself */ I18N::translate('themself');
282 282
 		}
283 283
 	}
284 284
 
@@ -463,127 +463,127 @@  discard block
 block discarded – undo
463 463
 	 */
464 464
 	public static function cousinName($n, $sex) {
465 465
 		switch ($sex) {
466
-		case 'M':
467
-			switch ($n) {
468
-			case  1:
469
-			/* 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. */
470
-			return I18N::translateContext('MALE', 'first cousin');
471
-			case  2:
472
-			/* 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. */
473
-			return I18N::translateContext('MALE', 'second cousin');
474
-			case  3:
475
-			/* 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. */
476
-			return I18N::translateContext('MALE', 'third cousin');
477
-			case  4:
478
-			/* 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. */
479
-			return I18N::translateContext('MALE', 'fourth cousin');
480
-			case  5:
481
-			/* 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. */
482
-			return I18N::translateContext('MALE', 'fifth cousin');
483
-			case  6:
484
-			/* 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. */
485
-			return I18N::translateContext('MALE', 'sixth cousin');
486
-			case  7:
487
-			/* 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. */
488
-			return I18N::translateContext('MALE', 'seventh cousin');
489
-			case  8:
490
-			/* 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. */
491
-			return I18N::translateContext('MALE', 'eighth cousin');
492
-			case  9:
493
-			/* 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. */
494
-			return I18N::translateContext('MALE', 'ninth cousin');
495
-			case 10:
496
-			/* 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. */
497
-			return I18N::translateContext('MALE', 'tenth cousin');
498
-			case 11:
499
-			/* 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. */
500
-			return I18N::translateContext('MALE', 'eleventh cousin');
501
-			case 12:
502
-			/* 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. */
503
-			return I18N::translateContext('MALE', 'twelfth cousin');
504
-			case 13:
505
-			/* 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. */
506
-			return I18N::translateContext('MALE', 'thirteenth cousin');
507
-			case 14:
508
-			/* 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. */
509
-			return I18N::translateContext('MALE', 'fourteenth cousin');
510
-			case 15:
511
-			/* 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. */
512
-			return I18N::translateContext('MALE', 'fifteenth cousin');
513
-			default:
514
-			/* 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. */
515
-			return I18N::translateContext('MALE', '%s × cousin', I18N::number($n));
516
-			}
517
-		case 'F':
518
-			switch ($n) {
519
-			case  1:
520
-			return I18N::translateContext('FEMALE', 'first cousin');
521
-			case  2:
522
-			return I18N::translateContext('FEMALE', 'second cousin');
523
-			case  3:
524
-			return I18N::translateContext('FEMALE', 'third cousin');
525
-			case  4:
526
-			return I18N::translateContext('FEMALE', 'fourth cousin');
527
-			case  5:
528
-			return I18N::translateContext('FEMALE', 'fifth cousin');
529
-			case  6:
530
-			return I18N::translateContext('FEMALE', 'sixth cousin');
531
-			case  7:
532
-			return I18N::translateContext('FEMALE', 'seventh cousin');
533
-			case  8:
534
-			return I18N::translateContext('FEMALE', 'eighth cousin');
535
-			case  9:
536
-			return I18N::translateContext('FEMALE', 'ninth cousin');
537
-			case 10:
538
-			return I18N::translateContext('FEMALE', 'tenth cousin');
539
-			case 11:
540
-			return I18N::translateContext('FEMALE', 'eleventh cousin');
541
-			case 12:
542
-			return I18N::translateContext('FEMALE', 'twelfth cousin');
543
-			case 13:
544
-			return I18N::translateContext('FEMALE', 'thirteenth cousin');
545
-			case 14:
546
-			return I18N::translateContext('FEMALE', 'fourteenth cousin');
547
-			case 15:
548
-			return I18N::translateContext('FEMALE', 'fifteenth cousin');
549
-			default:
550
-			return I18N::translateContext('FEMALE', '%s × cousin', I18N::number($n));
551
-			}
552
-		default:
553
-			switch ($n) {
554
-			case  1:
555
-			return I18N::translate('first cousin');
556
-			case  2:
557
-			return I18N::translate('second cousin');
558
-			case  3:
559
-			return I18N::translate('third cousin');
560
-			case  4:
561
-			return I18N::translate('fourth cousin');
562
-			case  5:
563
-			return I18N::translate('fifth cousin');
564
-			case  6:
565
-			return I18N::translate('sixth cousin');
566
-			case  7:
567
-			return I18N::translate('seventh cousin');
568
-			case  8:
569
-			return I18N::translate('eighth cousin');
570
-			case  9:
571
-			return I18N::translate('ninth cousin');
572
-			case 10:
573
-			return I18N::translate('tenth cousin');
574
-			case 11:
575
-			return I18N::translate('eleventh cousin');
576
-			case 12:
577
-			return I18N::translate('twelfth cousin');
578
-			case 13:
579
-			return I18N::translate('thirteenth cousin');
580
-			case 14:
581
-			return I18N::translate('fourteenth cousin');
582
-			case 15:
583
-			return I18N::translate('fifteenth cousin');
584
-			default:
585
-			return I18N::translate('%s × cousin', I18N::number($n));
586
-			}
466
+		    case 'M':
467
+			    switch ($n) {
468
+			        case  1:
469
+			        /* 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. */
470
+			        return I18N::translateContext('MALE', 'first cousin');
471
+			        case  2:
472
+			        /* 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. */
473
+			        return I18N::translateContext('MALE', 'second cousin');
474
+			        case  3:
475
+			        /* 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. */
476
+			        return I18N::translateContext('MALE', 'third cousin');
477
+			        case  4:
478
+			        /* 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. */
479
+			        return I18N::translateContext('MALE', 'fourth cousin');
480
+			        case  5:
481
+			        /* 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. */
482
+			        return I18N::translateContext('MALE', 'fifth cousin');
483
+			        case  6:
484
+			        /* 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. */
485
+			        return I18N::translateContext('MALE', 'sixth cousin');
486
+			        case  7:
487
+			        /* 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. */
488
+			        return I18N::translateContext('MALE', 'seventh cousin');
489
+			        case  8:
490
+			        /* 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. */
491
+			        return I18N::translateContext('MALE', 'eighth cousin');
492
+			        case  9:
493
+			        /* 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. */
494
+			        return I18N::translateContext('MALE', 'ninth cousin');
495
+			        case 10:
496
+			        /* 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. */
497
+			        return I18N::translateContext('MALE', 'tenth cousin');
498
+			        case 11:
499
+			        /* 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. */
500
+			        return I18N::translateContext('MALE', 'eleventh cousin');
501
+			        case 12:
502
+			        /* 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. */
503
+			        return I18N::translateContext('MALE', 'twelfth cousin');
504
+			        case 13:
505
+			        /* 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. */
506
+			        return I18N::translateContext('MALE', 'thirteenth cousin');
507
+			        case 14:
508
+			        /* 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. */
509
+			        return I18N::translateContext('MALE', 'fourteenth cousin');
510
+			        case 15:
511
+			        /* 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. */
512
+			        return I18N::translateContext('MALE', 'fifteenth cousin');
513
+			        default:
514
+			        /* 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. */
515
+			        return I18N::translateContext('MALE', '%s × cousin', I18N::number($n));
516
+			    }
517
+		    case 'F':
518
+			    switch ($n) {
519
+			        case  1:
520
+			        return I18N::translateContext('FEMALE', 'first cousin');
521
+			        case  2:
522
+			        return I18N::translateContext('FEMALE', 'second cousin');
523
+			        case  3:
524
+			        return I18N::translateContext('FEMALE', 'third cousin');
525
+			        case  4:
526
+			        return I18N::translateContext('FEMALE', 'fourth cousin');
527
+			        case  5:
528
+			        return I18N::translateContext('FEMALE', 'fifth cousin');
529
+			        case  6:
530
+			        return I18N::translateContext('FEMALE', 'sixth cousin');
531
+			        case  7:
532
+			        return I18N::translateContext('FEMALE', 'seventh cousin');
533
+			        case  8:
534
+			        return I18N::translateContext('FEMALE', 'eighth cousin');
535
+			        case  9:
536
+			        return I18N::translateContext('FEMALE', 'ninth cousin');
537
+			        case 10:
538
+			        return I18N::translateContext('FEMALE', 'tenth cousin');
539
+			        case 11:
540
+			        return I18N::translateContext('FEMALE', 'eleventh cousin');
541
+			        case 12:
542
+			        return I18N::translateContext('FEMALE', 'twelfth cousin');
543
+			        case 13:
544
+			        return I18N::translateContext('FEMALE', 'thirteenth cousin');
545
+			        case 14:
546
+			        return I18N::translateContext('FEMALE', 'fourteenth cousin');
547
+			        case 15:
548
+			        return I18N::translateContext('FEMALE', 'fifteenth cousin');
549
+			        default:
550
+			        return I18N::translateContext('FEMALE', '%s × cousin', I18N::number($n));
551
+			    }
552
+		    default:
553
+			    switch ($n) {
554
+			        case  1:
555
+			        return I18N::translate('first cousin');
556
+			        case  2:
557
+			        return I18N::translate('second cousin');
558
+			        case  3:
559
+			        return I18N::translate('third cousin');
560
+			        case  4:
561
+			        return I18N::translate('fourth cousin');
562
+			        case  5:
563
+			        return I18N::translate('fifth cousin');
564
+			        case  6:
565
+			        return I18N::translate('sixth cousin');
566
+			        case  7:
567
+			        return I18N::translate('seventh cousin');
568
+			        case  8:
569
+			        return I18N::translate('eighth cousin');
570
+			        case  9:
571
+			        return I18N::translate('ninth cousin');
572
+			        case 10:
573
+			        return I18N::translate('tenth cousin');
574
+			        case 11:
575
+			        return I18N::translate('eleventh cousin');
576
+			        case 12:
577
+			        return I18N::translate('twelfth cousin');
578
+			        case 13:
579
+			        return I18N::translate('thirteenth cousin');
580
+			        case 14:
581
+			        return I18N::translate('fourteenth cousin');
582
+			        case 15:
583
+			        return I18N::translate('fifteenth cousin');
584
+			        default:
585
+			        return I18N::translate('%s × cousin', I18N::number($n));
586
+			    }
587 587
 		}
588 588
 	}
589 589
 
@@ -599,51 +599,51 @@  discard block
 block discarded – undo
599 599
 	 */
600 600
 	public static function cousinName2($n, $sex, $relation) {
601 601
 		switch ($sex) {
602
-		case 'M':
603
-			switch ($n) {
604
-			case  1:
605
-				return /* I18N: A Spanish relationship name, such as third great-nephew */ I18N::translateContext('MALE', 'first %s', $relation);
606
-			case  2:
607
-				return I18N::translateContext('MALE', 'second %s', $relation);
608
-			case  3:
609
-				return I18N::translateContext('MALE', 'third %s', $relation);
610
-			case  4:
611
-				return I18N::translateContext('MALE', 'fourth %s', $relation);
612
-			case  5:
613
-				return I18N::translateContext('MALE', 'fifth %s', $relation);
614
-			default:
615
-				return /* I18N: A Spanish relationship name, such as third great-nephew */ I18N::translateContext('MALE', '%1$s × %2$s', I18N::number($n), $relation);
616
-			}
617
-		case 'F':
618
-			switch ($n) {
619
-			case  1:
620
-				return /* I18N: A Spanish relationship name, such as third great-nephew */ I18N::translateContext('FEMALE', 'first %s', $relation);
621
-			case  2:
622
-				return I18N::translateContext('FEMALE', 'second %s', $relation);
623
-			case  3:
624
-				return I18N::translateContext('FEMALE', 'third %s', $relation);
625
-			case  4:
626
-				return I18N::translateContext('FEMALE', 'fourth %s', $relation);
627
-			case  5:
628
-				return I18N::translateContext('FEMALE', 'fifth %s', $relation);
629
-			default: // I18N: A Spanish relationship name, such as third great-nephew
630
-				return I18N::translateContext('FEMALE', '%1$s × %2$s', I18N::number($n), $relation);
631
-			}
632
-		default:
633
-			switch ($n) {
634
-			case  1:
635
-				return /* I18N: A Spanish relationship name, such as first great-nephew */ I18N::translate('first %s', $relation);
636
-			case  2:
637
-				return /* I18N: A Spanish relationship name, such as second great-nephew */ I18N::translate('second %s', $relation);
638
-			case  3:
639
-				return /* I18N: A Spanish relationship name, such as third great-nephew */ I18N::translate('third %s', $relation);
640
-			case  4:
641
-				return /* I18N: A Spanish relationship name, such as fourth great-nephew */ I18N::translate('fourth %s', $relation);
642
-			case  5:
643
-				return /* I18N: A Spanish relationship name, such as fifth great-nephew */ I18N::translate('fifth %s', $relation);
644
-			default:
645
-				return /* I18N: A Spanish relationship name, such as 7th great-nephew */ I18N::translate('%1$s × %2$s', I18N::number($n), $relation);
646
-			}
602
+		    case 'M':
603
+			    switch ($n) {
604
+			        case  1:
605
+				        return /* I18N: A Spanish relationship name, such as third great-nephew */ I18N::translateContext('MALE', 'first %s', $relation);
606
+			        case  2:
607
+				        return I18N::translateContext('MALE', 'second %s', $relation);
608
+			        case  3:
609
+				        return I18N::translateContext('MALE', 'third %s', $relation);
610
+			        case  4:
611
+				        return I18N::translateContext('MALE', 'fourth %s', $relation);
612
+			        case  5:
613
+				        return I18N::translateContext('MALE', 'fifth %s', $relation);
614
+			        default:
615
+				        return /* I18N: A Spanish relationship name, such as third great-nephew */ I18N::translateContext('MALE', '%1$s × %2$s', I18N::number($n), $relation);
616
+			    }
617
+		    case 'F':
618
+			    switch ($n) {
619
+			        case  1:
620
+				        return /* I18N: A Spanish relationship name, such as third great-nephew */ I18N::translateContext('FEMALE', 'first %s', $relation);
621
+			        case  2:
622
+				        return I18N::translateContext('FEMALE', 'second %s', $relation);
623
+			        case  3:
624
+				        return I18N::translateContext('FEMALE', 'third %s', $relation);
625
+			        case  4:
626
+				        return I18N::translateContext('FEMALE', 'fourth %s', $relation);
627
+			        case  5:
628
+				        return I18N::translateContext('FEMALE', 'fifth %s', $relation);
629
+			        default: // I18N: A Spanish relationship name, such as third great-nephew
630
+				        return I18N::translateContext('FEMALE', '%1$s × %2$s', I18N::number($n), $relation);
631
+			    }
632
+		    default:
633
+			    switch ($n) {
634
+			        case  1:
635
+				        return /* I18N: A Spanish relationship name, such as first great-nephew */ I18N::translate('first %s', $relation);
636
+			        case  2:
637
+				        return /* I18N: A Spanish relationship name, such as second great-nephew */ I18N::translate('second %s', $relation);
638
+			        case  3:
639
+				        return /* I18N: A Spanish relationship name, such as third great-nephew */ I18N::translate('third %s', $relation);
640
+			        case  4:
641
+				        return /* I18N: A Spanish relationship name, such as fourth great-nephew */ I18N::translate('fourth %s', $relation);
642
+			        case  5:
643
+				        return /* I18N: A Spanish relationship name, such as fifth great-nephew */ I18N::translate('fifth %s', $relation);
644
+			        default:
645
+				        return /* I18N: A Spanish relationship name, such as 7th great-nephew */ I18N::translate('%1$s × %2$s', I18N::number($n), $relation);
646
+			    }
647 647
 		}
648 648
 	}
649 649
 
@@ -680,796 +680,796 @@  discard block
 block discarded – undo
680 680
 		}
681 681
 
682 682
 		switch ($path) {
683
-		case '':
684
-			return I18N::translate('self');
685
-		//  Level One relationships
686
-		case 'mot':
687
-			return I18N::translate('mother');
688
-		case 'fat':
689
-			return I18N::translate('father');
690
-		case 'par':
691
-			return I18N::translate('parent');
692
-		case 'hus':
693
-			if ($person1 && $person2) {
694
-				foreach ($person1->getSpouseFamilies() as $family) {
695
-					if ($person2 === $family->getSpouse($person1)) {
696
-						if ($family->getFacts('_NMR')) {
697
-							if ($family->getFacts(WT_EVENTS_DIV)) {
698
-								return I18N::translateContext('MALE', 'ex-partner');
699
-							} else {
700
-								return I18N::translateContext('MALE', 'partner');
701
-							}
702
-						} elseif ($family->getFacts(WT_EVENTS_DIV)) {
703
-							return I18N::translate('ex-husband');
704
-						}
705
-					}
706
-				}
707
-			}
683
+		    case '':
684
+			    return I18N::translate('self');
685
+		    //  Level One relationships
686
+		    case 'mot':
687
+			    return I18N::translate('mother');
688
+		    case 'fat':
689
+			    return I18N::translate('father');
690
+		    case 'par':
691
+			    return I18N::translate('parent');
692
+		    case 'hus':
693
+			    if ($person1 && $person2) {
694
+				    foreach ($person1->getSpouseFamilies() as $family) {
695
+					    if ($person2 === $family->getSpouse($person1)) {
696
+						    if ($family->getFacts('_NMR')) {
697
+							    if ($family->getFacts(WT_EVENTS_DIV)) {
698
+								    return I18N::translateContext('MALE', 'ex-partner');
699
+							    } else {
700
+								    return I18N::translateContext('MALE', 'partner');
701
+							    }
702
+						    } elseif ($family->getFacts(WT_EVENTS_DIV)) {
703
+							    return I18N::translate('ex-husband');
704
+						    }
705
+					    }
706
+				    }
707
+			    }
708 708
 
709
-			return I18N::translate('husband');
710
-		case 'wif':
711
-			if ($person1 && $person2) {
712
-				foreach ($person1->getSpouseFamilies() as $family) {
713
-					if ($person2 === $family->getSpouse($person1)) {
714
-						if ($family->getFacts('_NMR')) {
715
-							if ($family->getFacts(WT_EVENTS_DIV)) {
716
-								return I18N::translateContext('FEMALE', 'ex-partner');
717
-							} else {
718
-								return I18N::translateContext('FEMALE', 'partner');
719
-							}
720
-						} elseif ($family->getFacts(WT_EVENTS_DIV)) {
721
-							return I18N::translate('ex-wife');
722
-						}
723
-					}
724
-				}
725
-			}
709
+			    return I18N::translate('husband');
710
+		    case 'wif':
711
+			    if ($person1 && $person2) {
712
+				    foreach ($person1->getSpouseFamilies() as $family) {
713
+					    if ($person2 === $family->getSpouse($person1)) {
714
+						    if ($family->getFacts('_NMR')) {
715
+							    if ($family->getFacts(WT_EVENTS_DIV)) {
716
+								    return I18N::translateContext('FEMALE', 'ex-partner');
717
+							    } else {
718
+								    return I18N::translateContext('FEMALE', 'partner');
719
+							    }
720
+						    } elseif ($family->getFacts(WT_EVENTS_DIV)) {
721
+							    return I18N::translate('ex-wife');
722
+						    }
723
+					    }
724
+				    }
725
+			    }
726 726
 
727
-			return I18N::translate('wife');
728
-		case 'spo':
729
-			if ($person1 && $person2) {
730
-				foreach ($person1->getSpouseFamilies() as $family) {
731
-					if ($person2 === $family->getSpouse($person1)) {
732
-						if ($family->getFacts('_NMR')) {
733
-							if ($family->getFacts(WT_EVENTS_DIV)) {
734
-								return I18N::translate('ex-partner');
735
-							} else {
736
-								return I18N::translate('partner');
737
-							}
738
-						} elseif ($family->getFacts(WT_EVENTS_DIV)) {
739
-							return I18N::translate('ex-spouse');
740
-						}
741
-					}
742
-				}
743
-			}
727
+			    return I18N::translate('wife');
728
+		    case 'spo':
729
+			    if ($person1 && $person2) {
730
+				    foreach ($person1->getSpouseFamilies() as $family) {
731
+					    if ($person2 === $family->getSpouse($person1)) {
732
+						    if ($family->getFacts('_NMR')) {
733
+							    if ($family->getFacts(WT_EVENTS_DIV)) {
734
+								    return I18N::translate('ex-partner');
735
+							    } else {
736
+								    return I18N::translate('partner');
737
+							    }
738
+						    } elseif ($family->getFacts(WT_EVENTS_DIV)) {
739
+							    return I18N::translate('ex-spouse');
740
+						    }
741
+					    }
742
+				    }
743
+			    }
744 744
 
745
-			return I18N::translate('spouse');
746
-		case 'son':
747
-			return I18N::translate('son');
748
-		case 'dau':
749
-			return I18N::translate('daughter');
750
-		case 'chi':
751
-			return I18N::translate('child');
752
-		case 'bro':
753
-			if ($person1 && $person2) {
754
-				$dob1 = $person1->getBirthDate();
755
-				$dob2 = $person2->getBirthDate();
756
-				if ($dob1->isOK() && $dob2->isOK()) {
757
-					if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
758
-						// Exclude BEF, AFT, etc.
759
-						return I18N::translate('twin brother');
760
-					} elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
761
-						return I18N::translate('younger brother');
762
-					} elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
763
-						return I18N::translate('elder brother');
764
-					}
765
-				}
766
-			}
745
+			    return I18N::translate('spouse');
746
+		    case 'son':
747
+			    return I18N::translate('son');
748
+		    case 'dau':
749
+			    return I18N::translate('daughter');
750
+		    case 'chi':
751
+			    return I18N::translate('child');
752
+		    case 'bro':
753
+			    if ($person1 && $person2) {
754
+				    $dob1 = $person1->getBirthDate();
755
+				    $dob2 = $person2->getBirthDate();
756
+				    if ($dob1->isOK() && $dob2->isOK()) {
757
+					    if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
758
+						    // Exclude BEF, AFT, etc.
759
+						    return I18N::translate('twin brother');
760
+					    } elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
761
+						    return I18N::translate('younger brother');
762
+					    } elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
763
+						    return I18N::translate('elder brother');
764
+					    }
765
+				    }
766
+			    }
767 767
 
768
-			return I18N::translate('brother');
769
-		case 'sis':
770
-			if ($person1 && $person2) {
771
-				$dob1 = $person1->getBirthDate();
772
-				$dob2 = $person2->getBirthDate();
773
-				if ($dob1->isOK() && $dob2->isOK()) {
774
-					if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
775
-						// Exclude BEF, AFT, etc.
776
-						return I18N::translate('twin sister');
777
-					} elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
778
-						return I18N::translate('younger sister');
779
-					} elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
780
-						return I18N::translate('elder sister');
781
-					}
782
-				}
783
-			}
768
+			    return I18N::translate('brother');
769
+		    case 'sis':
770
+			    if ($person1 && $person2) {
771
+				    $dob1 = $person1->getBirthDate();
772
+				    $dob2 = $person2->getBirthDate();
773
+				    if ($dob1->isOK() && $dob2->isOK()) {
774
+					    if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
775
+						    // Exclude BEF, AFT, etc.
776
+						    return I18N::translate('twin sister');
777
+					    } elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
778
+						    return I18N::translate('younger sister');
779
+					    } elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
780
+						    return I18N::translate('elder sister');
781
+					    }
782
+				    }
783
+			    }
784 784
 
785
-			return I18N::translate('sister');
786
-		case 'sib':
787
-			if ($person1 && $person2) {
788
-				$dob1 = $person1->getBirthDate();
789
-				$dob2 = $person2->getBirthDate();
790
-				if ($dob1->isOK() && $dob2->isOK()) {
791
-					if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
792
-						// Exclude BEF, AFT, etc.
793
-						return I18N::translate('twin sibling');
794
-					} elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
795
-						return I18N::translate('younger sibling');
796
-					} elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
797
-						return I18N::translate('elder sibling');
798
-					}
799
-				}
800
-			}
785
+			    return I18N::translate('sister');
786
+		    case 'sib':
787
+			    if ($person1 && $person2) {
788
+				    $dob1 = $person1->getBirthDate();
789
+				    $dob2 = $person2->getBirthDate();
790
+				    if ($dob1->isOK() && $dob2->isOK()) {
791
+					    if (abs($dob1->julianDay() - $dob2->julianDay()) < 2 && !$dob1->minimumDate()->d !== 0 && !$dob2->minimumDate()->d !== 0) {
792
+						    // Exclude BEF, AFT, etc.
793
+						    return I18N::translate('twin sibling');
794
+					    } elseif ($dob1->maximumJulianDay() < $dob2->minimumJulianDay()) {
795
+						    return I18N::translate('younger sibling');
796
+					    } elseif ($dob1->minimumJulianDay() > $dob2->maximumJulianDay()) {
797
+						    return I18N::translate('elder sibling');
798
+					    }
799
+				    }
800
+			    }
801 801
 
802
-			return I18N::translate('sibling');
802
+			    return I18N::translate('sibling');
803 803
 
804
-		// Level Two relationships
805
-		case 'brochi':
806
-			return I18N::translateContext('brother’s child', 'nephew/niece');
807
-		case 'brodau':
808
-			return I18N::translateContext('brother’s daughter', 'niece');
809
-		case 'broson':
810
-			return I18N::translateContext('brother’s son', 'nephew');
811
-		case 'browif':
812
-			return I18N::translateContext('brother’s wife', 'sister-in-law');
813
-		case 'chichi':
814
-			return I18N::translateContext('child’s child', 'grandchild');
815
-		case 'chidau':
816
-			return I18N::translateContext('child’s daughter', 'granddaughter');
817
-		case 'chihus':
818
-			return I18N::translateContext('child’s husband', 'son-in-law');
819
-		case 'chison':
820
-			return I18N::translateContext('child’s son', 'grandson');
821
-		case 'chispo':
822
-			return I18N::translateContext('child’s spouse', 'son/daughter-in-law');
823
-		case 'chiwif':
824
-			return I18N::translateContext('child’s wife', 'daughter-in-law');
825
-		case 'dauchi':
826
-			return I18N::translateContext('daughter’s child', 'grandchild');
827
-		case 'daudau':
828
-			return I18N::translateContext('daughter’s daughter', 'granddaughter');
829
-		case 'dauhus':
830
-			return I18N::translateContext('daughter’s husband', 'son-in-law');
831
-		case 'dauson':
832
-			return I18N::translateContext('daughter’s son', 'grandson');
833
-		case 'fatbro':
834
-			return I18N::translateContext('father’s brother', 'uncle');
835
-		case 'fatchi':
836
-			return I18N::translateContext('father’s child', 'half-sibling');
837
-		case 'fatdau':
838
-			return I18N::translateContext('father’s daughter', 'half-sister');
839
-		case 'fatfat':
840
-			return I18N::translateContext('father’s father', 'paternal grandfather');
841
-		case 'fatmot':
842
-			return I18N::translateContext('father’s mother', 'paternal grandmother');
843
-		case 'fatpar':
844
-			return I18N::translateContext('father’s parent', 'paternal grandparent');
845
-		case 'fatsib':
846
-			return I18N::translateContext('father’s sibling', 'aunt/uncle');
847
-		case 'fatsis':
848
-			return I18N::translateContext('father’s sister', 'aunt');
849
-		case 'fatson':
850
-			return I18N::translateContext('father’s son', 'half-brother');
851
-		case 'fatwif':
852
-			return I18N::translateContext('father’s wife', 'step-mother');
853
-		case 'husbro':
854
-			return I18N::translateContext('husband’s brother', 'brother-in-law');
855
-		case 'huschi':
856
-			return I18N::translateContext('husband’s child', 'step-child');
857
-		case 'husdau':
858
-			return I18N::translateContext('husband’s daughter', 'step-daughter');
859
-		case 'husfat':
860
-			return I18N::translateContext('husband’s father', 'father-in-law');
861
-		case 'husmot':
862
-			return I18N::translateContext('husband’s mother', 'mother-in-law');
863
-		case 'hussib':
864
-			return I18N::translateContext('husband’s sibling', 'brother/sister-in-law');
865
-		case 'hussis':
866
-			return I18N::translateContext('husband’s sister', 'sister-in-law');
867
-		case 'husson':
868
-			return I18N::translateContext('husband’s son', 'step-son');
869
-		case 'motbro':
870
-			return I18N::translateContext('mother’s brother', 'uncle');
871
-		case 'motchi':
872
-			return I18N::translateContext('mother’s child', 'half-sibling');
873
-		case 'motdau':
874
-			return I18N::translateContext('mother’s daughter', 'half-sister');
875
-		case 'motfat':
876
-			return I18N::translateContext('mother’s father', 'maternal grandfather');
877
-		case 'mothus':
878
-			return I18N::translateContext('mother’s husband', 'step-father');
879
-		case 'motmot':
880
-			return I18N::translateContext('mother’s mother', 'maternal grandmother');
881
-		case 'motpar':
882
-			return I18N::translateContext('mother’s parent', 'maternal grandparent');
883
-		case 'motsib':
884
-			return I18N::translateContext('mother’s sibling', 'aunt/uncle');
885
-		case 'motsis':
886
-			return I18N::translateContext('mother’s sister', 'aunt');
887
-		case 'motson':
888
-			return I18N::translateContext('mother’s son', 'half-brother');
889
-		case 'parbro':
890
-			return I18N::translateContext('parent’s brother', 'uncle');
891
-		case 'parchi':
892
-			return I18N::translateContext('parent’s child', 'half-sibling');
893
-		case 'pardau':
894
-			return I18N::translateContext('parent’s daughter', 'half-sister');
895
-		case 'parfat':
896
-			return I18N::translateContext('parent’s father', 'grandfather');
897
-		case 'parmot':
898
-			return I18N::translateContext('parent’s mother', 'grandmother');
899
-		case 'parpar':
900
-			return I18N::translateContext('parent’s parent', 'grandparent');
901
-		case 'parsib':
902
-			return I18N::translateContext('parent’s sibling', 'aunt/uncle');
903
-		case 'parsis':
904
-			return I18N::translateContext('parent’s sister', 'aunt');
905
-		case 'parson':
906
-			return I18N::translateContext('parent’s son', 'half-brother');
907
-		case 'parspo':
908
-			return I18N::translateContext('parent’s spouse', 'step-parent');
909
-		case 'sibchi':
910
-			return I18N::translateContext('sibling’s child', 'nephew/niece');
911
-		case 'sibdau':
912
-			return I18N::translateContext('sibling’s daughter', 'niece');
913
-		case 'sibson':
914
-			return I18N::translateContext('sibling’s son', 'nephew');
915
-		case 'sibspo':
916
-			return I18N::translateContext('sibling’s spouse', 'brother/sister-in-law');
917
-		case 'sischi':
918
-			return I18N::translateContext('sister’s child', 'nephew/niece');
919
-		case 'sisdau':
920
-			return I18N::translateContext('sister’s daughter', 'niece');
921
-		case 'sishus':
922
-			return I18N::translateContext('sister’s husband', 'brother-in-law');
923
-		case 'sisson':
924
-			return I18N::translateContext('sister’s son', 'nephew');
925
-		case 'sonchi':
926
-			return I18N::translateContext('son’s child', 'grandchild');
927
-		case 'sondau':
928
-			return I18N::translateContext('son’s daughter', 'granddaughter');
929
-		case 'sonson':
930
-			return I18N::translateContext('son’s son', 'grandson');
931
-		case 'sonwif':
932
-			return I18N::translateContext('son’s wife', 'daughter-in-law');
933
-		case 'spobro':
934
-			return I18N::translateContext('spouse’s brother', 'brother-in-law');
935
-		case 'spochi':
936
-			return I18N::translateContext('spouse’s child', 'step-child');
937
-		case 'spodau':
938
-			return I18N::translateContext('spouse’s daughter', 'step-daughter');
939
-		case 'spofat':
940
-			return I18N::translateContext('spouse’s father', 'father-in-law');
941
-		case 'spomot':
942
-			return I18N::translateContext('spouse’s mother', 'mother-in-law');
943
-		case 'sposis':
944
-			return I18N::translateContext('spouse’s sister', 'sister-in-law');
945
-		case 'sposon':
946
-			return I18N::translateContext('spouse’s son', 'step-son');
947
-		case 'spopar':
948
-			return I18N::translateContext('spouse’s parent', 'mother/father-in-law');
949
-		case 'sposib':
950
-			return I18N::translateContext('spouse’s sibling', 'brother/sister-in-law');
951
-		case 'wifbro':
952
-			return I18N::translateContext('wife’s brother', 'brother-in-law');
953
-		case 'wifchi':
954
-			return I18N::translateContext('wife’s child', 'step-child');
955
-		case 'wifdau':
956
-			return I18N::translateContext('wife’s daughter', 'step-daughter');
957
-		case 'wiffat':
958
-			return I18N::translateContext('wife’s father', 'father-in-law');
959
-		case 'wifmot':
960
-			return I18N::translateContext('wife’s mother', 'mother-in-law');
961
-		case 'wifsib':
962
-			return I18N::translateContext('wife’s sibling', 'brother/sister-in-law');
963
-		case 'wifsis':
964
-			return I18N::translateContext('wife’s sister', 'sister-in-law');
965
-		case 'wifson':
966
-			return I18N::translateContext('wife’s son', 'step-son');
804
+		    // Level Two relationships
805
+		    case 'brochi':
806
+			    return I18N::translateContext('brother’s child', 'nephew/niece');
807
+		    case 'brodau':
808
+			    return I18N::translateContext('brother’s daughter', 'niece');
809
+		    case 'broson':
810
+			    return I18N::translateContext('brother’s son', 'nephew');
811
+		    case 'browif':
812
+			    return I18N::translateContext('brother’s wife', 'sister-in-law');
813
+		    case 'chichi':
814
+			    return I18N::translateContext('child’s child', 'grandchild');
815
+		    case 'chidau':
816
+			    return I18N::translateContext('child’s daughter', 'granddaughter');
817
+		    case 'chihus':
818
+			    return I18N::translateContext('child’s husband', 'son-in-law');
819
+		    case 'chison':
820
+			    return I18N::translateContext('child’s son', 'grandson');
821
+		    case 'chispo':
822
+			    return I18N::translateContext('child’s spouse', 'son/daughter-in-law');
823
+		    case 'chiwif':
824
+			    return I18N::translateContext('child’s wife', 'daughter-in-law');
825
+		    case 'dauchi':
826
+			    return I18N::translateContext('daughter’s child', 'grandchild');
827
+		    case 'daudau':
828
+			    return I18N::translateContext('daughter’s daughter', 'granddaughter');
829
+		    case 'dauhus':
830
+			    return I18N::translateContext('daughter’s husband', 'son-in-law');
831
+		    case 'dauson':
832
+			    return I18N::translateContext('daughter’s son', 'grandson');
833
+		    case 'fatbro':
834
+			    return I18N::translateContext('father’s brother', 'uncle');
835
+		    case 'fatchi':
836
+			    return I18N::translateContext('father’s child', 'half-sibling');
837
+		    case 'fatdau':
838
+			    return I18N::translateContext('father’s daughter', 'half-sister');
839
+		    case 'fatfat':
840
+			    return I18N::translateContext('father’s father', 'paternal grandfather');
841
+		    case 'fatmot':
842
+			    return I18N::translateContext('father’s mother', 'paternal grandmother');
843
+		    case 'fatpar':
844
+			    return I18N::translateContext('father’s parent', 'paternal grandparent');
845
+		    case 'fatsib':
846
+			    return I18N::translateContext('father’s sibling', 'aunt/uncle');
847
+		    case 'fatsis':
848
+			    return I18N::translateContext('father’s sister', 'aunt');
849
+		    case 'fatson':
850
+			    return I18N::translateContext('father’s son', 'half-brother');
851
+		    case 'fatwif':
852
+			    return I18N::translateContext('father’s wife', 'step-mother');
853
+		    case 'husbro':
854
+			    return I18N::translateContext('husband’s brother', 'brother-in-law');
855
+		    case 'huschi':
856
+			    return I18N::translateContext('husband’s child', 'step-child');
857
+		    case 'husdau':
858
+			    return I18N::translateContext('husband’s daughter', 'step-daughter');
859
+		    case 'husfat':
860
+			    return I18N::translateContext('husband’s father', 'father-in-law');
861
+		    case 'husmot':
862
+			    return I18N::translateContext('husband’s mother', 'mother-in-law');
863
+		    case 'hussib':
864
+			    return I18N::translateContext('husband’s sibling', 'brother/sister-in-law');
865
+		    case 'hussis':
866
+			    return I18N::translateContext('husband’s sister', 'sister-in-law');
867
+		    case 'husson':
868
+			    return I18N::translateContext('husband’s son', 'step-son');
869
+		    case 'motbro':
870
+			    return I18N::translateContext('mother’s brother', 'uncle');
871
+		    case 'motchi':
872
+			    return I18N::translateContext('mother’s child', 'half-sibling');
873
+		    case 'motdau':
874
+			    return I18N::translateContext('mother’s daughter', 'half-sister');
875
+		    case 'motfat':
876
+			    return I18N::translateContext('mother’s father', 'maternal grandfather');
877
+		    case 'mothus':
878
+			    return I18N::translateContext('mother’s husband', 'step-father');
879
+		    case 'motmot':
880
+			    return I18N::translateContext('mother’s mother', 'maternal grandmother');
881
+		    case 'motpar':
882
+			    return I18N::translateContext('mother’s parent', 'maternal grandparent');
883
+		    case 'motsib':
884
+			    return I18N::translateContext('mother’s sibling', 'aunt/uncle');
885
+		    case 'motsis':
886
+			    return I18N::translateContext('mother’s sister', 'aunt');
887
+		    case 'motson':
888
+			    return I18N::translateContext('mother’s son', 'half-brother');
889
+		    case 'parbro':
890
+			    return I18N::translateContext('parent’s brother', 'uncle');
891
+		    case 'parchi':
892
+			    return I18N::translateContext('parent’s child', 'half-sibling');
893
+		    case 'pardau':
894
+			    return I18N::translateContext('parent’s daughter', 'half-sister');
895
+		    case 'parfat':
896
+			    return I18N::translateContext('parent’s father', 'grandfather');
897
+		    case 'parmot':
898
+			    return I18N::translateContext('parent’s mother', 'grandmother');
899
+		    case 'parpar':
900
+			    return I18N::translateContext('parent’s parent', 'grandparent');
901
+		    case 'parsib':
902
+			    return I18N::translateContext('parent’s sibling', 'aunt/uncle');
903
+		    case 'parsis':
904
+			    return I18N::translateContext('parent’s sister', 'aunt');
905
+		    case 'parson':
906
+			    return I18N::translateContext('parent’s son', 'half-brother');
907
+		    case 'parspo':
908
+			    return I18N::translateContext('parent’s spouse', 'step-parent');
909
+		    case 'sibchi':
910
+			    return I18N::translateContext('sibling’s child', 'nephew/niece');
911
+		    case 'sibdau':
912
+			    return I18N::translateContext('sibling’s daughter', 'niece');
913
+		    case 'sibson':
914
+			    return I18N::translateContext('sibling’s son', 'nephew');
915
+		    case 'sibspo':
916
+			    return I18N::translateContext('sibling’s spouse', 'brother/sister-in-law');
917
+		    case 'sischi':
918
+			    return I18N::translateContext('sister’s child', 'nephew/niece');
919
+		    case 'sisdau':
920
+			    return I18N::translateContext('sister’s daughter', 'niece');
921
+		    case 'sishus':
922
+			    return I18N::translateContext('sister’s husband', 'brother-in-law');
923
+		    case 'sisson':
924
+			    return I18N::translateContext('sister’s son', 'nephew');
925
+		    case 'sonchi':
926
+			    return I18N::translateContext('son’s child', 'grandchild');
927
+		    case 'sondau':
928
+			    return I18N::translateContext('son’s daughter', 'granddaughter');
929
+		    case 'sonson':
930
+			    return I18N::translateContext('son’s son', 'grandson');
931
+		    case 'sonwif':
932
+			    return I18N::translateContext('son’s wife', 'daughter-in-law');
933
+		    case 'spobro':
934
+			    return I18N::translateContext('spouse’s brother', 'brother-in-law');
935
+		    case 'spochi':
936
+			    return I18N::translateContext('spouse’s child', 'step-child');
937
+		    case 'spodau':
938
+			    return I18N::translateContext('spouse’s daughter', 'step-daughter');
939
+		    case 'spofat':
940
+			    return I18N::translateContext('spouse’s father', 'father-in-law');
941
+		    case 'spomot':
942
+			    return I18N::translateContext('spouse’s mother', 'mother-in-law');
943
+		    case 'sposis':
944
+			    return I18N::translateContext('spouse’s sister', 'sister-in-law');
945
+		    case 'sposon':
946
+			    return I18N::translateContext('spouse’s son', 'step-son');
947
+		    case 'spopar':
948
+			    return I18N::translateContext('spouse’s parent', 'mother/father-in-law');
949
+		    case 'sposib':
950
+			    return I18N::translateContext('spouse’s sibling', 'brother/sister-in-law');
951
+		    case 'wifbro':
952
+			    return I18N::translateContext('wife’s brother', 'brother-in-law');
953
+		    case 'wifchi':
954
+			    return I18N::translateContext('wife’s child', 'step-child');
955
+		    case 'wifdau':
956
+			    return I18N::translateContext('wife’s daughter', 'step-daughter');
957
+		    case 'wiffat':
958
+			    return I18N::translateContext('wife’s father', 'father-in-law');
959
+		    case 'wifmot':
960
+			    return I18N::translateContext('wife’s mother', 'mother-in-law');
961
+		    case 'wifsib':
962
+			    return I18N::translateContext('wife’s sibling', 'brother/sister-in-law');
963
+		    case 'wifsis':
964
+			    return I18N::translateContext('wife’s sister', 'sister-in-law');
965
+		    case 'wifson':
966
+			    return I18N::translateContext('wife’s son', 'step-son');
967 967
 
968
-		// Level Three relationships
969
-		// I have commented out some of the unknown-sex relationships that are unlikely to to occur.
970
-		// Feel free to add them in, if you think they might be needed
971
-		case 'brochichi':
972
-			if ($sex1 === 'M') {
973
-				return I18N::translateContext('(a man’s) brother’s child’s child', 'great-nephew/niece');
974
-			} else {
975
-				return I18N::translateContext('(a woman’s) brother’s child’s child', 'great-nephew/niece');
976
-			}
977
-		case 'brochidau':
978
-			if ($sex1 === 'M') {
979
-				return I18N::translateContext('(a man’s) brother’s child’s daughter', 'great-niece');
980
-			} else {
981
-				return I18N::translateContext('(a woman’s) brother’s child’s daughter', 'great-niece');
982
-			}
983
-		case 'brochison':
984
-			if ($sex1 === 'M') {
985
-				return I18N::translateContext('(a man’s) brother’s child’s son', 'great-nephew');
986
-			} else {
987
-				return I18N::translateContext('(a woman’s) brother’s child’s son', 'great-nephew');
988
-			}
989
-		case 'brodauchi':
990
-			if ($sex1 === 'M') {
991
-				return I18N::translateContext('(a man’s) brother’s daughter’s child', 'great-nephew/niece');
992
-			} else {
993
-				return I18N::translateContext('(a woman’s) brother’s daughter’s child', 'great-nephew/niece');
994
-			}
995
-		case 'brodaudau':
996
-			if ($sex1 === 'M') {
997
-				return I18N::translateContext('(a man’s) brother’s daughter’s daughter', 'great-niece');
998
-			} else {
999
-				return I18N::translateContext('(a woman’s) brother’s daughter’s daughter', 'great-niece');
1000
-			}
1001
-		case 'brodauhus':
1002
-			return I18N::translateContext('brother’s daughter’s husband', 'nephew-in-law');
1003
-		case 'brodauson':
1004
-			if ($sex1 === 'M') {
1005
-				return I18N::translateContext('(a man’s) brother’s daughter’s son', 'great-nephew');
1006
-			} else {
1007
-				return I18N::translateContext('(a woman’s) brother’s daughter’s son', 'great-nephew');
1008
-			}
1009
-		case 'brosonchi':
1010
-			if ($sex1 === 'M') {
1011
-				return I18N::translateContext('(a man’s) brother’s son’s child', 'great-nephew/niece');
1012
-			} else {
1013
-				return I18N::translateContext('(a woman’s) brother’s son’s child', 'great-nephew/niece');
1014
-			}
1015
-		case 'brosondau':
1016
-			if ($sex1 === 'M') {
1017
-				return I18N::translateContext('(a man’s) brother’s son’s daughter', 'great-niece');
1018
-			} else {
1019
-				return I18N::translateContext('(a woman’s) brother’s son’s daughter', 'great-niece');
1020
-			}
1021
-		case 'brosonson':
1022
-			if ($sex1 === 'M') {
1023
-				return I18N::translateContext('(a man’s) brother’s son’s son', 'great-nephew');
1024
-			} else {
1025
-				return I18N::translateContext('(a woman’s) brother’s son’s son', 'great-nephew');
1026
-			}
1027
-		case 'brosonwif':
1028
-			return I18N::translateContext('brother’s son’s wife', 'niece-in-law');
1029
-		case 'browifbro':
1030
-			return I18N::translateContext('brother’s wife’s brother', 'brother-in-law');
1031
-		case 'browifsib':
1032
-			return I18N::translateContext('brother’s wife’s sibling', 'brother/sister-in-law');
1033
-		case 'browifsis':
1034
-			return I18N::translateContext('brother’s wife’s sister', 'sister-in-law');
1035
-		case 'chichichi':
1036
-			return I18N::translateContext('child’s child’s child', 'great-grandchild');
1037
-		case 'chichidau':
1038
-			return I18N::translateContext('child’s child’s daughter', 'great-granddaughter');
1039
-		case 'chichison':
1040
-			return I18N::translateContext('child’s child’s son', 'great-grandson');
1041
-		case 'chidauchi':
1042
-			return I18N::translateContext('child’s daughter’s child', 'great-grandchild');
1043
-		case 'chidaudau':
1044
-			return I18N::translateContext('child’s daughter’s daughter', 'great-granddaughter');
1045
-		case 'chidauhus':
1046
-			return I18N::translateContext('child’s daughter’s husband', 'granddaughter’s husband');
1047
-		case 'chidauson':
1048
-			return I18N::translateContext('child’s daughter’s son', 'great-grandson');
1049
-		case 'chisonchi':
1050
-			return I18N::translateContext('child’s son’s child', 'great-grandchild');
1051
-		case 'chisondau':
1052
-			return I18N::translateContext('child’s son’s daughter', 'great-granddaughter');
1053
-		case 'chisonson':
1054
-			return I18N::translateContext('child’s son’s son', 'great-grandson');
1055
-		case 'chisonwif':
1056
-			return I18N::translateContext('child’s son’s wife', 'grandson’s wife');
1057
-		case 'dauchichi':
1058
-			return I18N::translateContext('daughter’s child’s child', 'great-grandchild');
1059
-		case 'dauchidau':
1060
-			return I18N::translateContext('daughter’s child’s daughter', 'great-granddaughter');
1061
-		case 'dauchison':
1062
-			return I18N::translateContext('daughter’s child’s son', 'great-grandson');
1063
-		case 'daudauchi':
1064
-			return I18N::translateContext('daughter’s daughter’s child', 'great-grandchild');
1065
-		case 'daudaudau':
1066
-			return I18N::translateContext('daughter’s daughter’s daughter', 'great-granddaughter');
1067
-		case 'daudauhus':
1068
-			return I18N::translateContext('daughter’s daughter’s husband', 'granddaughter’s husband');
1069
-		case 'daudauson':
1070
-			return I18N::translateContext('daughter’s daughter’s son', 'great-grandson');
1071
-		case 'dauhusfat':
1072
-			return I18N::translateContext('daughter’s husband’s father', 'son-in-law’s father');
1073
-		case 'dauhusmot':
1074
-			return I18N::translateContext('daughter’s husband’s mother', 'son-in-law’s mother');
1075
-		case 'dauhuspar':
1076
-			return I18N::translateContext('daughter’s husband’s parent', 'son-in-law’s parent');
1077
-		case 'dausonchi':
1078
-			return I18N::translateContext('daughter’s son’s child', 'great-grandchild');
1079
-		case 'dausondau':
1080
-			return I18N::translateContext('daughter’s son’s daughter', 'great-granddaughter');
1081
-		case 'dausonson':
1082
-			return I18N::translateContext('daughter’s son’s son', 'great-grandson');
1083
-		case 'dausonwif':
1084
-			return I18N::translateContext('daughter’s son’s wife', 'grandson’s wife');
1085
-		case 'fatbrochi':
1086
-			return I18N::translateContext('father’s brother’s child', 'first cousin');
1087
-		case 'fatbrodau':
1088
-			return I18N::translateContext('father’s brother’s daughter', 'first cousin');
1089
-		case 'fatbroson':
1090
-			return I18N::translateContext('father’s brother’s son', 'first cousin');
1091
-		case 'fatbrowif':
1092
-			return I18N::translateContext('father’s brother’s wife', 'aunt');
1093
-		case 'fatfatbro':
1094
-			return I18N::translateContext('father’s father’s brother', 'great-uncle');
1095
-		case 'fatfatfat':
1096
-			return I18N::translateContext('father’s father’s father', 'great-grandfather');
1097
-		case 'fatfatmot':
1098
-			return I18N::translateContext('father’s father’s mother', 'great-grandmother');
1099
-		case 'fatfatpar':
1100
-			return I18N::translateContext('father’s father’s parent', 'great-grandparent');
1101
-		case 'fatfatsib':
1102
-			return I18N::translateContext('father’s father’s sibling', 'great-aunt/uncle');
1103
-		case 'fatfatsis':
1104
-			return I18N::translateContext('father’s father’s sister', 'great-aunt');
1105
-		case 'fatmotbro':
1106
-			return I18N::translateContext('father’s mother’s brother', 'great-uncle');
1107
-		case 'fatmotfat':
1108
-			return I18N::translateContext('father’s mother’s father', 'great-grandfather');
1109
-		case 'fatmotmot':
1110
-			return I18N::translateContext('father’s mother’s mother', 'great-grandmother');
1111
-		case 'fatmotpar':
1112
-			return I18N::translateContext('father’s mother’s parent', 'great-grandparent');
1113
-		case 'fatmotsib':
1114
-			return I18N::translateContext('father’s mother’s sibling', 'great-aunt/uncle');
1115
-		case 'fatmotsis':
1116
-			return I18N::translateContext('father’s mother’s sister', 'great-aunt');
1117
-		case 'fatparbro':
1118
-			return I18N::translateContext('father’s parent’s brother', 'great-uncle');
1119
-		case 'fatparfat':
1120
-			return I18N::translateContext('father’s parent’s father', 'great-grandfather');
1121
-		case 'fatparmot':
1122
-			return I18N::translateContext('father’s parent’s mother', 'great-grandmother');
1123
-		case 'fatparpar':
1124
-			return I18N::translateContext('father’s parent’s parent', 'great-grandparent');
1125
-		case 'fatparsib':
1126
-			return I18N::translateContext('father’s parent’s sibling', 'great-aunt/uncle');
1127
-		case 'fatparsis':
1128
-			return I18N::translateContext('father’s parent’s sister', 'great-aunt');
1129
-		case 'fatsischi':
1130
-			return I18N::translateContext('father’s sister’s child', 'first cousin');
1131
-		case 'fatsisdau':
1132
-			return I18N::translateContext('father’s sister’s daughter', 'first cousin');
1133
-		case 'fatsishus':
1134
-			return I18N::translateContext('father’s sister’s husband', 'uncle');
1135
-		case 'fatsisson':
1136
-			return I18N::translateContext('father’s sister’s son', 'first cousin');
1137
-		case 'fatwifchi':
1138
-			return I18N::translateContext('father’s wife’s child', 'step-sibling');
1139
-		case 'fatwifdau':
1140
-			return I18N::translateContext('father’s wife’s daughter', 'step-sister');
1141
-		case 'fatwifson':
1142
-			return I18N::translateContext('father’s wife’s son', 'step-brother');
1143
-		case 'husbrowif':
1144
-			return I18N::translateContext('husband’s brother’s wife', 'sister-in-law');
1145
-		case 'hussishus':
1146
-			return I18N::translateContext('husband’s sister’s husband', 'brother-in-law');
1147
-		case 'motbrochi':
1148
-			return I18N::translateContext('mother’s brother’s child', 'first cousin');
1149
-		case 'motbrodau':
1150
-			return I18N::translateContext('mother’s brother’s daughter', 'first cousin');
1151
-		case 'motbroson':
1152
-			return I18N::translateContext('mother’s brother’s son', 'first cousin');
1153
-		case 'motbrowif':
1154
-			return I18N::translateContext('mother’s brother’s wife', 'aunt');
1155
-		case 'motfatbro':
1156
-			return I18N::translateContext('mother’s father’s brother', 'great-uncle');
1157
-		case 'motfatfat':
1158
-			return I18N::translateContext('mother’s father’s father', 'great-grandfather');
1159
-		case 'motfatmot':
1160
-			return I18N::translateContext('mother’s father’s mother', 'great-grandmother');
1161
-		case 'motfatpar':
1162
-			return I18N::translateContext('mother’s father’s parent', 'great-grandparent');
1163
-		case 'motfatsib':
1164
-			return I18N::translateContext('mother’s father’s sibling', 'great-aunt/uncle');
1165
-		case 'motfatsis':
1166
-			return I18N::translateContext('mother’s father’s sister', 'great-aunt');
1167
-		case 'mothuschi':
1168
-			return I18N::translateContext('mother’s husband’s child', 'step-sibling');
1169
-		case 'mothusdau':
1170
-			return I18N::translateContext('mother’s husband’s daughter', 'step-sister');
1171
-		case 'mothusson':
1172
-			return I18N::translateContext('mother’s husband’s son', 'step-brother');
1173
-		case 'motmotbro':
1174
-			return I18N::translateContext('mother’s mother’s brother', 'great-uncle');
1175
-		case 'motmotfat':
1176
-			return I18N::translateContext('mother’s mother’s father', 'great-grandfather');
1177
-		case 'motmotmot':
1178
-			return I18N::translateContext('mother’s mother’s mother', 'great-grandmother');
1179
-		case 'motmotpar':
1180
-			return I18N::translateContext('mother’s mother’s parent', 'great-grandparent');
1181
-		case 'motmotsib':
1182
-			return I18N::translateContext('mother’s mother’s sibling', 'great-aunt/uncle');
1183
-		case 'motmotsis':
1184
-			return I18N::translateContext('mother’s mother’s sister', 'great-aunt');
1185
-		case 'motparbro':
1186
-			return I18N::translateContext('mother’s parent’s brother', 'great-uncle');
1187
-		case 'motparfat':
1188
-			return I18N::translateContext('mother’s parent’s father', 'great-grandfather');
1189
-		case 'motparmot':
1190
-			return I18N::translateContext('mother’s parent’s mother', 'great-grandmother');
1191
-		case 'motparpar':
1192
-			return I18N::translateContext('mother’s parent’s parent', 'great-grandparent');
1193
-		case 'motparsib':
1194
-			return I18N::translateContext('mother’s parent’s sibling', 'great-aunt/uncle');
1195
-		case 'motparsis':
1196
-			return I18N::translateContext('mother’s parent’s sister', 'great-aunt');
1197
-		case 'motsischi':
1198
-			return I18N::translateContext('mother’s sister’s child', 'first cousin');
1199
-		case 'motsisdau':
1200
-			return I18N::translateContext('mother’s sister’s daughter', 'first cousin');
1201
-		case 'motsishus':
1202
-			return I18N::translateContext('mother’s sister’s husband', 'uncle');
1203
-		case 'motsisson':
1204
-			return I18N::translateContext('mother’s sister’s son', 'first cousin');
1205
-		case 'parbrowif':
1206
-			return I18N::translateContext('parent’s brother’s wife', 'aunt');
1207
-		case 'parfatbro':
1208
-			return I18N::translateContext('parent’s father’s brother', 'great-uncle');
1209
-		case 'parfatfat':
1210
-			return I18N::translateContext('parent’s father’s father', 'great-grandfather');
1211
-		case 'parfatmot':
1212
-			return I18N::translateContext('parent’s father’s mother', 'great-grandmother');
1213
-		case 'parfatpar':
1214
-			return I18N::translateContext('parent’s father’s parent', 'great-grandparent');
1215
-		case 'parfatsib':
1216
-			return I18N::translateContext('parent’s father’s sibling', 'great-aunt/uncle');
1217
-		case 'parfatsis':
1218
-			return I18N::translateContext('parent’s father’s sister', 'great-aunt');
1219
-		case 'parmotbro':
1220
-			return I18N::translateContext('parent’s mother’s brother', 'great-uncle');
1221
-		case 'parmotfat':
1222
-			return I18N::translateContext('parent’s mother’s father', 'great-grandfather');
1223
-		case 'parmotmot':
1224
-			return I18N::translateContext('parent’s mother’s mother', 'great-grandmother');
1225
-		case 'parmotpar':
1226
-			return I18N::translateContext('parent’s mother’s parent', 'great-grandparent');
1227
-		case 'parmotsib':
1228
-			return I18N::translateContext('parent’s mother’s sibling', 'great-aunt/uncle');
1229
-		case 'parmotsis':
1230
-			return I18N::translateContext('parent’s mother’s sister', 'great-aunt');
1231
-		case 'parparbro':
1232
-			return I18N::translateContext('parent’s parent’s brother', 'great-uncle');
1233
-		case 'parparfat':
1234
-			return I18N::translateContext('parent’s parent’s father', 'great-grandfather');
1235
-		case 'parparmot':
1236
-			return I18N::translateContext('parent’s parent’s mother', 'great-grandmother');
1237
-		case 'parparpar':
1238
-			return I18N::translateContext('parent’s parent’s parent', 'great-grandparent');
1239
-		case 'parparsib':
1240
-			return I18N::translateContext('parent’s parent’s sibling', 'great-aunt/uncle');
1241
-		case 'parparsis':
1242
-			return I18N::translateContext('parent’s parent’s sister', 'great-aunt');
1243
-		case 'parsishus':
1244
-			return I18N::translateContext('parent’s sister’s husband', 'uncle');
1245
-		case 'parspochi':
1246
-			return I18N::translateContext('parent’s spouse’s child', 'step-sibling');
1247
-		case 'parspodau':
1248
-			return I18N::translateContext('parent’s spouse’s daughter', 'step-sister');
1249
-		case 'parsposon':
1250
-			return I18N::translateContext('parent’s spouse’s son', 'step-brother');
1251
-		case 'sibchichi':
1252
-			return I18N::translateContext('sibling’s child’s child', 'great-nephew/niece');
1253
-		case 'sibchidau':
1254
-			return I18N::translateContext('sibling’s child’s daughter', 'great-niece');
1255
-		case 'sibchison':
1256
-			return I18N::translateContext('sibling’s child’s son', 'great-nephew');
1257
-		case 'sibdauchi':
1258
-			return I18N::translateContext('sibling’s daughter’s child', 'great-nephew/niece');
1259
-		case 'sibdaudau':
1260
-			return I18N::translateContext('sibling’s daughter’s daughter', 'great-niece');
1261
-		case 'sibdauhus':
1262
-			return I18N::translateContext('sibling’s daughter’s husband', 'nephew-in-law');
1263
-		case 'sibdauson':
1264
-			return I18N::translateContext('sibling’s daughter’s son', 'great-nephew');
1265
-		case 'sibsonchi':
1266
-			return I18N::translateContext('sibling’s son’s child', 'great-nephew/niece');
1267
-		case 'sibsondau':
1268
-			return I18N::translateContext('sibling’s son’s daughter', 'great-niece');
1269
-		case 'sibsonson':
1270
-			return I18N::translateContext('sibling’s son’s son', 'great-nephew');
1271
-		case 'sibsonwif':
1272
-			return I18N::translateContext('sibling’s son’s wife', 'niece-in-law');
1273
-		case 'sischichi':
1274
-			if ($sex1 === 'M') {
1275
-				return I18N::translateContext('(a man’s) sister’s child’s child', 'great-nephew/niece');
1276
-			} else {
1277
-				return I18N::translateContext('(a woman’s) sister’s child’s child', 'great-nephew/niece');
1278
-			}
1279
-		case 'sischidau':
1280
-			if ($sex1 === 'M') {
1281
-				return I18N::translateContext('(a man’s) sister’s child’s daughter', 'great-niece');
1282
-			} else {
1283
-				return I18N::translateContext('(a woman’s) sister’s child’s daughter', 'great-niece');
1284
-			}
1285
-		case 'sischison':
1286
-			if ($sex1 === 'M') {
1287
-				return I18N::translateContext('(a man’s) sister’s child’s son', 'great-nephew');
1288
-			} else {
1289
-				return I18N::translateContext('(a woman’s) sister’s child’s son', 'great-nephew');
1290
-			}
1291
-		case 'sisdauchi':
1292
-			if ($sex1 === 'M') {
1293
-				return I18N::translateContext('(a man’s) sister’s daughter’s child', 'great-nephew/niece');
1294
-			} else {
1295
-				return I18N::translateContext('(a woman’s) sister’s daughter’s child', 'great-nephew/niece');
1296
-			}
1297
-		case 'sisdaudau':
1298
-			if ($sex1 === 'M') {
1299
-				return I18N::translateContext('(a man’s) sister’s daughter’s daughter', 'great-niece');
1300
-			} else {
1301
-				return I18N::translateContext('(a woman’s) sister’s daughter’s daughter', 'great-niece');
1302
-			}
1303
-		case 'sisdauhus':
1304
-			return I18N::translateContext('sisters’s daughter’s husband', 'nephew-in-law');
1305
-		case 'sisdauson':
1306
-			if ($sex1 === 'M') {
1307
-				return I18N::translateContext('(a man’s) sister’s daughter’s son', 'great-nephew');
1308
-			} else {
1309
-				return I18N::translateContext('(a woman’s) sister’s daughter’s son', 'great-nephew');
1310
-			}
1311
-		case 'sishusbro':
1312
-			return I18N::translateContext('sister’s husband’s brother', 'brother-in-law');
1313
-		case 'sishussib':
1314
-			return I18N::translateContext('sister’s husband’s sibling', 'brother/sister-in-law');
1315
-		case 'sishussis':
1316
-			return I18N::translateContext('sister’s husband’s sister', 'sister-in-law');
1317
-		case 'sissonchi':
1318
-			if ($sex1 === 'M') {
1319
-				return I18N::translateContext('(a man’s) sister’s son’s child', 'great-nephew/niece');
1320
-			} else {
1321
-				return I18N::translateContext('(a woman’s) sister’s son’s child', 'great-nephew/niece');
1322
-			}
1323
-		case 'sissondau':
1324
-			if ($sex1 === 'M') {
1325
-				return I18N::translateContext('(a man’s) sister’s son’s daughter', 'great-niece');
1326
-			} else {
1327
-				return I18N::translateContext('(a woman’s) sister’s son’s daughter', 'great-niece');
1328
-			}
1329
-		case 'sissonson':
1330
-			if ($sex1 === 'M') {
1331
-				return I18N::translateContext('(a man’s) sister’s son’s son', 'great-nephew');
1332
-			} else {
1333
-				return I18N::translateContext('(a woman’s) sister’s son’s son', 'great-nephew');
1334
-			}
1335
-		case 'sissonwif':
1336
-			return I18N::translateContext('sisters’s son’s wife', 'niece-in-law');
1337
-		case 'sonchichi':
1338
-			return I18N::translateContext('son’s child’s child', 'great-grandchild');
1339
-		case 'sonchidau':
1340
-			return I18N::translateContext('son’s child’s daughter', 'great-granddaughter');
1341
-		case 'sonchison':
1342
-			return I18N::translateContext('son’s child’s son', 'great-grandson');
1343
-		case 'sondauchi':
1344
-			return I18N::translateContext('son’s daughter’s child', 'great-grandchild');
1345
-		case 'sondaudau':
1346
-			return I18N::translateContext('son’s daughter’s daughter', 'great-granddaughter');
1347
-		case 'sondauhus':
1348
-			return I18N::translateContext('son’s daughter’s husband', 'granddaughter’s husband');
1349
-		case 'sondauson':
1350
-			return I18N::translateContext('son’s daughter’s son', 'great-grandson');
1351
-		case 'sonsonchi':
1352
-			return I18N::translateContext('son’s son’s child', 'great-grandchild');
1353
-		case 'sonsondau':
1354
-			return I18N::translateContext('son’s son’s daughter', 'great-granddaughter');
1355
-		case 'sonsonson':
1356
-			return I18N::translateContext('son’s son’s son', 'great-grandson');
1357
-		case 'sonsonwif':
1358
-			return I18N::translateContext('son’s son’s wife', 'grandson’s wife');
1359
-		case 'sonwiffat':
1360
-			return I18N::translateContext('son’s wife’s father', 'daughter-in-law’s father');
1361
-		case 'sonwifmot':
1362
-			return I18N::translateContext('son’s wife’s mother', 'daughter-in-law’s mother');
1363
-		case 'sonwifpar':
1364
-			return I18N::translateContext('son’s wife’s parent', 'daughter-in-law’s parent');
1365
-		case 'wifbrowif':
1366
-			return I18N::translateContext('wife’s brother’s wife', 'sister-in-law');
1367
-		case 'wifsishus':
1368
-			return I18N::translateContext('wife’s sister’s husband', 'brother-in-law');
968
+		    // Level Three relationships
969
+		    // I have commented out some of the unknown-sex relationships that are unlikely to to occur.
970
+		    // Feel free to add them in, if you think they might be needed
971
+		    case 'brochichi':
972
+			    if ($sex1 === 'M') {
973
+				    return I18N::translateContext('(a man’s) brother’s child’s child', 'great-nephew/niece');
974
+			    } else {
975
+				    return I18N::translateContext('(a woman’s) brother’s child’s child', 'great-nephew/niece');
976
+			    }
977
+		    case 'brochidau':
978
+			    if ($sex1 === 'M') {
979
+				    return I18N::translateContext('(a man’s) brother’s child’s daughter', 'great-niece');
980
+			    } else {
981
+				    return I18N::translateContext('(a woman’s) brother’s child’s daughter', 'great-niece');
982
+			    }
983
+		    case 'brochison':
984
+			    if ($sex1 === 'M') {
985
+				    return I18N::translateContext('(a man’s) brother’s child’s son', 'great-nephew');
986
+			    } else {
987
+				    return I18N::translateContext('(a woman’s) brother’s child’s son', 'great-nephew');
988
+			    }
989
+		    case 'brodauchi':
990
+			    if ($sex1 === 'M') {
991
+				    return I18N::translateContext('(a man’s) brother’s daughter’s child', 'great-nephew/niece');
992
+			    } else {
993
+				    return I18N::translateContext('(a woman’s) brother’s daughter’s child', 'great-nephew/niece');
994
+			    }
995
+		    case 'brodaudau':
996
+			    if ($sex1 === 'M') {
997
+				    return I18N::translateContext('(a man’s) brother’s daughter’s daughter', 'great-niece');
998
+			    } else {
999
+				    return I18N::translateContext('(a woman’s) brother’s daughter’s daughter', 'great-niece');
1000
+			    }
1001
+		    case 'brodauhus':
1002
+			    return I18N::translateContext('brother’s daughter’s husband', 'nephew-in-law');
1003
+		    case 'brodauson':
1004
+			    if ($sex1 === 'M') {
1005
+				    return I18N::translateContext('(a man’s) brother’s daughter’s son', 'great-nephew');
1006
+			    } else {
1007
+				    return I18N::translateContext('(a woman’s) brother’s daughter’s son', 'great-nephew');
1008
+			    }
1009
+		    case 'brosonchi':
1010
+			    if ($sex1 === 'M') {
1011
+				    return I18N::translateContext('(a man’s) brother’s son’s child', 'great-nephew/niece');
1012
+			    } else {
1013
+				    return I18N::translateContext('(a woman’s) brother’s son’s child', 'great-nephew/niece');
1014
+			    }
1015
+		    case 'brosondau':
1016
+			    if ($sex1 === 'M') {
1017
+				    return I18N::translateContext('(a man’s) brother’s son’s daughter', 'great-niece');
1018
+			    } else {
1019
+				    return I18N::translateContext('(a woman’s) brother’s son’s daughter', 'great-niece');
1020
+			    }
1021
+		    case 'brosonson':
1022
+			    if ($sex1 === 'M') {
1023
+				    return I18N::translateContext('(a man’s) brother’s son’s son', 'great-nephew');
1024
+			    } else {
1025
+				    return I18N::translateContext('(a woman’s) brother’s son’s son', 'great-nephew');
1026
+			    }
1027
+		    case 'brosonwif':
1028
+			    return I18N::translateContext('brother’s son’s wife', 'niece-in-law');
1029
+		    case 'browifbro':
1030
+			    return I18N::translateContext('brother’s wife’s brother', 'brother-in-law');
1031
+		    case 'browifsib':
1032
+			    return I18N::translateContext('brother’s wife’s sibling', 'brother/sister-in-law');
1033
+		    case 'browifsis':
1034
+			    return I18N::translateContext('brother’s wife’s sister', 'sister-in-law');
1035
+		    case 'chichichi':
1036
+			    return I18N::translateContext('child’s child’s child', 'great-grandchild');
1037
+		    case 'chichidau':
1038
+			    return I18N::translateContext('child’s child’s daughter', 'great-granddaughter');
1039
+		    case 'chichison':
1040
+			    return I18N::translateContext('child’s child’s son', 'great-grandson');
1041
+		    case 'chidauchi':
1042
+			    return I18N::translateContext('child’s daughter’s child', 'great-grandchild');
1043
+		    case 'chidaudau':
1044
+			    return I18N::translateContext('child’s daughter’s daughter', 'great-granddaughter');
1045
+		    case 'chidauhus':
1046
+			    return I18N::translateContext('child’s daughter’s husband', 'granddaughter’s husband');
1047
+		    case 'chidauson':
1048
+			    return I18N::translateContext('child’s daughter’s son', 'great-grandson');
1049
+		    case 'chisonchi':
1050
+			    return I18N::translateContext('child’s son’s child', 'great-grandchild');
1051
+		    case 'chisondau':
1052
+			    return I18N::translateContext('child’s son’s daughter', 'great-granddaughter');
1053
+		    case 'chisonson':
1054
+			    return I18N::translateContext('child’s son’s son', 'great-grandson');
1055
+		    case 'chisonwif':
1056
+			    return I18N::translateContext('child’s son’s wife', 'grandson’s wife');
1057
+		    case 'dauchichi':
1058
+			    return I18N::translateContext('daughter’s child’s child', 'great-grandchild');
1059
+		    case 'dauchidau':
1060
+			    return I18N::translateContext('daughter’s child’s daughter', 'great-granddaughter');
1061
+		    case 'dauchison':
1062
+			    return I18N::translateContext('daughter’s child’s son', 'great-grandson');
1063
+		    case 'daudauchi':
1064
+			    return I18N::translateContext('daughter’s daughter’s child', 'great-grandchild');
1065
+		    case 'daudaudau':
1066
+			    return I18N::translateContext('daughter’s daughter’s daughter', 'great-granddaughter');
1067
+		    case 'daudauhus':
1068
+			    return I18N::translateContext('daughter’s daughter’s husband', 'granddaughter’s husband');
1069
+		    case 'daudauson':
1070
+			    return I18N::translateContext('daughter’s daughter’s son', 'great-grandson');
1071
+		    case 'dauhusfat':
1072
+			    return I18N::translateContext('daughter’s husband’s father', 'son-in-law’s father');
1073
+		    case 'dauhusmot':
1074
+			    return I18N::translateContext('daughter’s husband’s mother', 'son-in-law’s mother');
1075
+		    case 'dauhuspar':
1076
+			    return I18N::translateContext('daughter’s husband’s parent', 'son-in-law’s parent');
1077
+		    case 'dausonchi':
1078
+			    return I18N::translateContext('daughter’s son’s child', 'great-grandchild');
1079
+		    case 'dausondau':
1080
+			    return I18N::translateContext('daughter’s son’s daughter', 'great-granddaughter');
1081
+		    case 'dausonson':
1082
+			    return I18N::translateContext('daughter’s son’s son', 'great-grandson');
1083
+		    case 'dausonwif':
1084
+			    return I18N::translateContext('daughter’s son’s wife', 'grandson’s wife');
1085
+		    case 'fatbrochi':
1086
+			    return I18N::translateContext('father’s brother’s child', 'first cousin');
1087
+		    case 'fatbrodau':
1088
+			    return I18N::translateContext('father’s brother’s daughter', 'first cousin');
1089
+		    case 'fatbroson':
1090
+			    return I18N::translateContext('father’s brother’s son', 'first cousin');
1091
+		    case 'fatbrowif':
1092
+			    return I18N::translateContext('father’s brother’s wife', 'aunt');
1093
+		    case 'fatfatbro':
1094
+			    return I18N::translateContext('father’s father’s brother', 'great-uncle');
1095
+		    case 'fatfatfat':
1096
+			    return I18N::translateContext('father’s father’s father', 'great-grandfather');
1097
+		    case 'fatfatmot':
1098
+			    return I18N::translateContext('father’s father’s mother', 'great-grandmother');
1099
+		    case 'fatfatpar':
1100
+			    return I18N::translateContext('father’s father’s parent', 'great-grandparent');
1101
+		    case 'fatfatsib':
1102
+			    return I18N::translateContext('father’s father’s sibling', 'great-aunt/uncle');
1103
+		    case 'fatfatsis':
1104
+			    return I18N::translateContext('father’s father’s sister', 'great-aunt');
1105
+		    case 'fatmotbro':
1106
+			    return I18N::translateContext('father’s mother’s brother', 'great-uncle');
1107
+		    case 'fatmotfat':
1108
+			    return I18N::translateContext('father’s mother’s father', 'great-grandfather');
1109
+		    case 'fatmotmot':
1110
+			    return I18N::translateContext('father’s mother’s mother', 'great-grandmother');
1111
+		    case 'fatmotpar':
1112
+			    return I18N::translateContext('father’s mother’s parent', 'great-grandparent');
1113
+		    case 'fatmotsib':
1114
+			    return I18N::translateContext('father’s mother’s sibling', 'great-aunt/uncle');
1115
+		    case 'fatmotsis':
1116
+			    return I18N::translateContext('father’s mother’s sister', 'great-aunt');
1117
+		    case 'fatparbro':
1118
+			    return I18N::translateContext('father’s parent’s brother', 'great-uncle');
1119
+		    case 'fatparfat':
1120
+			    return I18N::translateContext('father’s parent’s father', 'great-grandfather');
1121
+		    case 'fatparmot':
1122
+			    return I18N::translateContext('father’s parent’s mother', 'great-grandmother');
1123
+		    case 'fatparpar':
1124
+			    return I18N::translateContext('father’s parent’s parent', 'great-grandparent');
1125
+		    case 'fatparsib':
1126
+			    return I18N::translateContext('father’s parent’s sibling', 'great-aunt/uncle');
1127
+		    case 'fatparsis':
1128
+			    return I18N::translateContext('father’s parent’s sister', 'great-aunt');
1129
+		    case 'fatsischi':
1130
+			    return I18N::translateContext('father’s sister’s child', 'first cousin');
1131
+		    case 'fatsisdau':
1132
+			    return I18N::translateContext('father’s sister’s daughter', 'first cousin');
1133
+		    case 'fatsishus':
1134
+			    return I18N::translateContext('father’s sister’s husband', 'uncle');
1135
+		    case 'fatsisson':
1136
+			    return I18N::translateContext('father’s sister’s son', 'first cousin');
1137
+		    case 'fatwifchi':
1138
+			    return I18N::translateContext('father’s wife’s child', 'step-sibling');
1139
+		    case 'fatwifdau':
1140
+			    return I18N::translateContext('father’s wife’s daughter', 'step-sister');
1141
+		    case 'fatwifson':
1142
+			    return I18N::translateContext('father’s wife’s son', 'step-brother');
1143
+		    case 'husbrowif':
1144
+			    return I18N::translateContext('husband’s brother’s wife', 'sister-in-law');
1145
+		    case 'hussishus':
1146
+			    return I18N::translateContext('husband’s sister’s husband', 'brother-in-law');
1147
+		    case 'motbrochi':
1148
+			    return I18N::translateContext('mother’s brother’s child', 'first cousin');
1149
+		    case 'motbrodau':
1150
+			    return I18N::translateContext('mother’s brother’s daughter', 'first cousin');
1151
+		    case 'motbroson':
1152
+			    return I18N::translateContext('mother’s brother’s son', 'first cousin');
1153
+		    case 'motbrowif':
1154
+			    return I18N::translateContext('mother’s brother’s wife', 'aunt');
1155
+		    case 'motfatbro':
1156
+			    return I18N::translateContext('mother’s father’s brother', 'great-uncle');
1157
+		    case 'motfatfat':
1158
+			    return I18N::translateContext('mother’s father’s father', 'great-grandfather');
1159
+		    case 'motfatmot':
1160
+			    return I18N::translateContext('mother’s father’s mother', 'great-grandmother');
1161
+		    case 'motfatpar':
1162
+			    return I18N::translateContext('mother’s father’s parent', 'great-grandparent');
1163
+		    case 'motfatsib':
1164
+			    return I18N::translateContext('mother’s father’s sibling', 'great-aunt/uncle');
1165
+		    case 'motfatsis':
1166
+			    return I18N::translateContext('mother’s father’s sister', 'great-aunt');
1167
+		    case 'mothuschi':
1168
+			    return I18N::translateContext('mother’s husband’s child', 'step-sibling');
1169
+		    case 'mothusdau':
1170
+			    return I18N::translateContext('mother’s husband’s daughter', 'step-sister');
1171
+		    case 'mothusson':
1172
+			    return I18N::translateContext('mother’s husband’s son', 'step-brother');
1173
+		    case 'motmotbro':
1174
+			    return I18N::translateContext('mother’s mother’s brother', 'great-uncle');
1175
+		    case 'motmotfat':
1176
+			    return I18N::translateContext('mother’s mother’s father', 'great-grandfather');
1177
+		    case 'motmotmot':
1178
+			    return I18N::translateContext('mother’s mother’s mother', 'great-grandmother');
1179
+		    case 'motmotpar':
1180
+			    return I18N::translateContext('mother’s mother’s parent', 'great-grandparent');
1181
+		    case 'motmotsib':
1182
+			    return I18N::translateContext('mother’s mother’s sibling', 'great-aunt/uncle');
1183
+		    case 'motmotsis':
1184
+			    return I18N::translateContext('mother’s mother’s sister', 'great-aunt');
1185
+		    case 'motparbro':
1186
+			    return I18N::translateContext('mother’s parent’s brother', 'great-uncle');
1187
+		    case 'motparfat':
1188
+			    return I18N::translateContext('mother’s parent’s father', 'great-grandfather');
1189
+		    case 'motparmot':
1190
+			    return I18N::translateContext('mother’s parent’s mother', 'great-grandmother');
1191
+		    case 'motparpar':
1192
+			    return I18N::translateContext('mother’s parent’s parent', 'great-grandparent');
1193
+		    case 'motparsib':
1194
+			    return I18N::translateContext('mother’s parent’s sibling', 'great-aunt/uncle');
1195
+		    case 'motparsis':
1196
+			    return I18N::translateContext('mother’s parent’s sister', 'great-aunt');
1197
+		    case 'motsischi':
1198
+			    return I18N::translateContext('mother’s sister’s child', 'first cousin');
1199
+		    case 'motsisdau':
1200
+			    return I18N::translateContext('mother’s sister’s daughter', 'first cousin');
1201
+		    case 'motsishus':
1202
+			    return I18N::translateContext('mother’s sister’s husband', 'uncle');
1203
+		    case 'motsisson':
1204
+			    return I18N::translateContext('mother’s sister’s son', 'first cousin');
1205
+		    case 'parbrowif':
1206
+			    return I18N::translateContext('parent’s brother’s wife', 'aunt');
1207
+		    case 'parfatbro':
1208
+			    return I18N::translateContext('parent’s father’s brother', 'great-uncle');
1209
+		    case 'parfatfat':
1210
+			    return I18N::translateContext('parent’s father’s father', 'great-grandfather');
1211
+		    case 'parfatmot':
1212
+			    return I18N::translateContext('parent’s father’s mother', 'great-grandmother');
1213
+		    case 'parfatpar':
1214
+			    return I18N::translateContext('parent’s father’s parent', 'great-grandparent');
1215
+		    case 'parfatsib':
1216
+			    return I18N::translateContext('parent’s father’s sibling', 'great-aunt/uncle');
1217
+		    case 'parfatsis':
1218
+			    return I18N::translateContext('parent’s father’s sister', 'great-aunt');
1219
+		    case 'parmotbro':
1220
+			    return I18N::translateContext('parent’s mother’s brother', 'great-uncle');
1221
+		    case 'parmotfat':
1222
+			    return I18N::translateContext('parent’s mother’s father', 'great-grandfather');
1223
+		    case 'parmotmot':
1224
+			    return I18N::translateContext('parent’s mother’s mother', 'great-grandmother');
1225
+		    case 'parmotpar':
1226
+			    return I18N::translateContext('parent’s mother’s parent', 'great-grandparent');
1227
+		    case 'parmotsib':
1228
+			    return I18N::translateContext('parent’s mother’s sibling', 'great-aunt/uncle');
1229
+		    case 'parmotsis':
1230
+			    return I18N::translateContext('parent’s mother’s sister', 'great-aunt');
1231
+		    case 'parparbro':
1232
+			    return I18N::translateContext('parent’s parent’s brother', 'great-uncle');
1233
+		    case 'parparfat':
1234
+			    return I18N::translateContext('parent’s parent’s father', 'great-grandfather');
1235
+		    case 'parparmot':
1236
+			    return I18N::translateContext('parent’s parent’s mother', 'great-grandmother');
1237
+		    case 'parparpar':
1238
+			    return I18N::translateContext('parent’s parent’s parent', 'great-grandparent');
1239
+		    case 'parparsib':
1240
+			    return I18N::translateContext('parent’s parent’s sibling', 'great-aunt/uncle');
1241
+		    case 'parparsis':
1242
+			    return I18N::translateContext('parent’s parent’s sister', 'great-aunt');
1243
+		    case 'parsishus':
1244
+			    return I18N::translateContext('parent’s sister’s husband', 'uncle');
1245
+		    case 'parspochi':
1246
+			    return I18N::translateContext('parent’s spouse’s child', 'step-sibling');
1247
+		    case 'parspodau':
1248
+			    return I18N::translateContext('parent’s spouse’s daughter', 'step-sister');
1249
+		    case 'parsposon':
1250
+			    return I18N::translateContext('parent’s spouse’s son', 'step-brother');
1251
+		    case 'sibchichi':
1252
+			    return I18N::translateContext('sibling’s child’s child', 'great-nephew/niece');
1253
+		    case 'sibchidau':
1254
+			    return I18N::translateContext('sibling’s child’s daughter', 'great-niece');
1255
+		    case 'sibchison':
1256
+			    return I18N::translateContext('sibling’s child’s son', 'great-nephew');
1257
+		    case 'sibdauchi':
1258
+			    return I18N::translateContext('sibling’s daughter’s child', 'great-nephew/niece');
1259
+		    case 'sibdaudau':
1260
+			    return I18N::translateContext('sibling’s daughter’s daughter', 'great-niece');
1261
+		    case 'sibdauhus':
1262
+			    return I18N::translateContext('sibling’s daughter’s husband', 'nephew-in-law');
1263
+		    case 'sibdauson':
1264
+			    return I18N::translateContext('sibling’s daughter’s son', 'great-nephew');
1265
+		    case 'sibsonchi':
1266
+			    return I18N::translateContext('sibling’s son’s child', 'great-nephew/niece');
1267
+		    case 'sibsondau':
1268
+			    return I18N::translateContext('sibling’s son’s daughter', 'great-niece');
1269
+		    case 'sibsonson':
1270
+			    return I18N::translateContext('sibling’s son’s son', 'great-nephew');
1271
+		    case 'sibsonwif':
1272
+			    return I18N::translateContext('sibling’s son’s wife', 'niece-in-law');
1273
+		    case 'sischichi':
1274
+			    if ($sex1 === 'M') {
1275
+				    return I18N::translateContext('(a man’s) sister’s child’s child', 'great-nephew/niece');
1276
+			    } else {
1277
+				    return I18N::translateContext('(a woman’s) sister’s child’s child', 'great-nephew/niece');
1278
+			    }
1279
+		    case 'sischidau':
1280
+			    if ($sex1 === 'M') {
1281
+				    return I18N::translateContext('(a man’s) sister’s child’s daughter', 'great-niece');
1282
+			    } else {
1283
+				    return I18N::translateContext('(a woman’s) sister’s child’s daughter', 'great-niece');
1284
+			    }
1285
+		    case 'sischison':
1286
+			    if ($sex1 === 'M') {
1287
+				    return I18N::translateContext('(a man’s) sister’s child’s son', 'great-nephew');
1288
+			    } else {
1289
+				    return I18N::translateContext('(a woman’s) sister’s child’s son', 'great-nephew');
1290
+			    }
1291
+		    case 'sisdauchi':
1292
+			    if ($sex1 === 'M') {
1293
+				    return I18N::translateContext('(a man’s) sister’s daughter’s child', 'great-nephew/niece');
1294
+			    } else {
1295
+				    return I18N::translateContext('(a woman’s) sister’s daughter’s child', 'great-nephew/niece');
1296
+			    }
1297
+		    case 'sisdaudau':
1298
+			    if ($sex1 === 'M') {
1299
+				    return I18N::translateContext('(a man’s) sister’s daughter’s daughter', 'great-niece');
1300
+			    } else {
1301
+				    return I18N::translateContext('(a woman’s) sister’s daughter’s daughter', 'great-niece');
1302
+			    }
1303
+		    case 'sisdauhus':
1304
+			    return I18N::translateContext('sisters’s daughter’s husband', 'nephew-in-law');
1305
+		    case 'sisdauson':
1306
+			    if ($sex1 === 'M') {
1307
+				    return I18N::translateContext('(a man’s) sister’s daughter’s son', 'great-nephew');
1308
+			    } else {
1309
+				    return I18N::translateContext('(a woman’s) sister’s daughter’s son', 'great-nephew');
1310
+			    }
1311
+		    case 'sishusbro':
1312
+			    return I18N::translateContext('sister’s husband’s brother', 'brother-in-law');
1313
+		    case 'sishussib':
1314
+			    return I18N::translateContext('sister’s husband’s sibling', 'brother/sister-in-law');
1315
+		    case 'sishussis':
1316
+			    return I18N::translateContext('sister’s husband’s sister', 'sister-in-law');
1317
+		    case 'sissonchi':
1318
+			    if ($sex1 === 'M') {
1319
+				    return I18N::translateContext('(a man’s) sister’s son’s child', 'great-nephew/niece');
1320
+			    } else {
1321
+				    return I18N::translateContext('(a woman’s) sister’s son’s child', 'great-nephew/niece');
1322
+			    }
1323
+		    case 'sissondau':
1324
+			    if ($sex1 === 'M') {
1325
+				    return I18N::translateContext('(a man’s) sister’s son’s daughter', 'great-niece');
1326
+			    } else {
1327
+				    return I18N::translateContext('(a woman’s) sister’s son’s daughter', 'great-niece');
1328
+			    }
1329
+		    case 'sissonson':
1330
+			    if ($sex1 === 'M') {
1331
+				    return I18N::translateContext('(a man’s) sister’s son’s son', 'great-nephew');
1332
+			    } else {
1333
+				    return I18N::translateContext('(a woman’s) sister’s son’s son', 'great-nephew');
1334
+			    }
1335
+		    case 'sissonwif':
1336
+			    return I18N::translateContext('sisters’s son’s wife', 'niece-in-law');
1337
+		    case 'sonchichi':
1338
+			    return I18N::translateContext('son’s child’s child', 'great-grandchild');
1339
+		    case 'sonchidau':
1340
+			    return I18N::translateContext('son’s child’s daughter', 'great-granddaughter');
1341
+		    case 'sonchison':
1342
+			    return I18N::translateContext('son’s child’s son', 'great-grandson');
1343
+		    case 'sondauchi':
1344
+			    return I18N::translateContext('son’s daughter’s child', 'great-grandchild');
1345
+		    case 'sondaudau':
1346
+			    return I18N::translateContext('son’s daughter’s daughter', 'great-granddaughter');
1347
+		    case 'sondauhus':
1348
+			    return I18N::translateContext('son’s daughter’s husband', 'granddaughter’s husband');
1349
+		    case 'sondauson':
1350
+			    return I18N::translateContext('son’s daughter’s son', 'great-grandson');
1351
+		    case 'sonsonchi':
1352
+			    return I18N::translateContext('son’s son’s child', 'great-grandchild');
1353
+		    case 'sonsondau':
1354
+			    return I18N::translateContext('son’s son’s daughter', 'great-granddaughter');
1355
+		    case 'sonsonson':
1356
+			    return I18N::translateContext('son’s son’s son', 'great-grandson');
1357
+		    case 'sonsonwif':
1358
+			    return I18N::translateContext('son’s son’s wife', 'grandson’s wife');
1359
+		    case 'sonwiffat':
1360
+			    return I18N::translateContext('son’s wife’s father', 'daughter-in-law’s father');
1361
+		    case 'sonwifmot':
1362
+			    return I18N::translateContext('son’s wife’s mother', 'daughter-in-law’s mother');
1363
+		    case 'sonwifpar':
1364
+			    return I18N::translateContext('son’s wife’s parent', 'daughter-in-law’s parent');
1365
+		    case 'wifbrowif':
1366
+			    return I18N::translateContext('wife’s brother’s wife', 'sister-in-law');
1367
+		    case 'wifsishus':
1368
+			    return I18N::translateContext('wife’s sister’s husband', 'brother-in-law');
1369 1369
 
1370
-		// Some “special case” level four relationships that have specific names in certain languages
1371
-		case 'fatfatbrowif':
1372
-			return I18N::translateContext('father’s father’s brother’s wife', 'great-aunt');
1373
-		case 'fatfatsibspo':
1374
-			return I18N::translateContext('father’s father’s sibling’s spouse', 'great-aunt/uncle');
1375
-		case 'fatfatsishus':
1376
-			return I18N::translateContext('father’s father’s sister’s husband', 'great-uncle');
1377
-		case 'fatmotbrowif':
1378
-			return I18N::translateContext('father’s mother’s brother’s wife', 'great-aunt');
1379
-		case 'fatmotsibspo':
1380
-			return I18N::translateContext('father’s mother’s sibling’s spouse', 'great-aunt/uncle');
1381
-		case 'fatmotsishus':
1382
-			return I18N::translateContext('father’s mother’s sister’s husband', 'great-uncle');
1383
-		case 'fatparbrowif':
1384
-			return I18N::translateContext('father’s parent’s brother’s wife', 'great-aunt');
1385
-		case 'fatparsibspo':
1386
-			return I18N::translateContext('father’s parent’s sibling’s spouse', 'great-aunt/uncle');
1387
-		case 'fatparsishus':
1388
-			return I18N::translateContext('father’s parent’s sister’s husband', 'great-uncle');
1389
-		case 'motfatbrowif':
1390
-			return I18N::translateContext('mother’s father’s brother’s wife', 'great-aunt');
1391
-		case 'motfatsibspo':
1392
-			return I18N::translateContext('mother’s father’s sibling’s spouse', 'great-aunt/uncle');
1393
-		case 'motfatsishus':
1394
-			return I18N::translateContext('mother’s father’s sister’s husband', 'great-uncle');
1395
-		case 'motmotbrowif':
1396
-			return I18N::translateContext('mother’s mother’s brother’s wife', 'great-aunt');
1397
-		case 'motmotsibspo':
1398
-			return I18N::translateContext('mother’s mother’s sibling’s spouse', 'great-aunt/uncle');
1399
-		case 'motmotsishus':
1400
-			return I18N::translateContext('mother’s mother’s sister’s husband', 'great-uncle');
1401
-		case 'motparbrowif':
1402
-			return I18N::translateContext('mother’s parent’s brother’s wife', 'great-aunt');
1403
-		case 'motparsibspo':
1404
-			return I18N::translateContext('mother’s parent’s sibling’s spouse', 'great-aunt/uncle');
1405
-		case 'motparsishus':
1406
-			return I18N::translateContext('mother’s parent’s sister’s husband', 'great-uncle');
1407
-		case 'parfatbrowif':
1408
-			return I18N::translateContext('parent’s father’s brother’s wife', 'great-aunt');
1409
-		case 'parfatsibspo':
1410
-			return I18N::translateContext('parent’s father’s sibling’s spouse', 'great-aunt/uncle');
1411
-		case 'parfatsishus':
1412
-			return I18N::translateContext('parent’s father’s sister’s husband', 'great-uncle');
1413
-		case 'parmotbrowif':
1414
-			return I18N::translateContext('parent’s mother’s brother’s wife', 'great-aunt');
1415
-		case 'parmotsibspo':
1416
-			return I18N::translateContext('parent’s mother’s sibling’s spouse', 'great-aunt/uncle');
1417
-		case 'parmotsishus':
1418
-			return I18N::translateContext('parent’s mother’s sister’s husband', 'great-uncle');
1419
-		case 'parparbrowif':
1420
-			return I18N::translateContext('parent’s parent’s brother’s wife', 'great-aunt');
1421
-		case 'parparsibspo':
1422
-			return I18N::translateContext('parent’s parent’s sibling’s spouse', 'great-aunt/uncle');
1423
-		case 'parparsishus':
1424
-			return I18N::translateContext('parent’s parent’s sister’s husband', 'great-uncle');
1425
-		case 'fatfatbrodau':
1426
-			return I18N::translateContext('father’s father’s brother’s daughter', 'first cousin once removed ascending');
1427
-		case 'fatfatbroson':
1428
-			return I18N::translateContext('father’s father’s brother’s son', 'first cousin once removed ascending');
1429
-		case 'fatfatbrochi':
1430
-			return I18N::translateContext('father’s father’s brother’s child', 'first cousin once removed ascending');
1431
-		case 'fatfatsisdau':
1432
-			return I18N::translateContext('father’s father’s sister’s daughter', 'first cousin once removed ascending');
1433
-		case 'fatfatsisson':
1434
-			return I18N::translateContext('father’s father’s sister’s son', 'first cousin once removed ascending');
1435
-		case 'fatfatsischi':
1436
-			return I18N::translateContext('father’s father’s sister’s child', 'first cousin once removed ascending');
1437
-		case 'fatmotbrodau':
1438
-			return I18N::translateContext('father’s mother’s brother’s daughter', 'first cousin once removed ascending');
1439
-		case 'fatmotbroson':
1440
-			return I18N::translateContext('father’s mother’s brother’s son', 'first cousin once removed ascending');
1441
-		case 'fatmotbrochi':
1442
-			return I18N::translateContext('father’s mother’s brother’s child', 'first cousin once removed ascending');
1443
-		case 'fatmotsisdau':
1444
-			return I18N::translateContext('father’s mother’s sister’s daughter', 'first cousin once removed ascending');
1445
-		case 'fatmotsisson':
1446
-			return I18N::translateContext('father’s mother’s sister’s son', 'first cousin once removed ascending');
1447
-		case 'fatmotsischi':
1448
-			return I18N::translateContext('father’s mother’s sister’s child', 'first cousin once removed ascending');
1449
-		case 'motfatbrodau':
1450
-			return I18N::translateContext('mother’s father’s brother’s daughter', 'first cousin once removed ascending');
1451
-		case 'motfatbroson':
1452
-			return I18N::translateContext('mother’s father’s brother’s son', 'first cousin once removed ascending');
1453
-		case 'motfatbrochi':
1454
-			return I18N::translateContext('mother’s father’s brother’s child', 'first cousin once removed ascending');
1455
-		case 'motfatsisdau':
1456
-			return I18N::translateContext('mother’s father’s sister’s daughter', 'first cousin once removed ascending');
1457
-		case 'motfatsisson':
1458
-			return I18N::translateContext('mother’s father’s sister’s son', 'first cousin once removed ascending');
1459
-		case 'motfatsischi':
1460
-			return I18N::translateContext('mother’s father’s sister’s child', 'first cousin once removed ascending');
1461
-		case 'motmotbrodau':
1462
-			return I18N::translateContext('mother’s mother’s brother’s daughter', 'first cousin once removed ascending');
1463
-		case 'motmotbroson':
1464
-			return I18N::translateContext('mother’s mother’s brother’s son', 'first cousin once removed ascending');
1465
-		case 'motmotbrochi':
1466
-			return I18N::translateContext('mother’s mother’s brother’s child', 'first cousin once removed ascending');
1467
-		case 'motmotsisdau':
1468
-			return I18N::translateContext('mother’s mother’s sister’s daughter', 'first cousin once removed ascending');
1469
-		case 'motmotsisson':
1470
-			return I18N::translateContext('mother’s mother’s sister’s son', 'first cousin once removed ascending');
1471
-		case 'motmotsischi':
1472
-			return I18N::translateContext('mother’s mother’s sister’s child', 'first cousin once removed ascending');
1370
+		    // Some “special case” level four relationships that have specific names in certain languages
1371
+		    case 'fatfatbrowif':
1372
+			    return I18N::translateContext('father’s father’s brother’s wife', 'great-aunt');
1373
+		    case 'fatfatsibspo':
1374
+			    return I18N::translateContext('father’s father’s sibling’s spouse', 'great-aunt/uncle');
1375
+		    case 'fatfatsishus':
1376
+			    return I18N::translateContext('father’s father’s sister’s husband', 'great-uncle');
1377
+		    case 'fatmotbrowif':
1378
+			    return I18N::translateContext('father’s mother’s brother’s wife', 'great-aunt');
1379
+		    case 'fatmotsibspo':
1380
+			    return I18N::translateContext('father’s mother’s sibling’s spouse', 'great-aunt/uncle');
1381
+		    case 'fatmotsishus':
1382
+			    return I18N::translateContext('father’s mother’s sister’s husband', 'great-uncle');
1383
+		    case 'fatparbrowif':
1384
+			    return I18N::translateContext('father’s parent’s brother’s wife', 'great-aunt');
1385
+		    case 'fatparsibspo':
1386
+			    return I18N::translateContext('father’s parent’s sibling’s spouse', 'great-aunt/uncle');
1387
+		    case 'fatparsishus':
1388
+			    return I18N::translateContext('father’s parent’s sister’s husband', 'great-uncle');
1389
+		    case 'motfatbrowif':
1390
+			    return I18N::translateContext('mother’s father’s brother’s wife', 'great-aunt');
1391
+		    case 'motfatsibspo':
1392
+			    return I18N::translateContext('mother’s father’s sibling’s spouse', 'great-aunt/uncle');
1393
+		    case 'motfatsishus':
1394
+			    return I18N::translateContext('mother’s father’s sister’s husband', 'great-uncle');
1395
+		    case 'motmotbrowif':
1396
+			    return I18N::translateContext('mother’s mother’s brother’s wife', 'great-aunt');
1397
+		    case 'motmotsibspo':
1398
+			    return I18N::translateContext('mother’s mother’s sibling’s spouse', 'great-aunt/uncle');
1399
+		    case 'motmotsishus':
1400
+			    return I18N::translateContext('mother’s mother’s sister’s husband', 'great-uncle');
1401
+		    case 'motparbrowif':
1402
+			    return I18N::translateContext('mother’s parent’s brother’s wife', 'great-aunt');
1403
+		    case 'motparsibspo':
1404
+			    return I18N::translateContext('mother’s parent’s sibling’s spouse', 'great-aunt/uncle');
1405
+		    case 'motparsishus':
1406
+			    return I18N::translateContext('mother’s parent’s sister’s husband', 'great-uncle');
1407
+		    case 'parfatbrowif':
1408
+			    return I18N::translateContext('parent’s father’s brother’s wife', 'great-aunt');
1409
+		    case 'parfatsibspo':
1410
+			    return I18N::translateContext('parent’s father’s sibling’s spouse', 'great-aunt/uncle');
1411
+		    case 'parfatsishus':
1412
+			    return I18N::translateContext('parent’s father’s sister’s husband', 'great-uncle');
1413
+		    case 'parmotbrowif':
1414
+			    return I18N::translateContext('parent’s mother’s brother’s wife', 'great-aunt');
1415
+		    case 'parmotsibspo':
1416
+			    return I18N::translateContext('parent’s mother’s sibling’s spouse', 'great-aunt/uncle');
1417
+		    case 'parmotsishus':
1418
+			    return I18N::translateContext('parent’s mother’s sister’s husband', 'great-uncle');
1419
+		    case 'parparbrowif':
1420
+			    return I18N::translateContext('parent’s parent’s brother’s wife', 'great-aunt');
1421
+		    case 'parparsibspo':
1422
+			    return I18N::translateContext('parent’s parent’s sibling’s spouse', 'great-aunt/uncle');
1423
+		    case 'parparsishus':
1424
+			    return I18N::translateContext('parent’s parent’s sister’s husband', 'great-uncle');
1425
+		    case 'fatfatbrodau':
1426
+			    return I18N::translateContext('father’s father’s brother’s daughter', 'first cousin once removed ascending');
1427
+		    case 'fatfatbroson':
1428
+			    return I18N::translateContext('father’s father’s brother’s son', 'first cousin once removed ascending');
1429
+		    case 'fatfatbrochi':
1430
+			    return I18N::translateContext('father’s father’s brother’s child', 'first cousin once removed ascending');
1431
+		    case 'fatfatsisdau':
1432
+			    return I18N::translateContext('father’s father’s sister’s daughter', 'first cousin once removed ascending');
1433
+		    case 'fatfatsisson':
1434
+			    return I18N::translateContext('father’s father’s sister’s son', 'first cousin once removed ascending');
1435
+		    case 'fatfatsischi':
1436
+			    return I18N::translateContext('father’s father’s sister’s child', 'first cousin once removed ascending');
1437
+		    case 'fatmotbrodau':
1438
+			    return I18N::translateContext('father’s mother’s brother’s daughter', 'first cousin once removed ascending');
1439
+		    case 'fatmotbroson':
1440
+			    return I18N::translateContext('father’s mother’s brother’s son', 'first cousin once removed ascending');
1441
+		    case 'fatmotbrochi':
1442
+			    return I18N::translateContext('father’s mother’s brother’s child', 'first cousin once removed ascending');
1443
+		    case 'fatmotsisdau':
1444
+			    return I18N::translateContext('father’s mother’s sister’s daughter', 'first cousin once removed ascending');
1445
+		    case 'fatmotsisson':
1446
+			    return I18N::translateContext('father’s mother’s sister’s son', 'first cousin once removed ascending');
1447
+		    case 'fatmotsischi':
1448
+			    return I18N::translateContext('father’s mother’s sister’s child', 'first cousin once removed ascending');
1449
+		    case 'motfatbrodau':
1450
+			    return I18N::translateContext('mother’s father’s brother’s daughter', 'first cousin once removed ascending');
1451
+		    case 'motfatbroson':
1452
+			    return I18N::translateContext('mother’s father’s brother’s son', 'first cousin once removed ascending');
1453
+		    case 'motfatbrochi':
1454
+			    return I18N::translateContext('mother’s father’s brother’s child', 'first cousin once removed ascending');
1455
+		    case 'motfatsisdau':
1456
+			    return I18N::translateContext('mother’s father’s sister’s daughter', 'first cousin once removed ascending');
1457
+		    case 'motfatsisson':
1458
+			    return I18N::translateContext('mother’s father’s sister’s son', 'first cousin once removed ascending');
1459
+		    case 'motfatsischi':
1460
+			    return I18N::translateContext('mother’s father’s sister’s child', 'first cousin once removed ascending');
1461
+		    case 'motmotbrodau':
1462
+			    return I18N::translateContext('mother’s mother’s brother’s daughter', 'first cousin once removed ascending');
1463
+		    case 'motmotbroson':
1464
+			    return I18N::translateContext('mother’s mother’s brother’s son', 'first cousin once removed ascending');
1465
+		    case 'motmotbrochi':
1466
+			    return I18N::translateContext('mother’s mother’s brother’s child', 'first cousin once removed ascending');
1467
+		    case 'motmotsisdau':
1468
+			    return I18N::translateContext('mother’s mother’s sister’s daughter', 'first cousin once removed ascending');
1469
+		    case 'motmotsisson':
1470
+			    return I18N::translateContext('mother’s mother’s sister’s son', 'first cousin once removed ascending');
1471
+		    case 'motmotsischi':
1472
+			    return I18N::translateContext('mother’s mother’s sister’s child', 'first cousin once removed ascending');
1473 1473
 		}
1474 1474
 
1475 1475
 		// Some “special case” level five relationships that have specific names in certain languages
@@ -1535,125 +1535,125 @@  discard block
 block discarded – undo
1535 1535
 			$up       = strlen($match[1]) / 3;
1536 1536
 			$bef_last = substr($path, -6, 3);
1537 1537
 			switch ($up) {
1538
-			case 3:
1539
-				switch ($sex2) {
1540
-				case 'M':
1541
-				if ($bef_last === 'fat') {
1542
-				return I18N::translateContext('great-grandfather’s brother', 'great-great-uncle');
1543
-				} elseif ($bef_last === 'mot') {
1544
-				return I18N::translateContext('great-grandmother’s brother', 'great-great-uncle');
1545
-				} else {
1546
-				return I18N::translateContext('great-grandparent’s brother', 'great-great-uncle');
1547
-				}
1548
-				case 'F':
1549
-				return I18N::translate('great-great-aunt');
1550
-				default:
1551
-				return I18N::translate('great-great-aunt/uncle');
1552
-				}
1553
-			case 4:
1554
-				switch ($sex2) {
1555
-				case 'M':
1556
-				if ($bef_last === 'fat') {
1557
-				return I18N::translateContext('great-great-grandfather’s brother', 'great-great-great-uncle');
1558
-				} elseif ($bef_last === 'mot') {
1559
-				return I18N::translateContext('great-great-grandmother’s brother', 'great-great-great-uncle');
1560
-				} else {
1561
-				return I18N::translateContext('great-great-grandparent’s brother', 'great-great-great-uncle');
1562
-				}
1563
-				case 'F':
1564
-				return I18N::translate('great-great-great-aunt');
1565
-				default:
1566
-				return I18N::translate('great-great-great-aunt/uncle');
1567
-				}
1568
-			case 5:
1569
-				switch ($sex2) {
1570
-				case 'M':
1571
-				if ($bef_last === 'fat') {
1572
-				return I18N::translateContext('great-great-great-grandfather’s brother', 'great ×4 uncle');
1573
-				} elseif ($bef_last === 'mot') {
1574
-				return I18N::translateContext('great-great-great-grandmother’s brother', 'great ×4 uncle');
1575
-				} else {
1576
-				return I18N::translateContext('great-great-great-grandparent’s brother', 'great ×4 uncle');
1577
-				}
1578
-				case 'F':
1579
-				return I18N::translate('great ×4 aunt');
1580
-				default:
1581
-				return I18N::translate('great ×4 aunt/uncle');
1582
-				}
1583
-			case 6:
1584
-				switch ($sex2) {
1585
-				case 'M':
1586
-				if ($bef_last === 'fat') {
1587
-				return I18N::translateContext('great ×4 grandfather’s brother', 'great ×5 uncle');
1588
-				} elseif ($bef_last === 'mot') {
1589
-				return I18N::translateContext('great ×4 grandmother’s brother', 'great ×5 uncle');
1590
-				} else {
1591
-				return I18N::translateContext('great ×4 grandparent’s brother', 'great ×5 uncle');
1592
-				}
1593
-				case 'F':
1594
-				return I18N::translate('great ×5 aunt');
1595
-				default:
1596
-				return I18N::translate('great ×5 aunt/uncle');
1597
-				}
1598
-			case 7:
1599
-				switch ($sex2) {
1600
-				case 'M':
1601
-				if ($bef_last === 'fat') {
1602
-				return I18N::translateContext('great ×5 grandfather’s brother', 'great ×6 uncle');
1603
-				} elseif ($bef_last === 'mot') {
1604
-				return I18N::translateContext('great ×5 grandmother’s brother', 'great ×6 uncle');
1605
-				} else {
1606
-				return I18N::translateContext('great ×5 grandparent’s brother', 'great ×6 uncle');
1607
-				}
1608
-				case 'F':
1609
-				return I18N::translate('great ×6 aunt');
1610
-				default:
1611
-				return I18N::translate('great ×6 aunt/uncle');
1612
-				}
1613
-			case 8:
1614
-				switch ($sex2) {
1615
-				case 'M':
1616
-				if ($bef_last === 'fat') {
1617
-				return I18N::translateContext('great ×6 grandfather’s brother', 'great ×7 uncle');
1618
-				} elseif ($bef_last === 'mot') {
1619
-				return I18N::translateContext('great ×6 grandmother’s brother', 'great ×7 uncle');
1620
-				} else {
1621
-				return I18N::translateContext('great ×6 grandparent’s brother', 'great ×7 uncle');
1622
-				}
1623
-				case 'F':
1624
-				return I18N::translate('great ×7 aunt');
1625
-				default:
1626
-				return I18N::translate('great ×7 aunt/uncle');
1627
-				}
1628
-			default:
1629
-				// Different languages have different rules for naming generations.
1630
-				// An English great ×12 uncle is a Danish great ×10 uncle.
1631
-				//
1632
-				// Need to find out which languages use which rules.
1633
-				switch (WT_LOCALE) {
1634
-				case 'da':
1635
-				switch ($sex2) {
1636
-				case 'M':
1637
-				return I18N::translate('great ×%s uncle', I18N::number($up - 4));
1638
-				case 'F':
1639
-				return I18N::translate('great ×%s aunt', I18N::number($up - 4));
1640
-				default:
1641
-				return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 4));
1642
-				}
1538
+			    case 3:
1539
+				    switch ($sex2) {
1540
+				        case 'M':
1541
+				        if ($bef_last === 'fat') {
1542
+				        return I18N::translateContext('great-grandfather’s brother', 'great-great-uncle');
1543
+				        } elseif ($bef_last === 'mot') {
1544
+				        return I18N::translateContext('great-grandmother’s brother', 'great-great-uncle');
1545
+				        } else {
1546
+				        return I18N::translateContext('great-grandparent’s brother', 'great-great-uncle');
1547
+				        }
1548
+				        case 'F':
1549
+				        return I18N::translate('great-great-aunt');
1550
+				        default:
1551
+				        return I18N::translate('great-great-aunt/uncle');
1552
+				    }
1553
+			    case 4:
1554
+				    switch ($sex2) {
1555
+				        case 'M':
1556
+				        if ($bef_last === 'fat') {
1557
+				        return I18N::translateContext('great-great-grandfather’s brother', 'great-great-great-uncle');
1558
+				        } elseif ($bef_last === 'mot') {
1559
+				        return I18N::translateContext('great-great-grandmother’s brother', 'great-great-great-uncle');
1560
+				        } else {
1561
+				        return I18N::translateContext('great-great-grandparent’s brother', 'great-great-great-uncle');
1562
+				        }
1563
+				        case 'F':
1564
+				        return I18N::translate('great-great-great-aunt');
1565
+				        default:
1566
+				        return I18N::translate('great-great-great-aunt/uncle');
1567
+				    }
1568
+			    case 5:
1569
+				    switch ($sex2) {
1570
+				        case 'M':
1571
+				        if ($bef_last === 'fat') {
1572
+				        return I18N::translateContext('great-great-great-grandfather’s brother', 'great ×4 uncle');
1573
+				        } elseif ($bef_last === 'mot') {
1574
+				        return I18N::translateContext('great-great-great-grandmother’s brother', 'great ×4 uncle');
1575
+				        } else {
1576
+				        return I18N::translateContext('great-great-great-grandparent’s brother', 'great ×4 uncle');
1577
+				        }
1578
+				        case 'F':
1579
+				        return I18N::translate('great ×4 aunt');
1580
+				        default:
1581
+				        return I18N::translate('great ×4 aunt/uncle');
1582
+				    }
1583
+			    case 6:
1584
+				    switch ($sex2) {
1585
+				        case 'M':
1586
+				        if ($bef_last === 'fat') {
1587
+				        return I18N::translateContext('great ×4 grandfather’s brother', 'great ×5 uncle');
1588
+				        } elseif ($bef_last === 'mot') {
1589
+				        return I18N::translateContext('great ×4 grandmother’s brother', 'great ×5 uncle');
1590
+				        } else {
1591
+				        return I18N::translateContext('great ×4 grandparent’s brother', 'great ×5 uncle');
1592
+				        }
1593
+				        case 'F':
1594
+				        return I18N::translate('great ×5 aunt');
1595
+				        default:
1596
+				        return I18N::translate('great ×5 aunt/uncle');
1597
+				    }
1598
+			    case 7:
1599
+				    switch ($sex2) {
1600
+				        case 'M':
1601
+				        if ($bef_last === 'fat') {
1602
+				        return I18N::translateContext('great ×5 grandfather’s brother', 'great ×6 uncle');
1603
+				        } elseif ($bef_last === 'mot') {
1604
+				        return I18N::translateContext('great ×5 grandmother’s brother', 'great ×6 uncle');
1605
+				        } else {
1606
+				        return I18N::translateContext('great ×5 grandparent’s brother', 'great ×6 uncle');
1607
+				        }
1608
+				        case 'F':
1609
+				        return I18N::translate('great ×6 aunt');
1610
+				        default:
1611
+				        return I18N::translate('great ×6 aunt/uncle');
1612
+				    }
1613
+			    case 8:
1614
+				    switch ($sex2) {
1615
+				        case 'M':
1616
+				        if ($bef_last === 'fat') {
1617
+				        return I18N::translateContext('great ×6 grandfather’s brother', 'great ×7 uncle');
1618
+				        } elseif ($bef_last === 'mot') {
1619
+				        return I18N::translateContext('great ×6 grandmother’s brother', 'great ×7 uncle');
1620
+				        } else {
1621
+				        return I18N::translateContext('great ×6 grandparent’s brother', 'great ×7 uncle');
1622
+				        }
1623
+				        case 'F':
1624
+				        return I18N::translate('great ×7 aunt');
1625
+				        default:
1626
+				        return I18N::translate('great ×7 aunt/uncle');
1627
+				    }
1628
+			    default:
1629
+				    // Different languages have different rules for naming generations.
1630
+				    // An English great ×12 uncle is a Danish great ×10 uncle.
1631
+				    //
1632
+				    // Need to find out which languages use which rules.
1633
+				    switch (WT_LOCALE) {
1634
+				        case 'da':
1635
+				        switch ($sex2) {
1636
+				            case 'M':
1637
+				            return I18N::translate('great ×%s uncle', I18N::number($up - 4));
1638
+				            case 'F':
1639
+				            return I18N::translate('great ×%s aunt', I18N::number($up - 4));
1640
+				            default:
1641
+				            return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 4));
1642
+				        }
1643 1643
 				case 'pl':
1644 1644
 					switch ($sex2) {
1645
-					case 'M':
1646
-					if ($bef_last === 'fat') {
1647
-					return I18N::translateContext('great ×(%s-1) grandfather’s brother', 'great ×%s uncle', I18N::number($up - 2));
1648
-					} elseif ($bef_last === 'mot') {
1649
-					return I18N::translateContext('great ×(%s-1) grandmother’s brother', 'great ×%s uncle', I18N::number($up - 2));
1650
-					} else {
1651
-					return I18N::translateContext('great ×(%s-1) grandparent’s brother', 'great ×%s uncle', I18N::number($up - 2));
1652
-					}
1653
-					case 'F':
1654
-					return I18N::translate('great ×%s aunt', I18N::number($up - 2));
1655
-					default:
1656
-					return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 2));
1645
+					    case 'M':
1646
+					    if ($bef_last === 'fat') {
1647
+					    return I18N::translateContext('great ×(%s-1) grandfather’s brother', 'great ×%s uncle', I18N::number($up - 2));
1648
+					    } elseif ($bef_last === 'mot') {
1649
+					    return I18N::translateContext('great ×(%s-1) grandmother’s brother', 'great ×%s uncle', I18N::number($up - 2));
1650
+					    } else {
1651
+					    return I18N::translateContext('great ×(%s-1) grandparent’s brother', 'great ×%s uncle', I18N::number($up - 2));
1652
+					    }
1653
+					    case 'F':
1654
+					    return I18N::translate('great ×%s aunt', I18N::number($up - 2));
1655
+					    default:
1656
+					    return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 2));
1657 1657
 					}
1658 1658
 				case 'it': // Source: Michele Locati
1659 1659
 				case 'en_AU':
@@ -1661,12 +1661,12 @@  discard block
 block discarded – undo
1661 1661
 				case 'en_US':
1662 1662
 				default:
1663 1663
 					switch ($sex2) {
1664
-					case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1665
-					return I18N::translate('great ×%s uncle', I18N::number($up - 1));
1666
-					case 'F':
1667
-					return I18N::translate('great ×%s aunt', I18N::number($up - 1));
1668
-					default:
1669
-					return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 1));
1664
+					    case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1665
+					    return I18N::translate('great ×%s uncle', I18N::number($up - 1));
1666
+					    case 'F':
1667
+					    return I18N::translate('great ×%s aunt', I18N::number($up - 1));
1668
+					    default:
1669
+					    return I18N::translate('great ×%s aunt/uncle', I18N::number($up - 1));
1670 1670
 					}
1671 1671
 					}
1672 1672
 			}
@@ -1676,155 +1676,155 @@  discard block
 block discarded – undo
1676 1676
 			$down  = strlen($match[1]) / 3 + 1; // Add one, as we count generations from the common ancestor
1677 1677
 			$first = substr($path, 0, 3);
1678 1678
 			switch ($down) {
1679
-			case 4:
1680
-				switch ($sex2) {
1681
-				case 'M':
1682
-				if ($first === 'bro' && $sex1 === 'M') {
1683
-				return I18N::translateContext('(a man’s) brother’s great-grandson', 'great-great-nephew');
1684
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1685
-				return I18N::translateContext('(a man’s) sister’s great-grandson', 'great-great-nephew');
1686
-				} else {
1687
-				return I18N::translateContext('(a woman’s) great-great-nephew', 'great-great-nephew');
1688
-				}
1689
-				case 'F':
1690
-				if ($first === 'bro' && $sex1 === 'M') {
1691
-				return I18N::translateContext('(a man’s) brother’s great-granddaughter', 'great-great-niece');
1692
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1693
-				return I18N::translateContext('(a man’s) sister’s great-granddaughter', 'great-great-niece');
1694
-				} else {
1695
-				return I18N::translateContext('(a woman’s) great-great-niece', 'great-great-niece');
1696
-				}
1697
-				default:
1698
-				if ($first === 'bro' && $sex1 === 'M') {
1699
-				return I18N::translateContext('(a man’s) brother’s great-grandchild', 'great-great-nephew/niece');
1700
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1701
-				return I18N::translateContext('(a man’s) sister’s great-grandchild', 'great-great-nephew/niece');
1702
-				} else {
1703
-				return I18N::translateContext('(a woman’s) great-great-nephew/niece', 'great-great-nephew/niece');
1704
-				}
1705
-				}
1706
-			case 5:
1707
-				switch ($sex2) {
1708
-				case 'M':
1709
-				if ($first === 'bro' && $sex1 === 'M') {
1710
-				return I18N::translateContext('(a man’s) brother’s great-great-grandson', 'great-great-great-nephew');
1711
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1712
-				return I18N::translateContext('(a man’s) sister’s great-great-grandson', 'great-great-great-nephew');
1713
-				} else {
1714
-				return I18N::translateContext('(a woman’s) great-great-great-nephew', 'great-great-great-nephew');
1715
-				}
1716
-				case 'F':
1717
-				if ($first === 'bro' && $sex1 === 'M') {
1718
-				return I18N::translateContext('(a man’s) brother’s great-great-granddaughter', 'great-great-great-niece');
1719
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1720
-				return I18N::translateContext('(a man’s) sister’s great-great-granddaughter', 'great-great-great-niece');
1721
-				} else {
1722
-				return I18N::translateContext('(a woman’s) great-great-great-niece', 'great-great-great-niece');
1723
-				}
1724
-				default:
1725
-				if ($first === 'bro' && $sex1 === 'M') {
1726
-				return I18N::translateContext('(a man’s) brother’s great-great-grandchild', 'great-great-great-nephew/niece');
1727
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1728
-				return I18N::translateContext('(a man’s) sister’s great-great-grandchild', 'great-great-great-nephew/niece');
1729
-				} else {
1730
-				return I18N::translateContext('(a woman’s) great-great-great-nephew/niece', 'great-great-great-nephew/niece');
1731
-				}
1732
-				}
1733
-			case 6:
1734
-				switch ($sex2) {
1735
-				case 'M':
1736
-				if ($first === 'bro' && $sex1 === 'M') {
1737
-				return I18N::translateContext('(a man’s) brother’s great-great-great-grandson', 'great ×4 nephew');
1738
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1739
-				return I18N::translateContext('(a man’s) sister’s great-great-great-grandson', 'great ×4 nephew');
1740
-				} else {
1741
-				return I18N::translateContext('(a woman’s) great ×4 nephew', 'great ×4 nephew');
1742
-				}
1743
-				case 'F':
1744
-				if ($first === 'bro' && $sex1 === 'M') {
1745
-				return I18N::translateContext('(a man’s) brother’s great-great-great-granddaughter', 'great ×4 niece');
1746
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1747
-				return I18N::translateContext('(a man’s) sister’s great-great-great-granddaughter', 'great ×4 niece');
1748
-				} else {
1749
-				return I18N::translateContext('(a woman’s) great ×4 niece', 'great ×4 niece');
1750
-				}
1751
-				default:
1752
-				if ($first === 'bro' && $sex1 === 'M') {
1753
-				return I18N::translateContext('(a man’s) brother’s great-great-great-grandchild', 'great ×4 nephew/niece');
1754
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1755
-				return I18N::translateContext('(a man’s) sister’s great-great-great-grandchild', 'great ×4 nephew/niece');
1756
-				} else {
1757
-				return I18N::translateContext('(a woman’s) great ×4 nephew/niece', 'great ×4 nephew/niece');
1758
-				}
1759
-				}
1760
-			case 7:
1761
-				switch ($sex2) {
1762
-				case 'M':
1763
-				if ($first === 'bro' && $sex1 === 'M') {
1764
-				return I18N::translateContext('(a man’s) brother’s great ×4 grandson', 'great ×5 nephew');
1765
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1766
-				return I18N::translateContext('(a man’s) sister’s great ×4 grandson', 'great ×5 nephew');
1767
-				} else {
1768
-				return I18N::translateContext('(a woman’s) great ×5 nephew', 'great ×5 nephew');
1769
-				}
1770
-				case 'F':
1771
-				if ($first === 'bro' && $sex1 === 'M') {
1772
-				return I18N::translateContext('(a man’s) brother’s great ×4 granddaughter', 'great ×5 niece');
1773
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1774
-				return I18N::translateContext('(a man’s) sister’s great ×4 granddaughter', 'great ×5 niece');
1775
-				} else {
1776
-				return I18N::translateContext('(a woman’s) great ×5 niece', 'great ×5 niece');
1777
-				}
1778
-				default:
1779
-				if ($first === 'bro' && $sex1 === 'M') {
1780
-				return I18N::translateContext('(a man’s) brother’s great ×4 grandchild', 'great ×5 nephew/niece');
1781
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1782
-				return I18N::translateContext('(a man’s) sister’s great ×4 grandchild', 'great ×5 nephew/niece');
1783
-				} else {
1784
-				return I18N::translateContext('(a woman’s) great ×5 nephew/niece', 'great ×5 nephew/niece');
1785
-				}
1786
-				}
1787
-			default:
1788
-				// Different languages have different rules for naming generations.
1789
-				// An English great ×12 nephew is a Polish great ×11 nephew.
1790
-				//
1791
-				// Need to find out which languages use which rules.
1792
-				switch (WT_LOCALE) {
1793
-				case 'pl': // Source: Lukasz Wilenski
1794
-				switch ($sex2) {
1795
-				case 'M':
1796
-				if ($first === 'bro' && $sex1 === 'M') {
1797
-				return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
1798
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1799
-				return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
1800
-				} else {
1801
-				return I18N::translateContext('(a woman’s) great ×%s nephew', 'great ×%s nephew', I18N::number($down - 3));
1802
-				}
1803
-				case 'F':
1804
-				if ($first === 'bro' && $sex1 === 'M') {
1805
-				return I18N::translateContext('(a man’s) brother’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
1806
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1807
-				return I18N::translateContext('(a man’s) sister’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
1808
-				} else {
1809
-				return I18N::translateContext('(a woman’s) great ×%s niece', 'great ×%s niece', I18N::number($down - 3));
1810
-				}
1811
-				default:
1812
-				if ($first === 'bro' && $sex1 === 'M') {
1813
-				return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandchild', 'great ×%s nephew/niece', I18N::number($down - 3));
1814
-				} elseif ($first === 'sis' && $sex1 === 'M') {
1815
-				return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandchild', 'great ×%s nephew/niece', I18N::number($down - 3));
1816
-				} else {
1817
-				return I18N::translateContext('(a woman’s) great ×%s nephew/niece', 'great ×%s nephew/niece', I18N::number($down - 3));
1818
-				}
1819
-				}
1679
+			    case 4:
1680
+				    switch ($sex2) {
1681
+				        case 'M':
1682
+				        if ($first === 'bro' && $sex1 === 'M') {
1683
+				        return I18N::translateContext('(a man’s) brother’s great-grandson', 'great-great-nephew');
1684
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1685
+				        return I18N::translateContext('(a man’s) sister’s great-grandson', 'great-great-nephew');
1686
+				        } else {
1687
+				        return I18N::translateContext('(a woman’s) great-great-nephew', 'great-great-nephew');
1688
+				        }
1689
+				        case 'F':
1690
+				        if ($first === 'bro' && $sex1 === 'M') {
1691
+				        return I18N::translateContext('(a man’s) brother’s great-granddaughter', 'great-great-niece');
1692
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1693
+				        return I18N::translateContext('(a man’s) sister’s great-granddaughter', 'great-great-niece');
1694
+				        } else {
1695
+				        return I18N::translateContext('(a woman’s) great-great-niece', 'great-great-niece');
1696
+				        }
1697
+				        default:
1698
+				        if ($first === 'bro' && $sex1 === 'M') {
1699
+				        return I18N::translateContext('(a man’s) brother’s great-grandchild', 'great-great-nephew/niece');
1700
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1701
+				        return I18N::translateContext('(a man’s) sister’s great-grandchild', 'great-great-nephew/niece');
1702
+				        } else {
1703
+				        return I18N::translateContext('(a woman’s) great-great-nephew/niece', 'great-great-nephew/niece');
1704
+				        }
1705
+				    }
1706
+			    case 5:
1707
+				    switch ($sex2) {
1708
+				        case 'M':
1709
+				        if ($first === 'bro' && $sex1 === 'M') {
1710
+				        return I18N::translateContext('(a man’s) brother’s great-great-grandson', 'great-great-great-nephew');
1711
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1712
+				        return I18N::translateContext('(a man’s) sister’s great-great-grandson', 'great-great-great-nephew');
1713
+				        } else {
1714
+				        return I18N::translateContext('(a woman’s) great-great-great-nephew', 'great-great-great-nephew');
1715
+				        }
1716
+				        case 'F':
1717
+				        if ($first === 'bro' && $sex1 === 'M') {
1718
+				        return I18N::translateContext('(a man’s) brother’s great-great-granddaughter', 'great-great-great-niece');
1719
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1720
+				        return I18N::translateContext('(a man’s) sister’s great-great-granddaughter', 'great-great-great-niece');
1721
+				        } else {
1722
+				        return I18N::translateContext('(a woman’s) great-great-great-niece', 'great-great-great-niece');
1723
+				        }
1724
+				        default:
1725
+				        if ($first === 'bro' && $sex1 === 'M') {
1726
+				        return I18N::translateContext('(a man’s) brother’s great-great-grandchild', 'great-great-great-nephew/niece');
1727
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1728
+				        return I18N::translateContext('(a man’s) sister’s great-great-grandchild', 'great-great-great-nephew/niece');
1729
+				        } else {
1730
+				        return I18N::translateContext('(a woman’s) great-great-great-nephew/niece', 'great-great-great-nephew/niece');
1731
+				        }
1732
+				    }
1733
+			    case 6:
1734
+				    switch ($sex2) {
1735
+				        case 'M':
1736
+				        if ($first === 'bro' && $sex1 === 'M') {
1737
+				        return I18N::translateContext('(a man’s) brother’s great-great-great-grandson', 'great ×4 nephew');
1738
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1739
+				        return I18N::translateContext('(a man’s) sister’s great-great-great-grandson', 'great ×4 nephew');
1740
+				        } else {
1741
+				        return I18N::translateContext('(a woman’s) great ×4 nephew', 'great ×4 nephew');
1742
+				        }
1743
+				        case 'F':
1744
+				        if ($first === 'bro' && $sex1 === 'M') {
1745
+				        return I18N::translateContext('(a man’s) brother’s great-great-great-granddaughter', 'great ×4 niece');
1746
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1747
+				        return I18N::translateContext('(a man’s) sister’s great-great-great-granddaughter', 'great ×4 niece');
1748
+				        } else {
1749
+				        return I18N::translateContext('(a woman’s) great ×4 niece', 'great ×4 niece');
1750
+				        }
1751
+				        default:
1752
+				        if ($first === 'bro' && $sex1 === 'M') {
1753
+				        return I18N::translateContext('(a man’s) brother’s great-great-great-grandchild', 'great ×4 nephew/niece');
1754
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1755
+				        return I18N::translateContext('(a man’s) sister’s great-great-great-grandchild', 'great ×4 nephew/niece');
1756
+				        } else {
1757
+				        return I18N::translateContext('(a woman’s) great ×4 nephew/niece', 'great ×4 nephew/niece');
1758
+				        }
1759
+				    }
1760
+			    case 7:
1761
+				    switch ($sex2) {
1762
+				        case 'M':
1763
+				        if ($first === 'bro' && $sex1 === 'M') {
1764
+				        return I18N::translateContext('(a man’s) brother’s great ×4 grandson', 'great ×5 nephew');
1765
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1766
+				        return I18N::translateContext('(a man’s) sister’s great ×4 grandson', 'great ×5 nephew');
1767
+				        } else {
1768
+				        return I18N::translateContext('(a woman’s) great ×5 nephew', 'great ×5 nephew');
1769
+				        }
1770
+				        case 'F':
1771
+				        if ($first === 'bro' && $sex1 === 'M') {
1772
+				        return I18N::translateContext('(a man’s) brother’s great ×4 granddaughter', 'great ×5 niece');
1773
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1774
+				        return I18N::translateContext('(a man’s) sister’s great ×4 granddaughter', 'great ×5 niece');
1775
+				        } else {
1776
+				        return I18N::translateContext('(a woman’s) great ×5 niece', 'great ×5 niece');
1777
+				        }
1778
+				        default:
1779
+				        if ($first === 'bro' && $sex1 === 'M') {
1780
+				        return I18N::translateContext('(a man’s) brother’s great ×4 grandchild', 'great ×5 nephew/niece');
1781
+				        } elseif ($first === 'sis' && $sex1 === 'M') {
1782
+				        return I18N::translateContext('(a man’s) sister’s great ×4 grandchild', 'great ×5 nephew/niece');
1783
+				        } else {
1784
+				        return I18N::translateContext('(a woman’s) great ×5 nephew/niece', 'great ×5 nephew/niece');
1785
+				        }
1786
+				    }
1787
+			    default:
1788
+				    // Different languages have different rules for naming generations.
1789
+				    // An English great ×12 nephew is a Polish great ×11 nephew.
1790
+				    //
1791
+				    // Need to find out which languages use which rules.
1792
+				    switch (WT_LOCALE) {
1793
+				        case 'pl': // Source: Lukasz Wilenski
1794
+				        switch ($sex2) {
1795
+				            case 'M':
1796
+				            if ($first === 'bro' && $sex1 === 'M') {
1797
+				            return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
1798
+				            } elseif ($first === 'sis' && $sex1 === 'M') {
1799
+				            return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandson', 'great ×%s nephew', I18N::number($down - 3));
1800
+				            } else {
1801
+				            return I18N::translateContext('(a woman’s) great ×%s nephew', 'great ×%s nephew', I18N::number($down - 3));
1802
+				            }
1803
+				            case 'F':
1804
+				            if ($first === 'bro' && $sex1 === 'M') {
1805
+				            return I18N::translateContext('(a man’s) brother’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
1806
+				            } elseif ($first === 'sis' && $sex1 === 'M') {
1807
+				            return I18N::translateContext('(a man’s) sister’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
1808
+				            } else {
1809
+				            return I18N::translateContext('(a woman’s) great ×%s niece', 'great ×%s niece', I18N::number($down - 3));
1810
+				            }
1811
+				            default:
1812
+				            if ($first === 'bro' && $sex1 === 'M') {
1813
+				            return I18N::translateContext('(a man’s) brother’s great ×(%s-1) grandchild', 'great ×%s nephew/niece', I18N::number($down - 3));
1814
+				            } elseif ($first === 'sis' && $sex1 === 'M') {
1815
+				            return I18N::translateContext('(a man’s) sister’s great ×(%s-1) grandchild', 'great ×%s nephew/niece', I18N::number($down - 3));
1816
+				            } else {
1817
+				            return I18N::translateContext('(a woman’s) great ×%s nephew/niece', 'great ×%s nephew/niece', I18N::number($down - 3));
1818
+				            }
1819
+				        }
1820 1820
 				case 'he': // Source: Meliza Amity
1821 1821
 					switch ($sex2) {
1822
-					case 'M':
1823
-					return I18N::translate('great ×%s nephew', I18N::number($down - 1));
1824
-					case 'F':
1825
-					return I18N::translate('great ×%s niece', I18N::number($down - 1));
1826
-					default:
1827
-					return I18N::translate('great ×%s nephew/niece', I18N::number($down - 1));
1822
+					    case 'M':
1823
+					    return I18N::translate('great ×%s nephew', I18N::number($down - 1));
1824
+					    case 'F':
1825
+					    return I18N::translate('great ×%s niece', I18N::number($down - 1));
1826
+					    default:
1827
+					    return I18N::translate('great ×%s nephew/niece', I18N::number($down - 1));
1828 1828
 					}
1829 1829
 				case 'it': // Source: Michele Locati.
1830 1830
 				case 'en_AU':
@@ -1832,12 +1832,12 @@  discard block
 block discarded – undo
1832 1832
 				case 'en_US':
1833 1833
 				default:
1834 1834
 					switch ($sex2) {
1835
-					case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1836
-					return I18N::translate('great ×%s nephew', I18N::number($down - 2));
1837
-					case 'F':
1838
-					return I18N::translate('great ×%s niece', I18N::number($down - 2));
1839
-					default:
1840
-					return I18N::translate('great ×%s nephew/niece', I18N::number($down - 2));
1835
+					    case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1836
+					    return I18N::translate('great ×%s nephew', I18N::number($down - 2));
1837
+					    case 'F':
1838
+					    return I18N::translate('great ×%s niece', I18N::number($down - 2));
1839
+					    default:
1840
+					    return I18N::translate('great ×%s nephew/niece', I18N::number($down - 2));
1841 1841
 					}
1842 1842
 					}
1843 1843
 			}
@@ -1846,116 +1846,116 @@  discard block
 block discarded – undo
1846 1846
 			// direct ancestors
1847 1847
 			$up = strlen($match[1]) / 3;
1848 1848
 			switch ($up) {
1849
-			case 4:
1850
-				switch ($sex2) {
1851
-				case 'M':
1852
-				return I18N::translate('great-great-grandfather');
1853
-				case 'F':
1854
-				return I18N::translate('great-great-grandmother');
1855
-				default:
1856
-				return I18N::translate('great-great-grandparent');
1857
-				}
1858
-			case 5:
1859
-				switch ($sex2) {
1860
-				case 'M':
1861
-				return I18N::translate('great-great-great-grandfather');
1862
-				case 'F':
1863
-				return I18N::translate('great-great-great-grandmother');
1864
-				default:
1865
-				return I18N::translate('great-great-great-grandparent');
1866
-				}
1867
-			case 6:
1868
-				switch ($sex2) {
1869
-				case 'M':
1870
-				return I18N::translate('great ×4 grandfather');
1871
-				case 'F':
1872
-				return I18N::translate('great ×4 grandmother');
1873
-				default:
1874
-				return I18N::translate('great ×4 grandparent');
1875
-				}
1876
-			case 7:
1877
-				switch ($sex2) {
1878
-				case 'M':
1879
-				return I18N::translate('great ×5 grandfather');
1880
-				case 'F':
1881
-				return I18N::translate('great ×5 grandmother');
1882
-				default:
1883
-				return I18N::translate('great ×5 grandparent');
1884
-				}
1885
-			case 8:
1886
-				switch ($sex2) {
1887
-				case 'M':
1888
-				return I18N::translate('great ×6 grandfather');
1889
-				case 'F':
1890
-				return I18N::translate('great ×6 grandmother');
1891
-				default:
1892
-				return I18N::translate('great ×6 grandparent');
1893
-				}
1894
-			case 9:
1895
-				switch ($sex2) {
1896
-				case 'M':
1897
-				return I18N::translate('great ×7 grandfather');
1898
-				case 'F':
1899
-				return I18N::translate('great ×7 grandmother');
1900
-				default:
1901
-				return I18N::translate('great ×7 grandparent');
1902
-				}
1903
-			default:
1904
-				// Different languages have different rules for naming generations.
1905
-				// An English great ×12 grandfather is a Danish great ×11 grandfather.
1906
-				//
1907
-				// Need to find out which languages use which rules.
1908
-				switch (WT_LOCALE) {
1909
-				case 'da': // Source: Patrick Sorensen
1910
-				switch ($sex2) {
1911
-				case 'M':
1912
-				return I18N::translate('great ×%s grandfather', I18N::number($up - 3));
1913
-				case 'F':
1914
-				return I18N::translate('great ×%s grandmother', I18N::number($up - 3));
1915
-				default:
1916
-				return I18N::translate('great ×%s grandparent', I18N::number($up - 3));
1917
-				}
1849
+			    case 4:
1850
+				    switch ($sex2) {
1851
+				        case 'M':
1852
+				        return I18N::translate('great-great-grandfather');
1853
+				        case 'F':
1854
+				        return I18N::translate('great-great-grandmother');
1855
+				        default:
1856
+				        return I18N::translate('great-great-grandparent');
1857
+				    }
1858
+			    case 5:
1859
+				    switch ($sex2) {
1860
+				        case 'M':
1861
+				        return I18N::translate('great-great-great-grandfather');
1862
+				        case 'F':
1863
+				        return I18N::translate('great-great-great-grandmother');
1864
+				        default:
1865
+				        return I18N::translate('great-great-great-grandparent');
1866
+				    }
1867
+			    case 6:
1868
+				    switch ($sex2) {
1869
+				        case 'M':
1870
+				        return I18N::translate('great ×4 grandfather');
1871
+				        case 'F':
1872
+				        return I18N::translate('great ×4 grandmother');
1873
+				        default:
1874
+				        return I18N::translate('great ×4 grandparent');
1875
+				    }
1876
+			    case 7:
1877
+				    switch ($sex2) {
1878
+				        case 'M':
1879
+				        return I18N::translate('great ×5 grandfather');
1880
+				        case 'F':
1881
+				        return I18N::translate('great ×5 grandmother');
1882
+				        default:
1883
+				        return I18N::translate('great ×5 grandparent');
1884
+				    }
1885
+			    case 8:
1886
+				    switch ($sex2) {
1887
+				        case 'M':
1888
+				        return I18N::translate('great ×6 grandfather');
1889
+				        case 'F':
1890
+				        return I18N::translate('great ×6 grandmother');
1891
+				        default:
1892
+				        return I18N::translate('great ×6 grandparent');
1893
+				    }
1894
+			    case 9:
1895
+				    switch ($sex2) {
1896
+				        case 'M':
1897
+				        return I18N::translate('great ×7 grandfather');
1898
+				        case 'F':
1899
+				        return I18N::translate('great ×7 grandmother');
1900
+				        default:
1901
+				        return I18N::translate('great ×7 grandparent');
1902
+				    }
1903
+			    default:
1904
+				    // Different languages have different rules for naming generations.
1905
+				    // An English great ×12 grandfather is a Danish great ×11 grandfather.
1906
+				    //
1907
+				    // Need to find out which languages use which rules.
1908
+				    switch (WT_LOCALE) {
1909
+				        case 'da': // Source: Patrick Sorensen
1910
+				        switch ($sex2) {
1911
+				            case 'M':
1912
+				            return I18N::translate('great ×%s grandfather', I18N::number($up - 3));
1913
+				            case 'F':
1914
+				            return I18N::translate('great ×%s grandmother', I18N::number($up - 3));
1915
+				            default:
1916
+				            return I18N::translate('great ×%s grandparent', I18N::number($up - 3));
1917
+				        }
1918 1918
 				case 'it': // Source: Michele Locati
1919 1919
 				case 'es': // Source: Wes Groleau
1920 1920
 					switch ($sex2) {
1921
-					case 'M':
1922
-					return I18N::translate('great ×%s grandfather', I18N::number($up));
1923
-					case 'F':
1924
-					return I18N::translate('great ×%s grandmother', I18N::number($up));
1925
-					default:
1926
-					return I18N::translate('great ×%s grandparent', I18N::number($up));
1921
+					    case 'M':
1922
+					    return I18N::translate('great ×%s grandfather', I18N::number($up));
1923
+					    case 'F':
1924
+					    return I18N::translate('great ×%s grandmother', I18N::number($up));
1925
+					    default:
1926
+					    return I18N::translate('great ×%s grandparent', I18N::number($up));
1927 1927
 					}
1928 1928
 				case 'fr': // Source: Jacqueline Tetreault
1929 1929
 				case 'fr_CA':
1930 1930
 					switch ($sex2) {
1931
-					case 'M':
1932
-					return I18N::translate('great ×%s grandfather', I18N::number($up - 1));
1933
-					case 'F':
1934
-					return I18N::translate('great ×%s grandmother', I18N::number($up - 1));
1935
-					default:
1936
-					return I18N::translate('great ×%s grandparent', I18N::number($up - 1));
1931
+					    case 'M':
1932
+					    return I18N::translate('great ×%s grandfather', I18N::number($up - 1));
1933
+					    case 'F':
1934
+					    return I18N::translate('great ×%s grandmother', I18N::number($up - 1));
1935
+					    default:
1936
+					    return I18N::translate('great ×%s grandparent', I18N::number($up - 1));
1937 1937
 					}
1938 1938
 				case 'nn': // Source: Hogne Røed Nilsen (https://bugs.launchpad.net/webtrees/+bug/1168553)
1939 1939
 				case 'nb':
1940 1940
 					switch ($sex2) {
1941
-					case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1942
-					return I18N::translate('great ×%s grandfather', I18N::number($up - 3));
1943
-					case 'F':
1944
-					return I18N::translate('great ×%s grandmother', I18N::number($up - 3));
1945
-					default:
1946
-					return I18N::translate('great ×%s grandparent', I18N::number($up - 3));
1941
+					    case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1942
+					    return I18N::translate('great ×%s grandfather', I18N::number($up - 3));
1943
+					    case 'F':
1944
+					    return I18N::translate('great ×%s grandmother', I18N::number($up - 3));
1945
+					    default:
1946
+					    return I18N::translate('great ×%s grandparent', I18N::number($up - 3));
1947 1947
 					}
1948 1948
 				case 'en_AU':
1949 1949
 				case 'en_GB':
1950 1950
 				case 'en_US':
1951 1951
 				default:
1952 1952
 					switch ($sex2) {
1953
-					case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1954
-					return I18N::translate('great ×%s grandfather', I18N::number($up - 2));
1955
-					case 'F':
1956
-					return I18N::translate('great ×%s grandmother', I18N::number($up - 2));
1957
-					default:
1958
-					return I18N::translate('great ×%s grandparent', I18N::number($up - 2));
1953
+					    case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
1954
+					    return I18N::translate('great ×%s grandfather', I18N::number($up - 2));
1955
+					    case 'F':
1956
+					    return I18N::translate('great ×%s grandmother', I18N::number($up - 2));
1957
+					    default:
1958
+					    return I18N::translate('great ×%s grandparent', I18N::number($up - 2));
1959 1959
 					}
1960 1960
 					}
1961 1961
 			}
@@ -1964,83 +1964,83 @@  discard block
 block discarded – undo
1964 1964
 			// direct descendants
1965 1965
 			$up = strlen($match[1]) / 3;
1966 1966
 			switch ($up) {
1967
-			case 4:
1968
-				switch ($sex2) {
1969
-				case 'M':
1970
-				return I18N::translate('great-great-grandson');
1971
-				case 'F':
1972
-				return I18N::translate('great-great-granddaughter');
1973
-				default:
1974
-				return I18N::translate('great-great-grandchild');
1975
-				}
1967
+			    case 4:
1968
+				    switch ($sex2) {
1969
+				        case 'M':
1970
+				        return I18N::translate('great-great-grandson');
1971
+				        case 'F':
1972
+				        return I18N::translate('great-great-granddaughter');
1973
+				        default:
1974
+				        return I18N::translate('great-great-grandchild');
1975
+				    }
1976 1976
 
1977
-			case 5:
1978
-				switch ($sex2) {
1979
-				case 'M':
1980
-				return I18N::translate('great-great-great-grandson');
1981
-				case 'F':
1982
-				return I18N::translate('great-great-great-granddaughter');
1983
-				default:
1984
-				return I18N::translate('great-great-great-grandchild');
1985
-				}
1977
+			    case 5:
1978
+				    switch ($sex2) {
1979
+				        case 'M':
1980
+				        return I18N::translate('great-great-great-grandson');
1981
+				        case 'F':
1982
+				        return I18N::translate('great-great-great-granddaughter');
1983
+				        default:
1984
+				        return I18N::translate('great-great-great-grandchild');
1985
+				    }
1986 1986
 
1987
-			case 6:
1988
-				switch ($sex2) {
1989
-				case 'M':
1990
-				return I18N::translate('great ×4 grandson');
1991
-				case 'F':
1992
-				return I18N::translate('great ×4 granddaughter');
1993
-				default:
1994
-				return I18N::translate('great ×4 grandchild');
1995
-				}
1987
+			    case 6:
1988
+				    switch ($sex2) {
1989
+				        case 'M':
1990
+				        return I18N::translate('great ×4 grandson');
1991
+				        case 'F':
1992
+				        return I18N::translate('great ×4 granddaughter');
1993
+				        default:
1994
+				        return I18N::translate('great ×4 grandchild');
1995
+				    }
1996 1996
 
1997
-			case 7:
1998
-				switch ($sex2) {
1999
-				case 'M':
2000
-				return I18N::translate('great ×5 grandson');
2001
-				case 'F':
2002
-				return I18N::translate('great ×5 granddaughter');
2003
-				default:
2004
-				return I18N::translate('great ×5 grandchild');
2005
-				}
1997
+			    case 7:
1998
+				    switch ($sex2) {
1999
+				        case 'M':
2000
+				        return I18N::translate('great ×5 grandson');
2001
+				        case 'F':
2002
+				        return I18N::translate('great ×5 granddaughter');
2003
+				        default:
2004
+				        return I18N::translate('great ×5 grandchild');
2005
+				    }
2006 2006
 
2007
-			case 8:
2008
-				switch ($sex2) {
2009
-				case 'M':
2010
-				return I18N::translate('great ×6 grandson');
2011
-				case 'F':
2012
-				return I18N::translate('great ×6 granddaughter');
2013
-				default:
2014
-				return I18N::translate('great ×6 grandchild');
2015
-				}
2007
+			    case 8:
2008
+				    switch ($sex2) {
2009
+				        case 'M':
2010
+				        return I18N::translate('great ×6 grandson');
2011
+				        case 'F':
2012
+				        return I18N::translate('great ×6 granddaughter');
2013
+				        default:
2014
+				        return I18N::translate('great ×6 grandchild');
2015
+				    }
2016 2016
 
2017
-			case 9:
2018
-				switch ($sex2) {
2019
-				case 'M':
2020
-				return I18N::translate('great ×7 grandson');
2021
-				case 'F':
2022
-				return I18N::translate('great ×7 granddaughter');
2023
-				default:
2024
-				return I18N::translate('great ×7 grandchild');
2025
-				}
2017
+			    case 9:
2018
+				    switch ($sex2) {
2019
+				        case 'M':
2020
+				        return I18N::translate('great ×7 grandson');
2021
+				        case 'F':
2022
+				        return I18N::translate('great ×7 granddaughter');
2023
+				        default:
2024
+				        return I18N::translate('great ×7 grandchild');
2025
+				    }
2026 2026
 
2027
-			default:
2028
-				// Different languages have different rules for naming generations.
2029
-				// An English great ×12 grandson is a Danish great ×11 grandson.
2030
-				//
2031
-				// Need to find out which languages use which rules.
2032
-				switch (WT_LOCALE) {
2033
-				case 'nn': // Source: Hogne Røed Nilsen
2034
-				case 'nb':
2035
-				case 'da': // Source: Patrick Sorensen
2036
-				switch ($sex2) {
2037
-				case 'M':
2038
-				return I18N::translate('great ×%s grandson', I18N::number($up - 3));
2039
-				case 'F':
2040
-				return I18N::translate('great ×%s granddaughter', I18N::number($up - 3));
2041
-				default:
2042
-				return I18N::translate('great ×%s grandchild', I18N::number($up - 3));
2043
-				}
2027
+			    default:
2028
+				    // Different languages have different rules for naming generations.
2029
+				    // An English great ×12 grandson is a Danish great ×11 grandson.
2030
+				    //
2031
+				    // Need to find out which languages use which rules.
2032
+				    switch (WT_LOCALE) {
2033
+				        case 'nn': // Source: Hogne Røed Nilsen
2034
+				        case 'nb':
2035
+				        case 'da': // Source: Patrick Sorensen
2036
+				        switch ($sex2) {
2037
+				            case 'M':
2038
+				            return I18N::translate('great ×%s grandson', I18N::number($up - 3));
2039
+				            case 'F':
2040
+				            return I18N::translate('great ×%s granddaughter', I18N::number($up - 3));
2041
+				            default:
2042
+				            return I18N::translate('great ×%s grandchild', I18N::number($up - 3));
2043
+				        }
2044 2044
 				case 'it': // Source: Michele Locati
2045 2045
 				case 'es': // Source: Wes Groleau (adding doesn’t change behavior, but needs to be better researched)
2046 2046
 				case 'en_AU':
@@ -2049,12 +2049,12 @@  discard block
 block discarded – undo
2049 2049
 				default:
2050 2050
 					switch ($sex2) {
2051 2051
 
2052
-					case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
2053
-					return I18N::translate('great ×%s grandson', I18N::number($up - 2));
2054
-					case 'F':
2055
-					return I18N::translate('great ×%s granddaughter', I18N::number($up - 2));
2056
-					default:
2057
-					return I18N::translate('great ×%s grandchild', I18N::number($up - 2));
2052
+					    case 'M': // I18N: if you need a different number for %s, contact the developers, as a code-change is required
2053
+					    return I18N::translate('great ×%s grandson', I18N::number($up - 2));
2054
+					    case 'F':
2055
+					    return I18N::translate('great ×%s granddaughter', I18N::number($up - 2));
2056
+					    default:
2057
+					    return I18N::translate('great ×%s grandchild', I18N::number($up - 2));
2058 2058
 					}
2059 2059
 					}
2060 2060
 			}
@@ -2073,68 +2073,68 @@  discard block
 block discarded – undo
2073 2073
 			//
2074 2074
 			// Need to find out which languages use which rules.
2075 2075
 			switch (WT_LOCALE) {
2076
-			case 'pl': // Source: Lukasz Wilenski
2077
-				return self::cousinName($up + $down + 2, $sex2);
2078
-			case 'it':
2079
-				// Source: Michele Locati. See italian_cousins_names.zip
2080
-				// https://webtrees.net/forums/8-translation/1200-great-xn-grandparent?limit=6&start=6
2081
-				return self::cousinName($up + $down - 3, $sex2);
2082
-			case 'es':
2083
-				// Source: Wes Groleau. See http://UniGen.us/Parentesco.html & http://UniGen.us/Parentesco-D.html
2084
-				if ($down == $up) {
2085
-					return self::cousinName($cousin, $sex2);
2086
-				} elseif ($down < $up) {
2087
-					return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sib' . $descent, null, null));
2088
-				} else {
2089
-					switch ($sex2) {
2090
-					case 'M':
2091
-					return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('bro' . $descent, null, null));
2092
-					case 'F':
2093
-					return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sis' . $descent, null, null));
2094
-					default:
2095
-					return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sib' . $descent, null, null));
2076
+			    case 'pl': // Source: Lukasz Wilenski
2077
+				    return self::cousinName($up + $down + 2, $sex2);
2078
+			    case 'it':
2079
+				    // Source: Michele Locati. See italian_cousins_names.zip
2080
+				    // https://webtrees.net/forums/8-translation/1200-great-xn-grandparent?limit=6&start=6
2081
+				    return self::cousinName($up + $down - 3, $sex2);
2082
+			    case 'es':
2083
+				    // Source: Wes Groleau. See http://UniGen.us/Parentesco.html & http://UniGen.us/Parentesco-D.html
2084
+				    if ($down == $up) {
2085
+					    return self::cousinName($cousin, $sex2);
2086
+				    } elseif ($down < $up) {
2087
+					    return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sib' . $descent, null, null));
2088
+				    } else {
2089
+					    switch ($sex2) {
2090
+					        case 'M':
2091
+					        return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('bro' . $descent, null, null));
2092
+					        case 'F':
2093
+					        return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sis' . $descent, null, null));
2094
+					        default:
2095
+					        return self::cousinName2($cousin + 1, $sex2, self::getRelationshipNameFromPath('sib' . $descent, null, null));
2096
+					    }
2096 2097
 					}
2097
-					}
2098
-			case 'en_AU': // See: http://en.wikipedia.org/wiki/File:CousinTree.svg
2099
-			case 'en_GB':
2100
-			case 'en_US':
2101
-			default:
2102
-				switch ($removed) {
2103
-				case 0:
2104
-				return self::cousinName($cousin, $sex2);
2105
-				case 1:
2106
-				if ($up > $down) {
2107
-				/* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
2108
-				return I18N::translate('%s once removed ascending', self::cousinName($cousin, $sex2));
2109
-				} else {
2110
-				/* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
2111
-				return I18N::translate('%s once removed descending', self::cousinName($cousin, $sex2));
2112
-				}
2113
-				case 2:
2114
-				if ($up > $down) {
2115
-				/* I18N: %s=“fifth cousin”, etc. */
2116
-				return I18N::translate('%s twice removed ascending', self::cousinName($cousin, $sex2));
2117
-				} else {
2118
-				/* I18N: %s=“fifth cousin”, etc. */
2119
-				return I18N::translate('%s twice removed descending', self::cousinName($cousin, $sex2));
2120
-				}
2121
-				case 3:
2122
-				if ($up > $down) {
2123
-				/* I18N: %s=“fifth cousin”, etc. */
2124
-				return I18N::translate('%s three times removed ascending', self::cousinName($cousin, $sex2));
2125
-				} else {
2126
-				/* I18N: %s=“fifth cousin”, etc. */
2127
-				return I18N::translate('%s three times removed descending', self::cousinName($cousin, $sex2));
2128
-				}
2129
-				default:
2130
-				if ($up > $down) {
2131
-				/* I18N: %1$s=“fifth cousin”, etc., %2$s>=4 */
2132
-				return I18N::translate('%1$s %2$s times removed ascending', self::cousinName($cousin, $sex2), I18N::number($removed));
2133
-				} else {
2134
-				/* I18N: %1$s=“fifth cousin”, etc., %2$s>=4 */
2135
-				return I18N::translate('%1$s %2$s times removed descending', self::cousinName($cousin, $sex2), I18N::number($removed));
2136
-				}
2137
-				}
2098
+			    case 'en_AU': // See: http://en.wikipedia.org/wiki/File:CousinTree.svg
2099
+			    case 'en_GB':
2100
+			    case 'en_US':
2101
+			    default:
2102
+				    switch ($removed) {
2103
+				        case 0:
2104
+				        return self::cousinName($cousin, $sex2);
2105
+				        case 1:
2106
+				        if ($up > $down) {
2107
+				        /* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
2108
+				        return I18N::translate('%s once removed ascending', self::cousinName($cousin, $sex2));
2109
+				        } else {
2110
+				        /* I18N: %s=“fifth cousin”, etc. http://www.ancestry.com/learn/library/article.aspx?article=2856 */
2111
+				        return I18N::translate('%s once removed descending', self::cousinName($cousin, $sex2));
2112
+				        }
2113
+				        case 2:
2114
+				        if ($up > $down) {
2115
+				        /* I18N: %s=“fifth cousin”, etc. */
2116
+				        return I18N::translate('%s twice removed ascending', self::cousinName($cousin, $sex2));
2117
+				        } else {
2118
+				        /* I18N: %s=“fifth cousin”, etc. */
2119
+				        return I18N::translate('%s twice removed descending', self::cousinName($cousin, $sex2));
2120
+				        }
2121
+				        case 3:
2122
+				        if ($up > $down) {
2123
+				        /* I18N: %s=“fifth cousin”, etc. */
2124
+				        return I18N::translate('%s three times removed ascending', self::cousinName($cousin, $sex2));
2125
+				        } else {
2126
+				        /* I18N: %s=“fifth cousin”, etc. */
2127
+				        return I18N::translate('%s three times removed descending', self::cousinName($cousin, $sex2));
2128
+				        }
2129
+				        default:
2130
+				        if ($up > $down) {
2131
+				        /* I18N: %1$s=“fifth cousin”, etc., %2$s>=4 */
2132
+				        return I18N::translate('%1$s %2$s times removed ascending', self::cousinName($cousin, $sex2), I18N::number($removed));
2133
+				        } else {
2134
+				        /* I18N: %1$s=“fifth cousin”, etc., %2$s>=4 */
2135
+				        return I18N::translate('%1$s %2$s times removed descending', self::cousinName($cousin, $sex2), I18N::number($removed));
2136
+				        }
2137
+				    }
2138 2138
 			}
2139 2139
 		}
2140 2140
 
Please login to merge, or discard this patch.
app/Functions/FunctionsPrintLists.php 1 patch
Switch Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -1572,37 +1572,37 @@  discard block
 block discarded – undo
1572 1572
 
1573 1573
 		}
1574 1574
 		switch ($style) {
1575
-		case 1:
1576
-			return '<ul><li>' . implode('</li><li>', $html) . '</li></ul>';
1577
-		case 2:
1578
-			return implode(I18N::$list_separator, $html);
1579
-		case 3:
1580
-			$i     = 0;
1581
-			$count = count($html);
1582
-			if ($count > 36) {
1583
-				$col = 4;
1584
-			} elseif ($count > 18) {
1585
-				$col = 3;
1586
-			} elseif ($count > 6) {
1587
-				$col = 2;
1588
-			} else {
1589
-				$col = 1;
1590
-			}
1591
-			$newcol = ceil($count / $col);
1592
-			$html2  = '<table class="list_table"><tr>';
1593
-			$html2 .= '<td class="list_value" style="padding: 14px;">';
1594
-
1595
-			foreach ($html as $surns) {
1596
-				$html2 .= $surns . '<br>';
1597
-				$i++;
1598
-				if ($i == $newcol && $i < $count) {
1599
-					$html2 .= '</td><td class="list_value" style="padding: 14px;">';
1600
-					$newcol = $i + ceil($count / $col);
1601
-				}
1602
-			}
1603
-			$html2 .= '</td></tr></table>';
1604
-
1605
-			return $html2;
1575
+		    case 1:
1576
+			    return '<ul><li>' . implode('</li><li>', $html) . '</li></ul>';
1577
+		    case 2:
1578
+			    return implode(I18N::$list_separator, $html);
1579
+		    case 3:
1580
+			    $i     = 0;
1581
+			    $count = count($html);
1582
+			    if ($count > 36) {
1583
+				    $col = 4;
1584
+			    } elseif ($count > 18) {
1585
+				    $col = 3;
1586
+			    } elseif ($count > 6) {
1587
+				    $col = 2;
1588
+			    } else {
1589
+				    $col = 1;
1590
+			    }
1591
+			    $newcol = ceil($count / $col);
1592
+			    $html2  = '<table class="list_table"><tr>';
1593
+			    $html2 .= '<td class="list_value" style="padding: 14px;">';
1594
+
1595
+			    foreach ($html as $surns) {
1596
+				    $html2 .= $surns . '<br>';
1597
+				    $i++;
1598
+				    if ($i == $newcol && $i < $count) {
1599
+					    $html2 .= '</td><td class="list_value" style="padding: 14px;">';
1600
+					    $newcol = $i + ceil($count / $col);
1601
+				    }
1602
+			    }
1603
+			    $html2 .= '</td></tr></table>';
1604
+
1605
+			    return $html2;
1606 1606
 		}
1607 1607
 	}
1608 1608
 	/**
@@ -1783,14 +1783,14 @@  discard block
 block discarded – undo
1783 1783
 
1784 1784
 		// Now we've filtered the list, we can sort by event, if required
1785 1785
 		switch ($sort_by) {
1786
-		case 'anniv':
1787
-			// Data is already sorted by anniversary date
1788
-			break;
1789
-		case 'alpha':
1790
-			uasort($filtered_events, function (Fact $x, Fact $y) {
1791
-				return GedcomRecord::compare($x->getParent(), $y->getParent());
1792
-			});
1793
-			break;
1786
+		    case 'anniv':
1787
+			    // Data is already sorted by anniversary date
1788
+			    break;
1789
+		    case 'alpha':
1790
+			    uasort($filtered_events, function (Fact $x, Fact $y) {
1791
+				    return GedcomRecord::compare($x->getParent(), $y->getParent());
1792
+			    });
1793
+			    break;
1794 1794
 		}
1795 1795
 
1796 1796
 		foreach ($filtered_events as $fact) {
Please login to merge, or discard this patch.
app/Functions/FunctionsDate.php 1 patch
Switch Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -31,28 +31,28 @@  discard block
 block discarded – undo
31 31
 	 */
32 32
 	public static function getAgeAtEvent($age_string) {
33 33
 		switch (strtoupper($age_string)) {
34
-		case 'CHILD':
35
-			return I18N::translate('Child');
36
-		case 'INFANT':
37
-			return I18N::translate('Infant');
38
-		case 'STILLBORN':
39
-			return I18N::translate('Stillborn');
40
-		default:
41
-			return preg_replace_callback(
42
-				array(
43
-					'/(\d+)([ymwd])/',
44
-				),
45
-				function ($match) {
46
-					switch ($match[2]) {
47
-					case 'y':
48
-						return I18N::plural('%s year', '%s years', $match[1], I18N::digits($match[1]));
49
-					case 'm':
50
-						return I18N::plural('%s month', '%s months', $match[1], I18N::digits($match[1]));
51
-					case 'w':
52
-						return I18N::plural('%s week', '%s weeks', $match[1], I18N::digits($match[1]));
53
-					case 'd':
54
-						return I18N::plural('%s day', '%s days', $match[1], I18N::digits($match[1]));
55
-					}
34
+		    case 'CHILD':
35
+			    return I18N::translate('Child');
36
+		    case 'INFANT':
37
+			    return I18N::translate('Infant');
38
+		    case 'STILLBORN':
39
+			    return I18N::translate('Stillborn');
40
+		    default:
41
+			    return preg_replace_callback(
42
+				    array(
43
+					    '/(\d+)([ymwd])/',
44
+				    ),
45
+				    function ($match) {
46
+					    switch ($match[2]) {
47
+					        case 'y':
48
+						        return I18N::plural('%s year', '%s years', $match[1], I18N::digits($match[1]));
49
+					        case 'm':
50
+						        return I18N::plural('%s month', '%s months', $match[1], I18N::digits($match[1]));
51
+					        case 'w':
52
+						        return I18N::plural('%s week', '%s weeks', $match[1], I18N::digits($match[1]));
53
+					        case 'd':
54
+						        return I18N::plural('%s day', '%s days', $match[1], I18N::digits($match[1]));
55
+					    }
56 56
 				},
57 57
 				$age_string
58 58
 			);
@@ -74,40 +74,40 @@  discard block
 block discarded – undo
74 74
 		preg_match_all('/%[^%]/', $time_fmt, $matches);
75 75
 		foreach ($matches[0] as $match) {
76 76
 			switch ($match) {
77
-			case '%a':
78
-				$t = gmdate('His', $time);
79
-				if ($t == '000000') {
80
-					$time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 00:00:00 */
81
-						I18N::translate('midnight'), $time_fmt);
82
-				} elseif ($t < '120000') {
83
-					$time_fmt = str_replace($match, /* I18N: time format “%a” - between 00:00:01 and 11:59:59 */
84
-						I18N::translate('a.m.'), $time_fmt);
85
-				} elseif ($t == '120000') {
86
-					$time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 12:00:00 */
87
-						I18N::translate('noon'), $time_fmt);
88
-				} else {
89
-					$time_fmt = str_replace($match, /* I18N: time format “%a” - between 12:00:01 and 23:59:59 */
90
-						I18N::translate('p.m.'), $time_fmt);
91
-				}
92
-				break;
93
-			case '%A':
94
-				$t = gmdate('His', $time);
95
-				if ($t == '000000') {
96
-					$time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 00:00:00 */
97
-						I18N::translate('Midnight'), $time_fmt);
98
-				} elseif ($t < '120000') {
99
-					$time_fmt = str_replace($match, /* I18N: time format “%A” - between 00:00:01 and 11:59:59 */
100
-						I18N::translate('A.M.'), $time_fmt);
101
-				} elseif ($t == '120000') {
102
-					$time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 12:00:00 */
103
-						I18N::translate('Noon'), $time_fmt);
104
-				} else {
105
-					$time_fmt = str_replace($match, /* I18N: time format “%A” - between 12:00:01 and 23:59:59 */
106
-						I18N::translate('P.M.'), $time_fmt);
107
-				}
108
-				break;
109
-			default:
110
-				$time_fmt = str_replace($match, I18N::digits(gmdate(substr($match, -1), $time)), $time_fmt);
77
+			    case '%a':
78
+				    $t = gmdate('His', $time);
79
+				    if ($t == '000000') {
80
+					    $time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 00:00:00 */
81
+						    I18N::translate('midnight'), $time_fmt);
82
+				    } elseif ($t < '120000') {
83
+					    $time_fmt = str_replace($match, /* I18N: time format “%a” - between 00:00:01 and 11:59:59 */
84
+						    I18N::translate('a.m.'), $time_fmt);
85
+				    } elseif ($t == '120000') {
86
+					    $time_fmt = str_replace($match, /* I18N: time format “%a” - exactly 12:00:00 */
87
+						    I18N::translate('noon'), $time_fmt);
88
+				    } else {
89
+					    $time_fmt = str_replace($match, /* I18N: time format “%a” - between 12:00:01 and 23:59:59 */
90
+						    I18N::translate('p.m.'), $time_fmt);
91
+				    }
92
+				    break;
93
+			    case '%A':
94
+				    $t = gmdate('His', $time);
95
+				    if ($t == '000000') {
96
+					    $time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 00:00:00 */
97
+						    I18N::translate('Midnight'), $time_fmt);
98
+				    } elseif ($t < '120000') {
99
+					    $time_fmt = str_replace($match, /* I18N: time format “%A” - between 00:00:01 and 11:59:59 */
100
+						    I18N::translate('A.M.'), $time_fmt);
101
+				    } elseif ($t == '120000') {
102
+					    $time_fmt = str_replace($match, /* I18N: time format “%A” - exactly 12:00:00 */
103
+						    I18N::translate('Noon'), $time_fmt);
104
+				    } else {
105
+					    $time_fmt = str_replace($match, /* I18N: time format “%A” - between 12:00:01 and 23:59:59 */
106
+						    I18N::translate('P.M.'), $time_fmt);
107
+				    }
108
+				    break;
109
+			    default:
110
+				    $time_fmt = str_replace($match, I18N::digits(gmdate(substr($match, -1), $time)), $time_fmt);
111 111
 			}
112 112
 		}
113 113
 
Please login to merge, or discard this patch.