Passed
Branch master (380e00)
by Greg
20:17
created

GedcomTag::getLabel()   F

Complexity

Conditions 528
Paths 1058

Size

Total Lines 1278
Code Lines 1196

Duplication

Lines 606
Ratio 47.42 %

Importance

Changes 0
Metric Value
cc 528
eloc 1196
nc 1058
nop 2
dl 606
loc 1278
rs 2
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * webtrees: online genealogy
4
 * Copyright (C) 2017 webtrees development team
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
 * GNU General Public License for more details.
13
 * You should have received a copy of the GNU General Public License
14
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15
 */
16
namespace Fisharebest\Webtrees;
17
18
use Ramsey\Uuid\Uuid;
19
20
/**
21
 * Static GEDCOM data for tags
22
 */
23
class GedcomTag {
24
	/** @var string[] All tags that webtrees knows how to translate - including special/internal tags */
25
	private static $ALL_TAGS = [
26
		'ABBR', 'ADDR', 'ADR1', 'ADR2', 'ADOP', 'ADOP:DATE', 'ADOP:PLAC',
27
		'AFN', 'AGE', 'AGNC', 'ALIA', 'ANCE', 'ANCI', 'ANUL', 'ASSO', 'AUTH', 'BAPL',
28
		'BAPL:DATE', 'BAPL:PLAC', 'BAPM', 'BAPM:DATE', 'BAPM:PLAC', 'BARM',
29
		'BARM:DATE', 'BARM:PLAC', 'BASM', 'BASM:DATE', 'BASM:PLAC',
30
		'BIRT', 'BIRT:DATE', 'BIRT:PLAC', 'BLES', 'BLES:DATE',
31
		'BLES:PLAC', 'BLOB', 'BURI', 'BURI:DATE', 'BURI:PLAC',
32
		'CALN', 'CAST', 'CAUS', 'CEME', 'CENS', 'CENS:DATE', 'CENS:PLAC',
33
		'CHAN', 'CHAN:DATE', 'CHAN:_WT_USER', 'CHAR',
34
		'CHIL', 'CHR', 'CHR:DATE', 'CHR:PLAC', 'CHRA', 'CITN', 'CITY',
35
		'COMM', 'CONC', 'CONT', 'CONF', 'CONF:DATE', 'CONF:PLAC', 'CONL',
36
		'COPR', 'CORP', 'CREM', 'CREM:DATE', 'CREM:PLAC', 'CTRY', 'DATA',
37
		'DATA:DATE', 'DATE', 'DEAT', 'DEAT:CAUS', 'DEAT:DATE', 'DEAT:PLAC',
38
		'DESC', 'DESI', 'DEST', 'DIV', 'DIVF', 'DSCR', 'EDUC', 'EDUC:AGNC', 'EMAI',
39
		'EMAIL', 'EMAL', 'EMIG', 'EMIG:DATE', 'EMIG:PLAC', 'ENDL', 'ENDL:DATE',
40
		'ENDL:PLAC', 'ENGA', 'ENGA:DATE', 'ENGA:PLAC', 'EVEN', 'EVEN:DATE',
41
		'EVEN:PLAC', 'EVEN:TYPE', 'FACT', 'FACT:TYPE', 'FAM', 'FAMC', 'FAMF',
42
		'FAMS', 'FAMS:CENS:DATE', 'FAMS:CENS:PLAC',
43
		'FAMS:DIV:DATE', 'FAMS:MARR:DATE', 'FAMS:MARR:PLAC', 'FAMS:NOTE',
44
		'FAX', 'FCOM', 'FCOM:DATE',
45
		'FCOM:PLAC', 'FILE', 'FONE', 'FORM', 'GEDC', 'GIVN', 'GRAD',
46
		'HEAD', 'HUSB', 'IDNO', 'IMMI', 'IMMI:DATE', 'IMMI:PLAC', 'INDI', 'INFL',
47
		'LANG', 'LATI', 'LEGA', 'LONG', 'MAP', 'MARB', 'MARB:DATE', 'MARB:PLAC',
48
		'MARC', 'MARL', 'MARR', 'MARR:DATE', 'MARR:PLAC',
49
		'MARR_CIVIL', 'MARR_PARTNERS', 'MARR_RELIGIOUS', 'MARR_UNKNOWN', 'MARS',
50
		'MEDI', 'NAME', 'NAME:FONE', 'NAME:_HEB', 'NATI', 'NATU', 'NATU:DATE', 'NATU:PLAC',
51
		'NCHI', 'NICK', 'NMR', 'NOTE', 'NPFX', 'NSFX', 'OBJE', 'OCCU', 'OCCU:AGNC',
52
		'ORDI', 'ORDN', 'ORDN:AGNC', 'ORDN:DATE', 'ORDN:PLAC', 'PAGE', 'PEDI', 'PHON',
53
		'PLAC', 'PLAC:FONE', 'PLAC:ROMN', 'PLAC:_HEB', 'POST', 'PROB', 'PROP', 'PUBL',
54
		'QUAY', 'REFN', 'RELA', 'RELI', 'REPO', 'RESI', 'RESI:DATE', 'RESI:PLAC', 'RESN',
55
		'RETI', 'RETI:AGNC', 'RFN', 'RIN', 'ROLE', 'ROMN', 'SERV', 'SEX', 'SHARED_NOTE',
56
		'SLGC', 'SLGC:DATE', 'SLGC:PLAC', 'SLGS', 'SLGS:DATE', 'SLGS:PLAC', 'SOUR',
57
		'SPFX', 'SSN', 'STAE', 'STAT', 'STAT:DATE', 'SUBM', 'SUBN', 'SURN', 'TEMP',
58
		'TEXT', 'TIME', 'TITL', 'TITL:FONE', 'TITL:ROMN', 'TITL:_HEB', 'TRLR', 'TYPE',
59
		'URL', 'VERS', 'WIFE', 'WILL', 'WWW', '_ADOP_CHIL', '_ADOP_GCHI', '_ADOP_GCH1',
60
		'_ADOP_GCH2', '_ADOP_HSIB', '_ADOP_SIBL', '_ADPF', '_ADPM', '_AKA', '_AKAN', '_ASSO',
61
		'_BAPM_CHIL', '_BAPM_GCHI', '_BAPM_GCH1', '_BAPM_GCH2', '_BAPM_HSIB', '_BAPM_SIBL',
62
		'_BIBL', '_BIRT_CHIL', '_BIRT_GCHI', '_BIRT_GCH1', '_BIRT_GCH2', '_BIRT_HSIB', '_BIRT_SIBL',
63
		'_BRTM', '_BRTM:DATE', '_BRTM:PLAC', '_BURI_CHIL',
64
		'_BURI_GCHI', '_BURI_GCH1', '_BURI_GCH2', '_BURI_GPAR', '_BURI_HSIB', '_BURI_SIBL', '_BURI_SPOU',
65
		'_CHR_CHIL', '_CHR_GCHI', '_CHR_GCH1', '_CHR_GCH2', '_CHR_HSIB', '_CHR_SIBL', '_COML',
66
		'_CREM_CHIL', '_CREM_GCHI', '_CREM_GCH1', '_CREM_GCH2',
67
		'_CREM_GPAR', '_CREM_HSIB', '_CREM_SIBL', '_CREM_SPOU', '_DATE',
68
		'_DBID', '_DEAT_CHIL', '_DEAT_GCHI', '_DEAT_GCH1',
69
		'_DEAT_GCH2', '_DEAT_GPAR', '_DEAT_GPA1', '_DEAT_GPA2',
70
		'_DEAT_HSIB', '_DEAT_PARE', '_DEAT_SIBL', '_DEAT_SPOU', '_DEG', '_DETS', '_DNA',
71
		'_EMAIL', '_EYEC', '_FA1', '_FA2', '_FA3', '_FA4', '_FA5', '_FA6', '_FA7', '_FA8',
72
		'_FA9', '_FA10', '_FA11', '_FA12', '_FA13', '_FNRL', '_FREL', '_GEDF', '_GODP', '_HAIR',
73
		'_HEB', '_HEIG', '_HNM', '_HOL', '_INTE', '_LOC', '_MARB_CHIL', '_MARB_FAMC', '_MARB_GCHI',
74
		'_MARB_GCH1', '_MARB_GCH2', '_MARB_HSIB', '_MARB_PARE', '_MARB_SIBL', '_MARI',
75
		'_MARNM', '_PRIM', '_MARNM_SURN', '_MARR_CHIL', '_MARR_FAMC', '_MARR_GCHI',
76
		'_MARR_GCH1', '_MARR_GCH2', '_MARR_HSIB', '_MARR_PARE', '_MARR_SIBL', '_MBON',
77
		'_MDCL', '_MEDC', '_MEND', '_MILI', '_MILT', '_MREL', '_MSTAT', '_NAME', '_NAMS',
78
		'_NLIV', '_NMAR', '_NMR', '_PLACE', '_WT_USER', '_PRMN', '_SCBK', '_SEPR', '_SSHOW', '_STAT',
79
		'_SUBQ', '_TODO', '_TYPE', '_UID', '_URL', '_WEIG', '_WITN', '_YART', '__BRTM_CHIL',
80
		'__BRTM_GCHI', '__BRTM_GCH1', '__BRTM_GCH2', '__BRTM_HSIB', '__BRTM_SIBL',
81
		// These pseudo-tags are generated dynamically to display media object attributes
82
		'__FILE_SIZE__', '__IMAGE_SIZE__',
83
	];
84
85
	/** @var string[] Possible values for the Object-File-Format types */
86
	private static $OBJE_FILE_FORM_TYPE = [
87
		'audio', 'book', 'card', 'certificate', 'coat', 'document', 'electronic',
88
		'fiche', 'film', 'magazine', 'manuscript', 'map', 'newspaper', 'photo',
89
		'tombstone', 'video', 'painting', 'other',
90
	];
91
92
	/**
93
	 * Is $tag one of our known tags?
94
	 *
95
	 * @param string $tag
96
	 *
97
	 * @return bool
98
	 */
99
	public static function isTag($tag) {
100
		return in_array($tag, self::$ALL_TAGS);
101
	}
102
103
	/**
104
	 * Translate a tag, for an (optional) record
105
	 *
106
	 * @param string               $tag
107
	 * @param GedcomRecord|null $record
108
	 *
109
	 * @return string
110
	 */
111
	public static function getLabel($tag, GedcomRecord $record = null) {
112
		if ($record instanceof Individual) {
113
			$sex = $record->getSex();
114
		} else {
115
			$sex = 'U';
116
		}
117
118
		switch ($tag) {
119
			case 'ABBR':
120
				return /* I18N: gedcom tag ABBR */ I18N::translate('Abbreviation');
121
			case 'ADDR':
122
				return /* I18N: gedcom tag ADDR */ I18N::translate('Address');
123
			case 'ADR1':
124
				return I18N::translate('Address line 1');
125
			case 'ADR2':
126
				return I18N::translate('Address line 2');
127
			case 'ADOP':
128
				return /* I18N: gedcom tag ADOP */ I18N::translate('Adoption');
129
			case 'ADOP:DATE':
130
				return I18N::translate('Date of adoption');
131
			case 'ADOP:PLAC':
132
				return I18N::translate('Place of adoption');
133
			case 'AFN':
134
				return /* I18N: gedcom tag AFN */ I18N::translate('Ancestral file number');
135
			case 'AGE':
136
				return /* I18N: gedcom tag AGE */ I18N::translate('Age');
137
			case 'AGNC':
138
				return /* I18N: gedcom tag AGNC */ I18N::translate('Agency');
139
			case 'ALIA':
140
				return /* I18N: gedcom tag ALIA */ I18N::translate('Alias');
141
			case 'ANCE':
142
				return /* I18N: gedcom tag ANCE */ I18N::translate('Generations of ancestors');
143
			case 'ANCI':
144
				return /* I18N: gedcom tag ANCI */ I18N::translate('Ancestors interest');
145
			case 'ANUL':
146
				return /* I18N: gedcom tag ANUL */ I18N::translate('Annulment');
147
			case 'ASSO':
148
				return /* I18N: gedcom tag ASSO */ I18N::translate('Associate'); /* see also _ASSO */
149
			case 'AUTH':
150
				return /* I18N: gedcom tag AUTH */ I18N::translate('Author');
151
			case 'BAPL':
152
				return /* I18N: gedcom tag BAPL. LDS = Church of Latter Day Saints. */ I18N::translate('LDS baptism');
153
			case 'BAPL:DATE':
154
				return /* I18N: LDS = Church of Latter Day Saints. */ I18N::translate('Date of LDS baptism');
155
			case 'BAPL:PLAC':
156
				return /* I18N: LDS = Church of Latter Day Saints. */ I18N::translate('Place of LDS baptism');
157
			case 'BAPM':
158
				return /* I18N: gedcom tag BAPM */ I18N::translate('Baptism');
159
			case 'BAPM:DATE':
160
				return I18N::translate('Date of baptism');
161
			case 'BAPM:PLAC':
162
				return I18N::translate('Place of baptism');
163
			case 'BARM':
164
				return /* I18N: gedcom tag BARM */ I18N::translate('Bar mitzvah');
165
			case 'BARM:DATE':
166
				return I18N::translate('Date of bar mitzvah');
167
			case 'BARM:PLAC':
168
				return I18N::translate('Place of bar mitzvah');
169
			case 'BASM':
170
				return /* I18N: gedcom tag BASM */ I18N::translate('Bat mitzvah');
171
			case 'BASM:DATE':
172
				return I18N::translate('Date of bat mitzvah');
173
			case 'BASM:PLAC':
174
				return I18N::translate('Place of bat mitzvah');
175
			case 'BIRT':
176
				return /* I18N: gedcom tag BIRT */ I18N::translate('Birth');
177
			case 'BIRT:DATE':
178
				return I18N::translate('Date of birth');
179
			case 'BIRT:PLAC':
180
				return I18N::translate('Place of birth');
181
			case 'BLES':
182
				return /* I18N: gedcom tag BLES */ I18N::translate('Blessing');
183
			case 'BLES:DATE':
184
				return I18N::translate('Date of blessing');
185
			case 'BLES:PLAC':
186
				return I18N::translate('Place of blessing');
187
			case 'BLOB':
188
				return /* I18N: gedcom tag BLOB */ I18N::translate('Binary data object');
189
			case 'BURI':
190
				return /* I18N: gedcom tag BURI */ I18N::translate('Burial');
191
			case 'BURI:DATE':
192
				return I18N::translate('Date of burial');
193
			case 'BURI:PLAC':
194
				return I18N::translate('Place of burial');
195
			case 'CALN':
196
				return /* I18N: gedcom tag CALN */ I18N::translate('Call number');
197
			case 'CAST':
198
				return /* I18N: gedcom tag CAST */ I18N::translate('Caste');
199
			case 'CAUS':
200
				return /* I18N: gedcom tag CAUS */ I18N::translate('Cause');
201
			case 'CEME':
202
				return /* I18N: gedcom tag CEME */ I18N::translate('Cemetery');
203
			case 'CENS':
204
				return /* I18N: gedcom tag CENS */ I18N::translate('Census');
205
			case 'CENS:DATE':
206
				return I18N::translate('Census date');
207
			case 'CENS:PLAC':
208
				return I18N::translate('Census place');
209
			case '_UPD': // Family Tree Builder uses "1 _UPD 14 APR 2012 00:14:10 GMT-5" instead of 1 CHAN/2 DATE/3 TIME
210
			case 'CHAN':
211
				return /* I18N: gedcom tag CHAN */ I18N::translate('Last change');
212
			case 'CHAN:DATE':
213
				return /* I18N: gedcom tag CHAN:DATE */ I18N::translate('Date of last change');
214
			case 'CHAN:_WT_USER':
215
				return /* I18N: gedcom tag CHAN:_WT_USER */ I18N::translate('Author of last change');
216
			case 'CHAR':
217
				return /* I18N: gedcom tag CHAR */ I18N::translate('Character set');
218
			case 'CHIL':
219
				return /* I18N: gedcom tag CHIL */ I18N::translate('Child');
220
			case 'CHR':
221
				return /* I18N: gedcom tag CHR */ I18N::translate('Christening');
222
			case 'CHR:DATE':
223
				return I18N::translate('Date of christening');
224
			case 'CHR:PLAC':
225
				return I18N::translate('Place of christening');
226
			case 'CHRA':
227
				return /* I18N: gedcom tag CHRA */ I18N::translate('Adult christening');
228
			case 'CITN':
229
				return /* I18N: gedcom tag CITN */ I18N::translate('Citizenship');
230
			case 'CITY':
231
				return /* I18N: gedcom tag CITY */ I18N::translate('City');
232
			case 'COMM':
233
				return /* I18N: gedcom tag COMM */ I18N::translate('Comment');
234
			case 'CONC':
235
				return /* I18N: gedcom tag CONC */ I18N::translate('Concatenation');
236
			case 'CONT':
237
				return /* I18N: gedcom tag CONT */ I18N::translate('Continued');
238
			case 'CONF':
239
				return /* I18N: gedcom tag CONF */ I18N::translate('Confirmation');
240
			case 'CONF:DATE':
241
				return I18N::translate('Date of confirmation');
242
			case 'CONF:PLAC':
243
				return I18N::translate('Place of confirmation');
244
			case 'CONL':
245
				return /* I18N: gedcom tag CONL. LDS = Church of Latter Day Saints. */ I18N::translate('LDS confirmation');
246
			case 'COPR':
247
				return /* I18N: gedcom tag COPR */ I18N::translate('Copyright');
248
			case 'CORP':
249
				return /* I18N: gedcom tag CORP */ I18N::translate('Corporation');
250
			case 'CREM':
251
				return /* I18N: gedcom tag CREM */ I18N::translate('Cremation');
252
			case 'CREM:DATE':
253
				return I18N::translate('Date of cremation');
254
			case 'CREM:PLAC':
255
				return I18N::translate('Place of cremation');
256
			case 'CTRY':
257
				return /* I18N: gedcom tag CTRY */ I18N::translate('Country');
258
			case 'DATA':
259
				return /* I18N: gedcom tag DATA */ I18N::translate('Data');
260
			case 'DATA:DATE':
261
				return I18N::translate('Date of entry in original source');
262
			case '_DATE': // Family Tree Builder uses OBJE:_DATE
263
			case 'DATE':
264
				return /* I18N: gedcom tag DATE */ I18N::translate('Date');
265
			case 'DEAT':
266
				return /* I18N: gedcom tag DEAT */ I18N::translate('Death');
267
			case 'DEAT:CAUS':
268
				return I18N::translate('Cause of death');
269
			case 'DEAT:DATE':
270
				return I18N::translate('Date of death');
271
			case 'DEAT:PLAC':
272
				return I18N::translate('Place of death');
273
			case 'DESC':
274
				return /* I18N: gedcom tag DESC */
275
					I18N::translate('Descendants');
276
			case 'DESI':
277
				return /* I18N: gedcom tag DESI */ I18N::translate('Descendants interest');
278
			case 'DEST':
279
				return /* I18N: gedcom tag DEST */ I18N::translate('Destination');
280
			case 'DIV':
281
				return /* I18N: gedcom tag DIV */ I18N::translate('Divorce');
282
			case 'DIVF':
283
				return /* I18N: gedcom tag DIVF */ I18N::translate('Divorce filed');
284
			case 'DSCR':
285
				return /* I18N: gedcom tag DSCR */ I18N::translate('Description');
286
			case 'EDUC':
287
				return /* I18N: gedcom tag EDUC */ I18N::translate('Education');
288
			case 'EDUC:AGNC':
289
				return I18N::translate('School or college');
290
			case 'EMAI':
291
			case 'EMAL':
292
			case 'EMAIL':
293
				return /* I18N: gedcom tag EMAIL */ I18N::translate('Email address');
294
			case 'EMIG':
295
				return /* I18N: gedcom tag EMIG */ I18N::translate('Emigration');
296
			case 'EMIG:DATE':
297
				return I18N::translate('Date of emigration');
298
			case 'EMIG:PLAC':
299
				return I18N::translate('Place of emigration');
300
			case 'ENDL':
301
				return /* I18N: gedcom tag ENDL. LDS = Church of Latter Day Saints. */ I18N::translate('LDS endowment');
302
			case 'ENDL:DATE':
303
				return /* I18N: LDS = Church of Latter Day Saints. */ I18N::translate('Date of LDS endowment');
304
			case 'ENDL:PLAC':
305
				return /* I18N: LDS = Church of Latter Day Saints. */ I18N::translate('Place of LDS endowment');
306
			case 'ENGA':
307
				return /* I18N: gedcom tag ENGA */ I18N::translate('Engagement');
308
			case 'ENGA:DATE':
309
				return I18N::translate('Date of engagement');
310
			case 'ENGA:PLAC':
311
				return I18N::translate('Place of engagement');
312
			case 'EVEN':
313
				return /* I18N: gedcom tag EVEN */ I18N::translate('Event');
314
			case 'EVEN:DATE':
315
				return I18N::translate('Date of event');
316
			case 'EVEN:PLAC':
317
				return I18N::translate('Place of event');
318
			case 'EVEN:TYPE':
319
				return I18N::translate('Type of event');
320
			case 'FACT':
321
				return /* I18N: gedcom tag FACT */ I18N::translate('Fact');
322
			case 'FACT:TYPE':
323
				return I18N::translate('Type of fact');
324
			case 'FAM':
325
				return /* I18N: gedcom tag FAM */ I18N::translate('Family');
326
			case 'FAMC':
327
				return /* I18N: gedcom tag FAMC */ I18N::translate('Family as a child');
328
			case 'FAMF':
329
				return /* I18N: gedcom tag FAMF */ I18N::translate('Family file');
330
			case 'FAMS':
331
				return /* I18N: gedcom tag FAMS */ I18N::translate('Family as a spouse');
332
			case 'FAMS:CENS:DATE':
333
				return I18N::translate('Spouse census date');
334
			case 'FAMS:CENS:PLAC':
335
				return I18N::translate('Spouse census place');
336
			case 'FAMS:DIV:DATE':
337
				return I18N::translate('Date of divorce');
338
			case 'FAMS:MARR:DATE':
339
				return I18N::translate('Date of marriage');
340
			case 'FAMS:MARR:PLAC':
341
				return I18N::translate('Place of marriage');
342
			case 'FAMS:NOTE':
343
				return I18N::translate('Spouse note');
344
			case 'FAMS:SLGS:DATE':
345
				return /* I18N: LDS = Church of Latter Day Saints. */ I18N::translate('Date of LDS spouse sealing');
346
			case 'FAMS:SLGS:PLAC':
347
				return /* I18N: LDS = Church of Latter Day Saints. */ I18N::translate('Place of LDS spouse sealing');
348
			case 'FAX':
349
				return /* I18N: gedcom tag FAX */ I18N::translate('Fax');
350
			case 'FCOM':
351
				return /* I18N: gedcom tag FCOM */ I18N::translate('First communion');
352
			case 'FCOM:DATE':
353
				return I18N::translate('Date of first communion');
354
			case 'FCOM:PLAC':
355
				return I18N::translate('Place of first communion');
356
			case 'FILE':
357
				return /* I18N: gedcom tag FILE */ I18N::translate('Filename');
358
			case 'FONE':
359
				return /* I18N: gedcom tag FONE */ I18N::translate('Phonetic');
360
			case 'FORM':
361
				return /* I18N: gedcom tag FORM */ I18N::translate('Format');
362
			case 'GEDC':
363
				return /* I18N: gedcom tag GEDC */ I18N::translate('GEDCOM file');
364
			case 'GIVN':
365
				return /* I18N: gedcom tag GIVN */ I18N::translate('Given names');
366
			case 'GRAD':
367
				return /* I18N: gedcom tag GRAD */ I18N::translate('Graduation');
368
			case 'HEAD':
369
				return /* I18N: gedcom tag HEAD */ I18N::translate('Header');
370
			case 'HUSB':
371
				return /* I18N: gedcom tag HUSB */ I18N::translate('Husband');
372
			case 'IDNO':
373
				return /* I18N: gedcom tag IDNO */ I18N::translate('Identification number');
374
			case 'IMMI':
375
				return /* I18N: gedcom tag IMMI */ I18N::translate('Immigration');
376
			case 'IMMI:DATE':
377
				return I18N::translate('Date of immigration');
378
			case 'IMMI:PLAC':
379
				return I18N::translate('Place of immigration');
380
			case 'INDI':
381
				return /* I18N: gedcom tag INDI */ I18N::translate('Individual');
382
			case 'INFL':
383
				return /* I18N: gedcom tag INFL */ I18N::translate('Infant');
384
			case 'LANG':
385
				return /* I18N: gedcom tag LANG */ I18N::translate('Language');
386
			case 'LATI':
387
				return /* I18N: gedcom tag LATI */ I18N::translate('Latitude');
388
			case 'LEGA':
389
				return /* I18N: gedcom tag LEGA */ I18N::translate('Legatee');
390
			case 'LONG':
391
				return /* I18N: gedcom tag LONG */ I18N::translate('Longitude');
392
			case 'MAP':
393
				return /* I18N: gedcom tag MAP */ I18N::translate('Map');
394
			case 'MARB':
395
				return /* I18N: gedcom tag MARB */ I18N::translate('Marriage banns');
396
			case 'MARB:DATE':
397
				return I18N::translate('Date of marriage banns');
398
			case 'MARB:PLAC':
399
				return I18N::translate('Place of marriage banns');
400
			case 'MARC':
401
				return /* I18N: gedcom tag MARC */ I18N::translate('Marriage contract');
402
			case 'MARL':
403
				return /* I18N: gedcom tag MARL */ I18N::translate('Marriage license');
404
			case 'MARR':
405
				return /* I18N: gedcom tag MARR */ I18N::translate('Marriage');
406
			case 'MARR:DATE':
407
				return I18N::translate('Date of marriage');
408
			case 'MARR:PLAC':
409
				return I18N::translate('Place of marriage');
410
			case 'MARR_CIVIL':
411
				return I18N::translate('Civil marriage');
412
			case 'MARR_PARTNERS':
413
				return I18N::translate('Registered partnership');
414
			case 'MARR_RELIGIOUS':
415
				return I18N::translate('Religious marriage');
416
			case 'MARR_UNKNOWN':
417
				return I18N::translate('Marriage type unknown');
418
			case 'MARS':
419
				return /* I18N: gedcom tag MARS */ I18N::translate('Marriage settlement');
420
			case 'MEDI':
421
				return /* I18N: gedcom tag MEDI */ I18N::translate('Media type');
422
			case 'NAME':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
423
				if ($record instanceof Repository) {
424
					return /* I18N: gedcom tag REPO:NAME */ I18N::translateContext('Repository', 'Name');
425
				} else {
426
					return /* I18N: gedcom tag NAME */ I18N::translate('Name');
427
				}
428
			case 'NAME:FONE':
429
				return I18N::translate('Phonetic name');
430
			case 'NAME:_HEB':
431
				return I18N::translate('Name in Hebrew');
432
			case 'NATI':
433
				return /* I18N: gedcom tag NATI */ I18N::translate('Nationality');
434
			case 'NATU':
435
				return /* I18N: gedcom tag NATU */ I18N::translate('Naturalization');
436
			case 'NATU:DATE':
437
				return I18N::translate('Date of naturalization');
438
			case 'NATU:PLAC':
439
				return I18N::translate('Place of naturalization');
440
			case 'NCHI':
441
				return /* I18N: gedcom tag NCHI */ I18N::translate('Number of children');
442
			case 'NICK':
443
				return /* I18N: gedcom tag NICK */ I18N::translate('Nickname');
444
			case 'NMR':
445
				return /* I18N: gedcom tag NMR */ I18N::translate('Number of marriages');
446
			case 'NOTE':
447
				return /* I18N: gedcom tag NOTE */ I18N::translate('Note');
448
			case 'NPFX':
449
				return /* I18N: gedcom tag NPFX */ I18N::translate('Name prefix');
450
			case 'NSFX':
451
				return /* I18N: gedcom tag NSFX */ I18N::translate('Name suffix');
452
			case 'OBJE':
453
				return /* I18N: gedcom tag OBJE */ I18N::translate('Media object');
454
			case 'OCCU':
455
				return /* I18N: gedcom tag OCCU */ I18N::translate('Occupation');
456
			case 'OCCU:AGNC':
457
				return I18N::translate('Employer');
458
			case 'ORDI':
459
				return /* I18N: gedcom tag ORDI */ I18N::translate('Ordinance');
460
			case 'ORDN':
461
				return /* I18N: gedcom tag ORDN */ I18N::translate('Ordination');
462
			case 'ORDN:AGNC':
463
				return I18N::translate('Religious institution');
464
			case 'ORDN:DATE':
465
				return I18N::translate('Date of ordination');
466
			case 'ORDN:PLAC':
467
				return I18N::translate('Place of ordination');
468
			case 'PAGE':
469
				return /* I18N: gedcom tag PAGE */ I18N::translate('Citation details');
470
			case 'PEDI':
471
				return /* I18N: gedcom tag PEDI */ I18N::translate('Relationship to parents');
472
			case 'PHON':
473
				return /* I18N: gedcom tag PHON */ I18N::translate('Phone');
474
			case '_PLACE': // Family Tree Builder uses OBJE:_PLACE
475
			case 'PLAC':
476
				return /* I18N: gedcom tag PLAC */ I18N::translate('Place');
477
			case 'PLAC:FONE':
478
				return I18N::translate('Phonetic place');
479
			case 'PLAC:ROMN':
480
				return I18N::translate('Romanized place');
481
			case 'PLAC:_HEB':
482
				return I18N::translate('Place in Hebrew');
483
			case 'POST':
484
				return /* I18N: gedcom tag POST */ I18N::translate('Postal code');
485
			case 'PROB':
486
				return /* I18N: gedcom tag PROB */ I18N::translate('Probate');
487
			case 'PROP':
488
				return /* I18N: gedcom tag PROP */ I18N::translate('Property');
489
			case 'PUBL':
490
				return /* I18N: gedcom tag PUBL */ I18N::translate('Publication');
491
			case 'QUAY':
492
				return /* I18N: gedcom tag QUAY */ I18N::translate('Quality of data');
493
			case 'REFN':
494
				return /* I18N: gedcom tag REFN */ I18N::translate('Reference number');
495
			case 'RELA':
496
				return /* I18N: gedcom tag RELA */ I18N::translate('Relationship');
497
			case 'RELI':
498
				return /* I18N: gedcom tag RELI */ I18N::translate('Religion');
499
			case 'REPO':
500
				return /* I18N: gedcom tag REPO */ I18N::translate('Repository');
501
			case 'RESI':
502
				return /* I18N: gedcom tag RESI */ I18N::translate('Residence');
503
			case 'RESI:DATE':
504
				return I18N::translate('Date of residence');
505
			case 'RESI:PLAC':
506
				return I18N::translate('Place of residence');
507
			case 'RESN':
508
				return /* I18N: gedcom tag RESN */ I18N::translate('Restriction');
509
			case 'RETI':
510
				return /* I18N: gedcom tag RETI */ I18N::translate('Retirement');
511
			case 'RETI:AGNC':
512
				return I18N::translate('Employer');
513
			case 'RFN':
514
				return /* I18N: gedcom tag RFN */ I18N::translate('Record file number');
515
			case '_PHOTO_RIN': // Family Tree Builder uses "0 OBJE/1 _PHOTO_RIN"
516
			case '_PRIN': // Family Tree Builder uses "0 _ALBUM/1 _PHOTO/2 _PRIN"
517
			case 'RIN':
518
				return /* I18N: gedcom tag RIN */ I18N::translate('Record ID number');
519
			case 'ROLE':
520
				return /* I18N: gedcom tag ROLE */ I18N::translate('Role');
521
			case 'ROMN':
522
				return /* I18N: gedcom tag ROMN */ I18N::translate('Romanized');
523
			case 'SERV':
524
				return /* I18N: gedcom tag SERV */ I18N::translate('Remote server');
525
			case 'SEX':
526
				return /* I18N: gedcom tag SEX */ I18N::translate('Gender');
527
			case 'SHARED_NOTE':
528
				return I18N::translate('Shared note');
529
			case 'SLGC':
530
				return /* I18N: gedcom tag SLGC. LDS = Church of Latter Day Saints. */ I18N::translate('LDS child sealing');
531
			case 'SLGC:DATE':
532
				return /* I18N: LDS = Church of Latter Day Saints. */ I18N::translate('Date of LDS child sealing');
533
			case 'SLGC:PLAC':
534
				return /* I18N: LDS = Church of Latter Day Saints. */ I18N::translate('Place of LDS child sealing');
535
			case 'SLGS':
536
				return /* I18N: gedcom tag SLGS. LDS = Church of Latter Day Saints. */ I18N::translate('LDS spouse sealing');
537
			case 'SOUR':
538
				return /* I18N: gedcom tag SOUR */ I18N::translate('Source');
539
			case 'SPFX':
540
				return /* I18N: gedcom tag SPFX */ I18N::translate('Surname prefix');
541
			case 'SSN':
542
				return /* I18N: gedcom tag SSN */ I18N::translate('Social security number');
543
			case 'STAE':
544
				return /* I18N: gedcom tag STAE */ I18N::translate('State');
545
			case 'STAT':
546
				return /* I18N: gedcom tag STAT */ I18N::translate('Status');
547
			case 'STAT:DATE':
548
				return I18N::translate('Status change date');
549
			case 'SUBM':
550
				return /* I18N: gedcom tag SUBM */ I18N::translate('Submitter');
551
			case 'SUBN':
552
				return /* I18N: gedcom tag SUBN */ I18N::translate('Submission');
553
			case 'SURN':
554
				return /* I18N: gedcom tag SURN */ I18N::translate('Surname');
555
			case 'TEMP':
556
				return /* I18N: gedcom tag TEMP */ I18N::translate('Temple');
557
			case 'TEXT':
558
				return /* I18N: gedcom tag TEXT */ I18N::translate('Text');
559
			case 'TIME':
560
				return /* I18N: gedcom tag TIME */ I18N::translate('Time');
561
			case 'TITL':
562
				return /* I18N: gedcom tag TITL */ I18N::translate('Title');
563
			case 'TITL:FONE':
564
				return I18N::translate('Phonetic title');
565
			case 'TITL:ROMN':
566
				return I18N::translate('Romanized title');
567
			case 'TITL:_HEB':
568
				return I18N::translate('Title in Hebrew');
569
			case 'TRLR':
570
				return /* I18N: gedcom tag TRLR */ I18N::translate('Trailer');
571
			case 'TYPE':
572
				return /* I18N: gedcom tag TYPE */ I18N::translate('Type');
573
			case 'URL':
574
				return /* I18N: gedcom tag URL (A web address / URL) */ I18N::translate('URL');
575
			case 'VERS':
576
				return /* I18N: gedcom tag VERS */ I18N::translate('Version');
577
			case 'WIFE':
578
				return /* I18N: gedcom tag WIFE */ I18N::translate('Wife');
579
			case 'WILL':
580
				return /* I18N: gedcom tag WILL */ I18N::translate('Will');
581
			case 'WWW':
582
				return /* I18N: gedcom tag WWW (A web address / URL) */ I18N::translate('URL');
583 View Code Duplication
			case '_ADOP_CHIL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
584
				switch ($sex) {
585
					case 'M':
586
						return I18N::translate('Adoption of a son');
587
					case 'F':
588
						return I18N::translate('Adoption of a daughter');
589
					default:
590
						return I18N::translate('Adoption of a child');
591
				}
592 View Code Duplication
			case '_ADOP_GCHI':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
593
				switch ($sex) {
594
					case 'M':
595
						return I18N::translate('Adoption of a grandson');
596
					case 'F':
597
						return I18N::translate('Adoption of a granddaughter');
598
					default:
599
						return I18N::translate('Adoption of a grandchild');
600
				}
601 View Code Duplication
			case '_ADOP_GCH1':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
602
				switch ($sex) {
603
					case 'M':
604
						return I18N::translateContext('daughter’s son', 'Adoption of a grandson');
605
					case 'F':
606
						return I18N::translateContext('daughter’s daughter', 'Adoption of a granddaughter');
607
					default:
608
						return I18N::translate('Adoption of a grandchild');
609
				}
610 View Code Duplication
			case '_ADOP_GCH2':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
611
				switch ($sex) {
612
					case 'M':
613
						return I18N::translateContext('son’s son', 'Adoption of a grandson');
614
					case 'F':
615
						return I18N::translateContext('son’s daughter', 'Adoption of a granddaughter');
616
					default:
617
						return I18N::translate('Adoption of a grandchild');
618
				}
619 View Code Duplication
			case '_ADOP_HSIB':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
620
				switch ($sex) {
621
					case 'M':
622
						return I18N::translate('Adoption of a half-brother');
623
					case 'F':
624
						return I18N::translate('Adoption of a half-sister');
625
					default:
626
						return I18N::translate('Adoption of a half-sibling');
627
				}
628 View Code Duplication
			case '_ADOP_SIBL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
629
				switch ($sex) {
630
					case 'M':
631
						return I18N::translate('Adoption of a brother');
632
					case 'F':
633
						return I18N::translate('Adoption of a sister');
634
					default:
635
						return I18N::translate('Adoption of a sibling');
636
				}
637
			case '_ADPF':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
638
				switch ($sex) {
639
					case 'M':
640
						return /* I18N: gedcom tag _ADPF */ I18N::translateContext('MALE', 'Adopted by father');
641
					case 'F':
642
						return /* I18N: gedcom tag _ADPF */ I18N::translateContext('FEMALE', 'Adopted by father');
643
					default:
644
						return /* I18N: gedcom tag _ADPF */ I18N::translate('Adopted by father');
645
				}
646
			case '_ADPM':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
647
				switch ($sex) {
648
					case 'M':
649
						return /* I18N: gedcom tag _ADPM */ I18N::translateContext('MALE', 'Adopted by mother');
650
					case 'F':
651
						return /* I18N: gedcom tag _ADPM */ I18N::translateContext('FEMALE', 'Adopted by mother');
652
					default:
653
						return /* I18N: gedcom tag _ADPM */ I18N::translate('Adopted by mother');
654
				}
655
			case '_AKA':
656
			case '_AKAN':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
657
				switch ($sex) {
658
					case 'M':
659
						return /* I18N: gedcom tag _AKA */ I18N::translateContext('MALE', 'Also known as');
660
					case 'F':
661
						return /* I18N: gedcom tag _AKA */ I18N::translateContext('FEMALE', 'Also known as');
662
					default:
663
						return /* I18N: gedcom tag _AKA */ I18N::translate('Also known as');
664
				}
665
			case '_ALBUM': // Family Tree Builder uses OBJE:_ALBUM
666
				return /* I18N: gedcom tag _ALBUM */ I18N::translate('Album');
667
			case '_ASSO':
668
				return /* I18N: gedcom tag _ASSO */ I18N::translate('Associate'); /* see also ASSO */
669 View Code Duplication
			case '_BAPM_CHIL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
670
				switch ($sex) {
671
					case 'M':
672
						return I18N::translate('Baptism of a son');
673
					case 'F':
674
						return I18N::translate('Baptism of a daughter');
675
					default:
676
						return I18N::translate('Baptism of a child');
677
				}
678 View Code Duplication
			case '_BAPM_GCHI':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
679
				switch ($sex) {
680
					case 'M':
681
						return I18N::translate('Baptism of a grandson');
682
					case 'F':
683
						return I18N::translate('Baptism of a granddaughter');
684
					default:
685
						return I18N::translate('Baptism of a grandchild');
686
				}
687 View Code Duplication
			case '_BAPM_GCH1':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
688
				switch ($sex) {
689
					case 'M':
690
						return I18N::translateContext('daughter’s son', 'Baptism of a grandson');
691
					case 'F':
692
						return I18N::translateContext('daughter’s daughter', 'Baptism of a granddaughter');
693
					default:
694
						return I18N::translate('Baptism of a grandchild');
695
				}
696 View Code Duplication
			case '_BAPM_GCH2':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
697
				switch ($sex) {
698
					case 'M':
699
						return I18N::translateContext('son’s son', 'Baptism of a grandson');
700
					case 'F':
701
						return I18N::translateContext('son’s daughter', 'Baptism of a granddaughter');
702
					default:
703
						return I18N::translate('Baptism of a grandchild');
704
				}
705 View Code Duplication
			case '_BAPM_HSIB':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
706
				switch ($sex) {
707
					case 'M':
708
						return I18N::translate('Baptism of a half-brother');
709
					case 'F':
710
						return I18N::translate('Baptism of a half-sister');
711
					default:
712
						return I18N::translate('Baptism of a half-sibling');
713
				}
714 View Code Duplication
			case '_BAPM_SIBL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
715
				switch ($sex) {
716
					case 'M':
717
						return I18N::translate('Baptism of a brother');
718
					case 'F':
719
						return I18N::translate('Baptism of a sister');
720
					default:
721
						return I18N::translate('Baptism of a sibling');
722
				}
723
			case '_BIBL':
724
				return /* I18N: gedcom tag _BIBL */ I18N::translate('Bibliography');
725 View Code Duplication
			case '_BIRT_CHIL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
726
				switch ($sex) {
727
					case 'M':
728
						return I18N::translate('Birth of a son');
729
					case 'F':
730
						return I18N::translate('Birth of a daughter');
731
					default:
732
						return I18N::translate('Birth of a child');
733
				}
734 View Code Duplication
			case '_BIRT_GCHI':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
735
				switch ($sex) {
736
					case 'M':
737
						return I18N::translate('Birth of a grandson');
738
					case 'F':
739
						return I18N::translate('Birth of a granddaughter');
740
					default:
741
						return I18N::translate('Birth of a grandchild');
742
				}
743 View Code Duplication
			case '_BIRT_GCH1':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
744
				switch ($sex) {
745
					case 'M':
746
						return I18N::translateContext('daughter’s son', 'Birth of a grandson');
747
					case 'F':
748
						return I18N::translateContext('daughter’s daughter', 'Birth of a granddaughter');
749
					default:
750
						return I18N::translate('Birth of a grandchild');
751
				}
752 View Code Duplication
			case '_BIRT_GCH2':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
753
				switch ($sex) {
754
					case 'M':
755
						return I18N::translateContext('son’s son', 'Birth of a grandson');
756
					case 'F':
757
						return I18N::translateContext('son’s daughter', 'Birth of a granddaughter');
758
					default:
759
						return I18N::translate('Birth of a grandchild');
760
				}
761 View Code Duplication
			case '_BIRT_HSIB':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
762
				switch ($sex) {
763
					case 'M':
764
						return I18N::translate('Birth of a half-brother');
765
					case 'F':
766
						return I18N::translate('Birth of a half-sister');
767
					default:
768
						return I18N::translate('Birth of a half-sibling');
769
				}
770 View Code Duplication
			case '_BIRT_SIBL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
771
				switch ($sex) {
772
					case 'M':
773
						return I18N::translate('Birth of a brother');
774
					case 'F':
775
						return I18N::translate('Birth of a sister');
776
					default:
777
						return I18N::translate('Birth of a sibling');
778
				}
779
			case '_BRTM':
780
				return /* I18N: gedcom tag _BRTM */ I18N::translate('Brit milah');
781
			case '_BRTM:DATE':
782
				return I18N::translate('Date of brit milah');
783
			case '_BRTM:PLAC':
784
				return I18N::translate('Place of brit milah');
785 View Code Duplication
			case '_BURI_CHIL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
786
				switch ($sex) {
787
					case 'M':
788
						return I18N::translate('Burial of a son');
789
					case 'F':
790
						return I18N::translate('Burial of a daughter');
791
					default:
792
						return I18N::translate('Burial of a child');
793
				}
794 View Code Duplication
			case '_BURI_GCHI':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
795
				switch ($sex) {
796
					case 'M':
797
						return I18N::translate('Burial of a grandson');
798
					case 'F':
799
						return I18N::translate('Burial of a granddaughter');
800
					default:
801
						return I18N::translate('Burial of a grandchild');
802
				}
803 View Code Duplication
			case '_BURI_GCH1':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
804
				switch ($sex) {
805
					case 'M':
806
						return I18N::translateContext('daughter’s son', 'Burial of a grandson');
807
					case 'F':
808
						return I18N::translateContext('daughter’s daughter', 'Burial of a granddaughter');
809
					default:
810
						return I18N::translate('Burial of a grandchild');
811
				}
812 View Code Duplication
			case '_BURI_GCH2':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
813
				switch ($sex) {
814
					case 'M':
815
						return I18N::translateContext('son’s son', 'Burial of a grandson');
816
					case 'F':
817
						return I18N::translateContext('son’s daughter', 'Burial of a granddaughter');
818
					default:
819
						return I18N::translate('Burial of a grandchild');
820
				}
821 View Code Duplication
			case '_BURI_GPAR':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
822
				switch ($sex) {
823
					case 'M':
824
						return I18N::translate('Burial of a grandfather');
825
					case 'F':
826
						return I18N::translate('Burial of a grandmother');
827
					default:
828
						return I18N::translate('Burial of a grandparent');
829
				}
830 View Code Duplication
			case '_BURI_GPA1':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
831
				switch ($sex) {
832
					case 'M':
833
						return I18N::translate('Burial of a paternal grandfather');
834
					case 'F':
835
						return I18N::translate('Burial of a paternal grandmother');
836
					default:
837
						return I18N::translate('Burial of a paternal grandparent');
838
				}
839 View Code Duplication
			case '_BURI_GPA2':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
840
				switch ($sex) {
841
					case 'M':
842
						return I18N::translate('Burial of a maternal grandfather');
843
					case 'F':
844
						return I18N::translate('Burial of a maternal grandmother');
845
					default:
846
						return I18N::translate('Burial of a maternal grandparent');
847
				}
848 View Code Duplication
			case '_BURI_HSIB':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
849
				switch ($sex) {
850
					case 'M':
851
						return I18N::translate('Burial of a half-brother');
852
					case 'F':
853
						return I18N::translate('Burial of a half-sister');
854
					default:
855
						return I18N::translate('Burial of a half-sibling');
856
				}
857 View Code Duplication
			case '_BURI_PARE':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
858
				switch ($sex) {
859
					case 'M':
860
						return I18N::translate('Burial of a father');
861
					case 'F':
862
						return I18N::translate('Burial of a mother');
863
					default:
864
						return I18N::translate('Burial of a parent');
865
				}
866 View Code Duplication
			case '_BURI_SIBL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
867
				switch ($sex) {
868
					case 'M':
869
						return I18N::translate('Burial of a brother');
870
					case 'F':
871
						return I18N::translate('Burial of a sister');
872
					default:
873
						return I18N::translate('Burial of a sibling');
874
				}
875 View Code Duplication
			case '_BURI_SPOU':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
876
				switch ($sex) {
877
					case 'M':
878
						return I18N::translate('Burial of a husband');
879
					case 'F':
880
						return I18N::translate('Burial of a wife');
881
					default:
882
						return I18N::translate('Burial of a spouse');
883
				}
884 View Code Duplication
			case '_CHR_CHIL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
885
				switch ($sex) {
886
					case 'M':
887
						return I18N::translate('Christening of a son');
888
					case 'F':
889
						return I18N::translate('Christening of a daughter');
890
					default:
891
						return I18N::translate('Christening of a child');
892
				}
893 View Code Duplication
			case '_CHR_GCHI':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
894
				switch ($sex) {
895
					case 'M':
896
						return I18N::translate('Christening of a grandson');
897
					case 'F':
898
						return I18N::translate('Christening of a granddaughter');
899
					default:
900
						return I18N::translate('Christening of a grandchild');
901
				}
902 View Code Duplication
			case '_CHR_GCH1':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
903
				switch ($sex) {
904
					case 'M':
905
						return I18N::translateContext('daughter’s son', 'Christening of a grandson');
906
					case 'F':
907
						return I18N::translateContext('daughter’s daughter', 'Christening of a granddaughter');
908
					default:
909
						return I18N::translate('Christening of a grandchild');
910
				}
911 View Code Duplication
			case '_CHR_GCH2':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
912
				switch ($sex) {
913
					case 'M':
914
						return I18N::translateContext('son’s son', 'Christening of a grandson');
915
					case 'F':
916
						return I18N::translateContext('son’s daughter', 'Christening of a granddaughter');
917
					default:
918
						return I18N::translate('Christening of a grandchild');
919
				}
920 View Code Duplication
			case '_CHR_HSIB':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
921
				switch ($sex) {
922
					case 'M':
923
						return I18N::translate('Christening of a half-brother');
924
					case 'F':
925
						return I18N::translate('Christening of a half-sister');
926
					default:
927
						return I18N::translate('Christening of a half-sibling');
928
				}
929 View Code Duplication
			case '_CHR_SIBL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
930
				switch ($sex) {
931
					case 'M':
932
						return I18N::translate('Christening of a brother');
933
					case 'F':
934
						return I18N::translate('Christening of a sister');
935
					default:
936
						return I18N::translate('Christening of a sibling');
937
				}
938
			case '_COML':
939
				return /* I18N: gedcom tag _COML */ I18N::translate('Common law marriage');
940 View Code Duplication
			case '_CREM_CHIL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
941
				switch ($sex) {
942
					case 'M':
943
						return I18N::translate('Cremation of a son');
944
					case 'F':
945
						return I18N::translate('Cremation of a daughter');
946
					default:
947
						return I18N::translate('Cremation of a child');
948
				}
949 View Code Duplication
			case '_CREM_GCHI':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
950
				switch ($sex) {
951
					case 'M':
952
						return I18N::translate('Cremation of a grandson');
953
					case 'F':
954
						return I18N::translate('Cremation of a granddaughter');
955
					default:
956
						return I18N::translate('Cremation of a grandchild');
957
				}
958 View Code Duplication
			case '_CREM_GCH1':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
959
				switch ($sex) {
960
					case 'M':
961
						return I18N::translateContext('daughter’s son', 'Cremation of a grandson');
962
					case 'F':
963
						return I18N::translateContext('daughter’s daughter', 'Cremation of a granddaughter');
964
					default:
965
						return I18N::translate('Cremation of a grandchild');
966
				}
967 View Code Duplication
			case '_CREM_GCH2':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
968
				switch ($sex) {
969
					case 'M':
970
						return I18N::translateContext('son’s son', 'Cremation of a grandson');
971
					case 'F':
972
						return I18N::translateContext('son’s daughter', 'Cremation of a granddaughter');
973
					default:
974
						return I18N::translate('Cremation of a grandchild');
975
				}
976 View Code Duplication
			case '_CREM_GPAR':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
977
				switch ($sex) {
978
					case 'M':
979
						return I18N::translate('Cremation of a grandfather');
980
					case 'F':
981
						return I18N::translate('Cremation of a grandmother');
982
					default:
983
						return I18N::translate('Cremation of a grand-parent');
984
				}
985 View Code Duplication
			case '_CREM_GPA1':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
986
				switch ($sex) {
987
					case 'M':
988
						return I18N::translate('Cremation of a paternal grandfather');
989
					case 'F':
990
						return I18N::translate('Cremation of a paternal grandmother');
991
					default:
992
						return I18N::translate('Cremation of a grand-parent');
993
				}
994 View Code Duplication
			case '_CREM_GPA2':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
995
				switch ($sex) {
996
					case 'M':
997
						return I18N::translate('Cremation of a maternal grandfather');
998
					case 'F':
999
						return I18N::translate('Cremation of a maternal grandmother');
1000
					default:
1001
						return I18N::translate('Cremation of a grand-parent');
1002
				}
1003 View Code Duplication
			case '_CREM_HSIB':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1004
				switch ($sex) {
1005
					case 'M':
1006
						return I18N::translate('Cremation of a half-brother');
1007
					case 'F':
1008
						return I18N::translate('Cremation of a half-sister');
1009
					default:
1010
						return I18N::translate('Cremation of a half-sibling');
1011
				}
1012 View Code Duplication
			case '_CREM_PARE':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1013
				switch ($sex) {
1014
					case 'M':
1015
						return I18N::translate('Cremation of a father');
1016
					case 'F':
1017
						return I18N::translate('Cremation of a mother');
1018
					default:
1019
						return I18N::translate('Cremation of a parent');
1020
				}
1021 View Code Duplication
			case '_CREM_SIBL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1022
				switch ($sex) {
1023
					case 'M':
1024
						return I18N::translate('Cremation of a brother');
1025
					case 'F':
1026
						return I18N::translate('Cremation of a sister');
1027
					default:
1028
						return I18N::translate('Cremation of a sibling');
1029
				}
1030 View Code Duplication
			case '_CREM_SPOU':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1031
				switch ($sex) {
1032
					case 'M':
1033
						return I18N::translate('Cremation of a husband');
1034
					case 'F':
1035
						return I18N::translate('Cremation of a wife');
1036
					default:
1037
						return I18N::translate('Cremation of a spouse');
1038
				}
1039
			case '_DBID':
1040
				return /* I18N: gedcom tag _DBID */ I18N::translate('Linked database ID');
1041 View Code Duplication
			case '_DEAT_CHIL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1042
				switch ($sex) {
1043
					case 'M':
1044
						return I18N::translate('Death of a son');
1045
					case 'F':
1046
						return I18N::translate('Death of a daughter');
1047
					default:
1048
						return I18N::translate('Death of a child');
1049
				}
1050 View Code Duplication
			case '_DEAT_GCHI':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1051
				switch ($sex) {
1052
					case 'M':
1053
						return I18N::translate('Death of a grandson');
1054
					case 'F':
1055
						return I18N::translate('Death of a granddaughter');
1056
					default:
1057
						return I18N::translate('Death of a grandchild');
1058
				}
1059 View Code Duplication
			case '_DEAT_GCH1':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1060
				switch ($sex) {
1061
					case 'M':
1062
						return I18N::translateContext('daughter’s son', 'Death of a grandson');
1063
					case 'F':
1064
						return I18N::translateContext('daughter’s daughter', 'Death of a granddaughter');
1065
					default:
1066
						return I18N::translate('Death of a grandchild');
1067
				}
1068 View Code Duplication
			case '_DEAT_GCH2':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1069
				switch ($sex) {
1070
					case 'M':
1071
						return I18N::translateContext('son’s son', 'Death of a grandson');
1072
					case 'F':
1073
						return I18N::translateContext('son’s daughter', 'Death of a granddaughter');
1074
					default:
1075
						return I18N::translate('Death of a grandchild');
1076
				}
1077 View Code Duplication
			case '_DEAT_GPAR':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1078
				switch ($sex) {
1079
					case 'M':
1080
						return I18N::translate('Death of a grandfather');
1081
					case 'F':
1082
						return I18N::translate('Death of a grandmother');
1083
					default:
1084
						return I18N::translate('Death of a grand-parent');
1085
				}
1086 View Code Duplication
			case '_DEAT_GPA1':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1087
				switch ($sex) {
1088
					case 'M':
1089
						return I18N::translate('Death of a paternal grandfather');
1090
					case 'F':
1091
						return I18N::translate('Death of a paternal grandmother');
1092
					default:
1093
						return I18N::translate('Death of a grand-parent');
1094
				}
1095 View Code Duplication
			case '_DEAT_GPA2':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1096
				switch ($sex) {
1097
					case 'M':
1098
						return I18N::translate('Death of a maternal grandfather');
1099
					case 'F':
1100
						return I18N::translate('Death of a maternal grandmother');
1101
					default:
1102
						return I18N::translate('Death of a grand-parent');
1103
				}
1104 View Code Duplication
			case '_DEAT_HSIB':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1105
				switch ($sex) {
1106
					case 'M':
1107
						return I18N::translate('Death of a half-brother');
1108
					case 'F':
1109
						return I18N::translate('Death of a half-sister');
1110
					default:
1111
						return I18N::translate('Death of a half-sibling');
1112
				}
1113 View Code Duplication
			case '_DEAT_PARE':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1114
				switch ($sex) {
1115
					case 'M':
1116
						return I18N::translate('Death of a father');
1117
					case 'F':
1118
						return I18N::translate('Death of a mother');
1119
					default:
1120
						return I18N::translate('Death of a parent');
1121
				}
1122 View Code Duplication
			case '_DEAT_SIBL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1123
				switch ($sex) {
1124
					case 'M':
1125
						return I18N::translate('Death of a brother');
1126
					case 'F':
1127
						return I18N::translate('Death of a sister');
1128
					default:
1129
						return I18N::translate('Death of a sibling');
1130
				}
1131 View Code Duplication
			case '_DEAT_SPOU':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1132
				switch ($sex) {
1133
					case 'M':
1134
						return I18N::translate('Death of a husband');
1135
					case 'F':
1136
						return I18N::translate('Death of a wife');
1137
					default:
1138
						return I18N::translate('Death of a spouse');
1139
				}
1140
			case '_DEG':
1141
				return /* I18N: gedcom tag _DEG */ I18N::translate('Degree');
1142
			case '_DETS':
1143
				return /* I18N: gedcom tag _DETS */ I18N::translate('Death of one spouse');
1144
			case '_DNA':
1145
				return /* I18N: gedcom tag _DNA (from FTM 2010) */ I18N::translate('DNA markers');
1146
			case '_EMAIL':
1147
				return /* I18N: gedcom tag _EMAIL */ I18N::translate('Email address');
1148
			case '_EYEC':
1149
				return /* I18N: gedcom tag _EYEC */ I18N::translate('Eye color');
1150
			case '_FA1':
1151
				return I18N::translate('Fact 1');
1152
			case '_FA2':
1153
				return I18N::translate('Fact 2');
1154
			case '_FA3':
1155
				return I18N::translate('Fact 3');
1156
			case '_FA4':
1157
				return I18N::translate('Fact 4');
1158
			case '_FA5':
1159
				return I18N::translate('Fact 5');
1160
			case '_FA6':
1161
				return I18N::translate('Fact 6');
1162
			case '_FA7':
1163
				return I18N::translate('Fact 7');
1164
			case '_FA8':
1165
				return I18N::translate('Fact 8');
1166
			case '_FA9':
1167
				return I18N::translate('Fact 9');
1168
			case '_FA10':
1169
				return I18N::translate('Fact 10');
1170
			case '_FA11':
1171
				return I18N::translate('Fact 11');
1172
			case '_FA12':
1173
				return I18N::translate('Fact 12');
1174
			case '_FA13':
1175
				return I18N::translate('Fact 13');
1176
			case '_FNRL':
1177
				return /* I18N: gedcom tag _FNRL */ I18N::translate('Funeral');
1178
			case '_FREL':
1179
				return /* I18N: gedcom tag _FREL */ I18N::translate('Relationship to father');
1180
			case '_GEDF':
1181
				return /* I18N: gedcom tag _GEDF */ I18N::translate('GEDCOM file');
1182
			case '_GODP':
1183
				return /* I18N: gedcom tag _GODP */ I18N::translate('Godparent');
1184
			case '_HAIR':
1185
				return /* I18N: gedcom tag _HAIR */ I18N::translate('Hair color');
1186
			case '_HEB':
1187
				return /* I18N: gedcom tag _HEB */ I18N::translate('Hebrew');
1188
			case '_HEIG':
1189
				return /* I18N: gedcom tag _HEIG */ I18N::translate('Height');
1190
			case '_HNM':
1191
				return /* I18N: gedcom tag _HNM */ I18N::translate('Hebrew name');
1192
			case '_HOL':
1193
				return /* I18N: gedcom tag _HOL */ I18N::translate('Holocaust');
1194
			case '_INTE':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1195
				switch ($sex) {
1196
					case 'M':
1197
						return /* I18N: gedcom tag _INTE */ I18N::translateContext('MALE', 'Interred');
1198
					case 'F':
1199
						return /* I18N: gedcom tag _INTE */ I18N::translateContext('FEMALE', 'Interred');
1200
					default:
1201
						return /* I18N: gedcom tag _INTE */ I18N::translate('Interred');
1202
				}
1203
			case '_LOC':
1204
				return /* I18N: gedcom tag _LOC */ I18N::translate('Location');
1205
			case '_MARI':
1206
				return /* I18N: gedcom tag _MARI */ I18N::translate('Marriage intention');
1207
			case '_MARNM':
1208
				return /* I18N: gedcom tag _MARNM */ I18N::translate('Married name');
1209
			case '_PRIM':
1210
				return /* I18N: gedcom tag _PRIM */ I18N::translate('Highlighted image');
1211
			case '_MARNM_SURN':
1212
				return I18N::translate('Married surname');
1213 View Code Duplication
			case '_MARR_CHIL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1214
				switch ($sex) {
1215
					case 'M':
1216
						return I18N::translate('Marriage of a son');
1217
					case 'F':
1218
						return I18N::translate('Marriage of a daughter');
1219
					default:
1220
						return I18N::translate('Marriage of a child');
1221
				}
1222
			case '_MARR_FAMC':
1223
				return /* I18N: ...to each other */ I18N::translate('Marriage of parents');
1224 View Code Duplication
			case '_MARR_GCHI':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1225
				switch ($sex) {
1226
					case 'M':
1227
						return I18N::translate('Marriage of a grandson');
1228
					case 'F':
1229
						return I18N::translate('Marriage of a granddaughter');
1230
					default:
1231
						return I18N::translate('Marriage of a grandchild');
1232
				}
1233 View Code Duplication
			case '_MARR_GCH1':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1234
				switch ($sex) {
1235
					case 'M':
1236
						return I18N::translateContext('daughter’s son', 'Marriage of a grandson');
1237
					case 'F':
1238
						return I18N::translateContext('daughter’s daughter', 'Marriage of a granddaughter');
1239
					default:
1240
						return I18N::translate('Marriage of a grandchild');
1241
				}
1242 View Code Duplication
			case '_MARR_GCH2':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1243
				switch ($sex) {
1244
					case 'M':
1245
						return I18N::translateContext('son’s son', 'Marriage of a grandson');
1246
					case 'F':
1247
						return I18N::translateContext('son’s daughter', 'Marriage of a granddaughter');
1248
					default:
1249
						return I18N::translate('Marriage of a grandchild');
1250
				}
1251 View Code Duplication
			case '_MARR_HSIB':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1252
				switch ($sex) {
1253
					case 'M':
1254
						return I18N::translate('Marriage of a half-brother');
1255
					case 'F':
1256
						return I18N::translate('Marriage of a half-sister');
1257
					default:
1258
						return I18N::translate('Marriage of a half-sibling');
1259
				}
1260 View Code Duplication
			case '_MARR_PARE':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1261
				switch ($sex) {
1262
					case 'M':
1263
						return /* I18N: ...to another spouse */ I18N::translate('Marriage of a father');
1264
					case 'F':
1265
						return /* I18N: ...to another spouse */ I18N::translate('Marriage of a mother');
1266
					default:
1267
						return /* I18N: ...to another spouse */ I18N::translate('Marriage of a parent');
1268
				}
1269 View Code Duplication
			case '_MARR_SIBL':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1270
				switch ($sex) {
1271
					case 'M':
1272
						return I18N::translate('Marriage of a brother');
1273
					case 'F':
1274
						return I18N::translate('Marriage of a sister');
1275
					default:
1276
						return I18N::translate('Marriage of a sibling');
1277
				}
1278
			case '_MBON':
1279
				return /* I18N: gedcom tag _MBON */ I18N::translate('Marriage bond');
1280
			case '_MDCL':
1281
				return /* I18N: gedcom tag _MDCL */ I18N::translate('Medical');
1282
			case '_MEDC':
1283
				return /* I18N: gedcom tag _MEDC */ I18N::translate('Medical condition');
1284
			case '_MEND':
1285
				return /* I18N: gedcom tag _MEND */ I18N::translate('Marriage ending status');
1286
			case '_MILI':
1287
				return /* I18N: gedcom tag _MILI */ I18N::translate('Military');
1288
			case '_MILT':
1289
				return /* I18N: gedcom tag _MILT */ I18N::translate('Military service');
1290
			case '_MREL':
1291
				return /* I18N: gedcom tag _MREL */ I18N::translate('Relationship to mother');
1292
			case '_MSTAT':
1293
				return /* I18N: gedcom tag _MSTAT */ I18N::translate('Marriage beginning status');
1294
			case '_NAME':
1295
				return /* I18N: gedcom tag _NAME */ I18N::translate('Mailing name');
1296
			case '_NAMS':
1297
				return /* I18N: gedcom tag _NAMS */ I18N::translate('Namesake');
1298
			case '_NLIV':
1299
				return /* I18N: gedcom tag _NLIV */ I18N::translate('Not living');
1300
			case '_NMAR':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1301
				switch ($sex) {
1302
					case 'M':
1303
						return /* I18N: gedcom tag _NMAR */ I18N::translateContext('MALE', 'Never married');
1304
					case 'F':
1305
						return /* I18N: gedcom tag _NMAR */ I18N::translateContext('FEMALE', 'Never married');
1306
					default:
1307
						return /* I18N: gedcom tag _NMAR */ I18N::translate('Never married');
1308
				}
1309 View Code Duplication
			case '_NMR':
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1310
				switch ($sex) {
1311
					case 'M':
1312
						return /* I18N: gedcom tag _NMR */ I18N::translateContext('MALE', 'Not married');
1313
					case 'F':
1314
						return /* I18N: gedcom tag _NMR */ I18N::translateContext('FEMALE', 'Not married');
1315
					default:
1316
						return /* I18N: gedcom tag _NMR */ I18N::translate('Not married');
1317
				}
1318
			case '_PHOTO': // Family Tree Builder uses "0 _ALBUM/1_PHOTO"
1319
				return I18N::translate('Photo');
1320
			case '_WT_USER':
1321
				return I18N::translate('by');
1322
			case '_PRMN':
1323
				return /* I18N: gedcom tag _PRMN */ I18N::translate('Permanent number');
1324 View Code Duplication
			case '_RNAME': // Family Tree Builder user "1 NAME / 2 _RNAME"
0 ignored issues
show
Coding Style introduced by
There must be a comment when fall-through is intentional in a non-empty case body
Loading history...
1325
				switch ($sex) {
1326
					case 'M':
1327
						return I18N::translateContext('MALE', 'Religious name');
1328
					case 'F':
1329
						return I18N::translateContext('FEMALE', 'Religious name');
1330
					default:
1331
						return I18N::translate('Religious name');
1332
				}
1333
			case '_SCBK':
1334
				return /* I18N: gedcom tag _SCBK */ I18N::translate('Scrapbook');
1335
			case '_SEPR':
1336
				return /* I18N: gedcom tag _SEPR */ I18N::translate('Separated');
1337
			case '_SSHOW':
1338
				return /* I18N: gedcom tag _SSHOW */ I18N::translate('Slide show');
1339
			case '_STAT':
1340
				return /* I18N: gedcom tag _STAT */ I18N::translate('Marriage status');
1341
			case '_SUBQ':
1342
				return /* I18N: gedcom tag _SUBQ */ I18N::translate('Short version');
1343
			case '_TODO':
1344
				return /* I18N: gedcom tag _TODO */ I18N::translate('Research task');
1345
			case '_TYPE':
1346
				return /* I18N: gedcom tag _TYPE */ I18N::translate('Media type');
1347
			case '_UID':
1348
				return /* I18N: gedcom tag _UID */ I18N::translate('Unique identifier');
1349
			case '_URL':
1350
				return /* I18N: gedcom tag _URL */ I18N::translate('URL');
1351
			case '_WEIG':
1352
				return /* I18N: gedcom tag _WEIG */ I18N::translate('Weight');
1353
			case '_WITN':
1354
				return /* I18N: gedcom tag _WITN */ I18N::translate('Witness');
1355
			case '_WT_OBJE_SORT':
1356
				return /* I18N: gedcom tag _WT_OBJE_SORT */ I18N::translate('Re-order media');
1357
			case '_YART':
1358
				return /* I18N: gedcom tag _YART - A yahrzeit is a special anniversary of death in the Hebrew faith/calendar. */ I18N::translate('Yahrzeit');
1359
				// Brit milah applies only to males, no need for male/female translations
1360
			case '__BRTM_CHIL':
1361
				return I18N::translate('Brit milah of a son');
1362
			case '__BRTM_GCHI':
1363
				return I18N::translate('Brit milah of a grandson');
1364
			case '__BRTM_GCH1':
1365
				return I18N::translateContext('daughter’s son', 'Brit milah of a grandson');
1366
			case '__BRTM_GCH2':
1367
				return I18N::translateContext('son’s son', 'Brit milah of a grandson');
1368
			case '__BRTM_HSIB':
1369
				return I18N::translate('Brit milah of a half-brother');
1370
			case '__BRTM_SIBL':
1371
				return I18N::translate('Brit milah of a brother');
1372
			case '_FILESIZE': // Family Tree Builder uses OBJE:_FILESIZE
1373
			case '__FILE_SIZE__': // This pseudo-tag is generated internally to present information about a media object
1374
				return I18N::translate('File size');
1375
			case '__IMAGE_SIZE__': // This pseudo-tag is generated internally to present information about a media object
1376
				return I18N::translate('Image dimensions');
1377
			default:
1378
				// If no specialisation exists (e.g. DEAT:CAUS), then look for the general (CAUS)
1379
				if (strpos($tag, ':')) {
1380
					list(, $tag) = explode(':', $tag, 2);
1381
1382
					return self::getLabel($tag, $record);
1383
				}
1384
1385
				// Still no translation? Highlight this as an error
1386
				return '<span class="error" title="' . I18N::translate('Unrecognized GEDCOM code') . '">' . Html::escape($tag) . '</span>';
1387
		}
1388
	}
1389
1390
	/**
1391
	 * Translate a label/value pair, such as “Occupation: Farmer”
1392
	 *
1393
	 * @param string            $tag
1394
	 * @param string            $value
1395
	 * @param GedcomRecord|null $record
1396
	 * @param string|null       $element
1397
	 *
1398
	 * @return string
1399
	 */
1400
	public static function getLabelValue($tag, $value, GedcomRecord $record = null, $element = 'div') {
1401
		return
1402
			'<' . $element . ' class="fact_' . $tag . '">' .
1403
			/* I18N: a label/value pair, such as “Occupation: Farmer”. Some languages may need to change the punctuation. */
1404
			I18N::translate('<span class="label">%1$s:</span> <span class="field" dir="auto">%2$s</span>', self::getLabel($tag, $record), $value) .
1405
			'</' . $element . '>';
1406
	}
1407
1408
	/**
1409
	 * Get a list of facts, for use in the "fact picker" edit control
1410
	 *
1411
	 * @param string $fact_type
1412
	 *
1413
	 * @return string[]
1414
	 */
1415
	public static function getPicklistFacts($fact_type) {
1416
		switch ($fact_type) {
1417
			case 'INDI':
1418
				$tags = [
1419
					// Facts, attributes for individuals (no links to FAMs)
1420
					'RESN', 'NAME', 'SEX', 'BIRT', 'CHR', 'DEAT', 'BURI', 'CREM',
1421
					'ADOP', 'BAPM', 'BARM', 'BASM', 'BLES', 'CHRA', 'CONF', 'FCOM', 'ORDN',
1422
					'NATU', 'EMIG', 'IMMI', 'CENS', 'PROB', 'WILL', 'GRAD', 'RETI', 'EVEN',
1423
					'CAST', 'DSCR', 'EDUC', 'IDNO', 'NATI', 'NCHI', 'NMR',
1424
					'OCCU', 'PROP', 'RELI', 'RESI', 'SSN', 'TITL', 'FACT',
1425
					'BAPL', 'CONL', 'ENDL', 'SLGC',
1426
					'SUBM', 'ASSO', 'ALIA', 'ANCI', 'DESI', 'RFN', 'AFN',
1427
					'REFN', 'RIN', 'CHAN', 'NOTE', 'SHARED_NOTE', 'SOUR', 'OBJE',
1428
					// non standard tags
1429
					'_BRTM', '_DEG', '_DNA', '_EYEC', '_FNRL', '_HAIR', '_HEIG', '_HNM',
1430
					'_HOL', '_INTE', '_MDCL', '_MEDC', '_MILI', '_MILT', '_NAME', '_NAMS',
1431
					'_NLIV', '_NMAR', '_PRMN', '_TODO', '_UID', '_WEIG', '_YART',
1432
				];
1433
				break;
1434
			case 'FAM':
1435
				$tags = [
1436
					// Facts for families, left out HUSB, WIFE & CHIL links
1437
					'RESN', 'ANUL', 'CENS', 'DIV', 'DIVF', 'ENGA', 'MARB', 'MARC',
1438
					'MARR', 'MARL', 'MARS', 'RESI', 'EVEN', 'NCHI', 'SUBM', 'SLGS',
1439
					'REFN', 'RIN', 'CHAN', 'NOTE', 'SHARED_NOTE', 'SOUR', 'OBJE',
1440
					// non standard tags
1441
					'_NMR', 'MARR_CIVIL', 'MARR_RELIGIOUS', 'MARR_PARTNERS', 'MARR_UNKNOWN',
1442
					'_COML', '_MBON', '_MARI', '_SEPR', '_TODO',
1443
				];
1444
			break;
1445 View Code Duplication
			case 'SOUR':
1446
				$tags = [
1447
					// Facts for sources
1448
					'DATA', 'AUTH', 'TITL', 'ABBR', 'PUBL', 'TEXT', 'REPO', 'REFN', 'RIN',
1449
					'CHAN', 'NOTE', 'SHARED_NOTE', 'OBJE',
1450
					'RESN',
1451
				];
1452
				break;
1453 View Code Duplication
			case 'REPO':
1454
				$tags = [
1455
					// Facts for repositories
1456
					'NAME', 'ADDR', 'PHON', 'EMAIL', 'FAX', 'WWW',
1457
					'NOTE', 'SHARED_NOTE', 'REFN', 'RIN', 'CHAN',
1458
					'RESN',
1459
				];
1460
				break;
1461
			case 'PLAC':
1462
				$tags = [
1463
					// Facts for places
1464
					'FONE', 'ROMN',
1465
					// non standard tags
1466
					'_HEB',
1467
				];
1468
				break;
1469
			case 'NAME':
1470
				$tags = [
1471
					// Facts subordinate to NAME
1472
					'FONE', 'ROMN',
1473
					// non standard tags
1474
					'_HEB', '_AKA', '_MARNM',
1475
				];
1476
				break;
1477
			default:
1478
				$tags = [];
1479
				break;
1480
		}
1481
1482
		$facts = [];
1483
		foreach ($tags as $tag) {
1484
			$facts[$tag] = self::getLabel($tag, null);
1485
		}
1486
		uasort($facts, '\Fisharebest\Webtrees\I18N::strcasecmp');
1487
1488
		return $facts;
1489
	}
1490
1491
	/**
1492
	 * Translate the value for 1 FILE/2 FORM/3 TYPE
1493
	 *
1494
	 * @param string $type
1495
	 *
1496
	 * @return string
1497
	 */
1498
	public static function getFileFormTypeValue($type) {
1499
		switch (strtolower($type)) {
1500
			case 'audio':
1501
				return /* I18N: Type of media object */ I18N::translate('Audio');
1502
			case 'book':
1503
				return /* I18N: Type of media object */ I18N::translate('Book');
1504
			case 'card':
1505
				return /* I18N: Type of media object */ I18N::translate('Card');
1506
			case 'certificate':
1507
				return /* I18N: Type of media object */ I18N::translate('Certificate');
1508
			case 'coat':
1509
				return /* I18N: Type of media object */ I18N::translate('Coat of arms');
1510
			case 'document':
1511
				return /* I18N: Type of media object */ I18N::translate('Document');
1512
			case 'electronic':
1513
				return /* I18N: Type of media object */ I18N::translate('Electronic');
1514
			case 'fiche':
1515
				return /* I18N: Type of media object */ I18N::translate('Microfiche');
1516
			case 'film':
1517
				return /* I18N: Type of media object */ I18N::translate('Microfilm');
1518
			case 'magazine':
1519
				return /* I18N: Type of media object */ I18N::translate('Magazine');
1520
			case 'manuscript':
1521
				return /* I18N: Type of media object */ I18N::translate('Manuscript');
1522
			case 'map':
1523
				return /* I18N: Type of media object */ I18N::translate('Map');
1524
			case 'newspaper':
1525
				return /* I18N: Type of media object */ I18N::translate('Newspaper');
1526
			case 'photo':
1527
				return /* I18N: Type of media object */ I18N::translate('Photo');
1528
			case 'tombstone':
1529
				return /* I18N: Type of media object */ I18N::translate('Tombstone');
1530
			case 'video':
1531
				return /* I18N: Type of media object */ I18N::translate('Video');
1532
			case 'painting':
1533
				return /* I18N: Type of media object */ I18N::translate('Painting');
1534
			default:
1535
				return /* I18N: Type of media object */ I18N::translate('Other');
1536
		}
1537
	}
1538
1539
	/**
1540
	 * A list of all possible values for 1 FILE/2 FORM/3 TYPE
1541
	 *
1542
	 * @return string[]
1543
	 */
1544
	public static function getFileFormTypes() {
1545
		$values = [];
1546
		foreach (self::$OBJE_FILE_FORM_TYPE as $type) {
1547
			$values[$type] = self::getFileFormTypeValue($type);
1548
		}
1549
		uasort($values, '\Fisharebest\Webtrees\I18N::strcasecmp');
1550
1551
		return $values;
1552
	}
1553
1554
	/**
1555
	 * Generate a value for a new _UID field.
1556
	 * Instead of RFC4122-compatible UUIDs, generate ones that
1557
	 * are compatible with PAF, Legacy, RootsMagic, etc.
1558
	 * In these, the string is upper-cased, dashes are removed,
1559
	 * and a two-byte checksum is added.
1560
	 *
1561
	 * @return string
1562
	 */
1563
	public static function createUid() {
1564
		$uid = str_replace('-', '', Uuid::uuid4());
1565
1566
		$checksum_a = 0; // a sum of the bytes
1567
		$checksum_b = 0; // a sum of the incremental values of $checksum_a
1568
1569
		// Compute checksums
1570
		for ($i = 0; $i < 32; $i += 2) {
1571
			$checksum_a += hexdec(substr($uid, $i, 2));
1572
			$checksum_b += $checksum_a & 0xff;
1573
		}
1574
1575
		return strtoupper($uid . substr(dechex($checksum_a), -2) . substr(dechex($checksum_b), -2));
1576
	}
1577
}
1578