コード例 #1
0
ファイル: GedcomCodePedi.php プロジェクト: tronsmit/webtrees
 /**
  * Translate a code, for an optional record
  *
  * @param string            $type
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getValue($type, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'birth':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Birth');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Birth');
                 default:
                     return I18N::translateContext('Pedigree', 'Birth');
             }
         case 'adopted':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Adopted');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Adopted');
                 default:
                     return I18N::translateContext('Pedigree', 'Adopted');
             }
         case 'foster':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Foster');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Foster');
                 default:
                     return I18N::translateContext('Pedigree', 'Foster');
             }
         case 'sealing':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Sealing');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Sealing');
                 default:
                     return I18N::translateContext('Pedigree', 'Sealing');
             }
         case 'rada':
             // Not standard GEDCOM - a webtrees extension
             // This is an arabic word which does not exist in other languages.
             // So, it will not have any inflected forms.
             return I18N::translate('Rada');
         default:
             return $type;
     }
 }
コード例 #2
0
ファイル: GedcomCodeAdop.php プロジェクト: tunandras/webtrees
 /**
  * Translate a code, for an (optional) record
  *
  * @param string               $type
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getValue($type, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'BOTH':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by both parents');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by both parents');
                 default:
                     return I18N::translate('Adopted by both parents');
             }
         case 'HUSB':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by father');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by father');
                 default:
                     return I18N::translate('Adopted by father');
             }
         case 'WIFE':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by mother');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by mother');
                 default:
                     return I18N::translate('Adopted by mother');
             }
         default:
             return $type;
     }
 }
コード例 #3
0
ファイル: GedcomTag.php プロジェクト: tunandras/webtrees
 /**
  * Translate a tag, for an (optional) record
  *
  * @param string               $tag
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getLabel($tag, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($tag) {
         case 'ABBR':
             return I18N::translate('Abbreviation');
         case 'ADDR':
             return I18N::translate('Address');
         case 'ADR1':
             return I18N::translate('Address line 1');
         case 'ADR2':
             return I18N::translate('Address line 2');
         case 'ADOP':
             return I18N::translate('Adoption');
         case 'ADOP:DATE':
             return I18N::translate('Date of adoption');
         case 'ADOP:PLAC':
             return I18N::translate('Place of adoption');
         case 'AFN':
             return I18N::translate('Ancestral file number');
         case 'AGE':
             return I18N::translate('Age');
         case 'AGNC':
             return I18N::translate('Agency');
         case 'ALIA':
             return I18N::translate('Alias');
         case 'ANCE':
             return I18N::translate('Generations of ancestors');
         case 'ANCI':
             return I18N::translate('Ancestors interest');
         case 'ANUL':
             return I18N::translate('Annulment');
         case 'ASSO':
             return I18N::translate('Associate');
             /* see also _ASSO */
         /* see also _ASSO */
         case 'AUTH':
             return I18N::translate('Author');
         case 'BAPL':
             return I18N::translate('LDS baptism');
         case 'BAPL:DATE':
             return I18N::translate('Date of LDS baptism');
         case 'BAPL:PLAC':
             return I18N::translate('Place of LDS baptism');
         case 'BAPM':
             return I18N::translate('Baptism');
         case 'BAPM:DATE':
             return I18N::translate('Date of baptism');
         case 'BAPM:PLAC':
             return I18N::translate('Place of baptism');
         case 'BARM':
             return I18N::translate('Bar mitzvah');
         case 'BARM:DATE':
             return I18N::translate('Date of bar mitzvah');
         case 'BARM:PLAC':
             return I18N::translate('Place of bar mitzvah');
         case 'BASM':
             return I18N::translate('Bat mitzvah');
         case 'BASM:DATE':
             return I18N::translate('Date of bat mitzvah');
         case 'BASM:PLAC':
             return I18N::translate('Place of bat mitzvah');
         case 'BIRT':
             return I18N::translate('Birth');
         case 'BIRT:DATE':
             return I18N::translate('Date of birth');
         case 'BIRT:PLAC':
             return I18N::translate('Place of birth');
         case 'BLES':
             return I18N::translate('Blessing');
         case 'BLES:DATE':
             return I18N::translate('Date of blessing');
         case 'BLES:PLAC':
             return I18N::translate('Place of blessing');
         case 'BLOB':
             return I18N::translate('Binary data object');
         case 'BURI':
             return I18N::translate('Burial');
         case 'BURI:DATE':
             return I18N::translate('Date of burial');
         case 'BURI:PLAC':
             return I18N::translate('Place of burial');
         case 'CALN':
             return I18N::translate('Call number');
         case 'CAST':
             return I18N::translate('Caste');
         case 'CAUS':
             return I18N::translate('Cause');
         case 'CEME':
             return I18N::translate('Cemetery');
         case 'CENS':
             return I18N::translate('Census');
         case 'CENS:DATE':
             return I18N::translate('Census date');
         case 'CENS:PLAC':
             return I18N::translate('Census place');
         case 'CHAN':
             return I18N::translate('Last change');
         case 'CHAN:DATE':
             return I18N::translate('Date of last change');
         case 'CHAN:_WT_USER':
             return I18N::translate('Author of last change');
         case 'CHAR':
             return I18N::translate('Character set');
         case 'CHIL':
             return I18N::translate('Child');
         case 'CHR':
             return I18N::translate('Christening');
         case 'CHR:DATE':
             return I18N::translate('Date of christening');
         case 'CHR:PLAC':
             return I18N::translate('Place of christening');
         case 'CHRA':
             return I18N::translate('Adult christening');
         case 'CITN':
             return I18N::translate('Citizenship');
         case 'CITY':
             return I18N::translate('City');
         case 'COMM':
             return I18N::translate('Comment');
         case 'CONC':
             return I18N::translate('Concatenation');
         case 'CONT':
             return I18N::translate('Continued');
         case 'CONF':
             return I18N::translate('Confirmation');
         case 'CONF:DATE':
             return I18N::translate('Date of confirmation');
         case 'CONF:PLAC':
             return I18N::translate('Place of confirmation');
         case 'CONL':
             return I18N::translate('LDS confirmation');
         case 'COPR':
             return I18N::translate('Copyright');
         case 'CORP':
             return I18N::translate('Corporation');
         case 'CREM':
             return I18N::translate('Cremation');
         case 'CREM:DATE':
             return I18N::translate('Date of cremation');
         case 'CREM:PLAC':
             return I18N::translate('Place of cremation');
         case 'CTRY':
             return I18N::translate('Country');
         case 'DATA':
             return I18N::translate('Data');
         case 'DATA:DATE':
             return I18N::translate('Date of entry in original source');
         case 'DATE':
             return I18N::translate('Date');
         case 'DEAT':
             return I18N::translate('Death');
         case 'DEAT:CAUS':
             return I18N::translate('Cause of death');
         case 'DEAT:DATE':
             return I18N::translate('Date of death');
         case 'DEAT:PLAC':
             return I18N::translate('Place of death');
         case 'DESC':
             return I18N::translate('Descendants');
         case 'DESI':
             return I18N::translate('Descendants interest');
         case 'DEST':
             return I18N::translate('Destination');
         case 'DIV':
             return I18N::translate('Divorce');
         case 'DIVF':
             return I18N::translate('Divorce filed');
         case 'DSCR':
             return I18N::translate('Description');
         case 'EDUC':
             return I18N::translate('Education');
         case 'EDUC:AGNC':
             return I18N::translate('School or college');
         case 'EMAI':
             return I18N::translate('Email address');
         case 'EMAIL':
             return I18N::translate('Email address');
         case 'EMAL':
             return I18N::translate('Email address');
         case 'EMIG':
             return I18N::translate('Emigration');
         case 'EMIG:DATE':
             return I18N::translate('Date of emigration');
         case 'EMIG:PLAC':
             return I18N::translate('Place of emigration');
         case 'ENDL':
             return I18N::translate('LDS endowment');
         case 'ENDL:DATE':
             return I18N::translate('Date of LDS endowment');
         case 'ENDL:PLAC':
             return I18N::translate('Place of LDS endowment');
         case 'ENGA':
             return I18N::translate('Engagement');
         case 'ENGA:DATE':
             return I18N::translate('Date of engagement');
         case 'ENGA:PLAC':
             return I18N::translate('Place of engagement');
         case 'EVEN':
             return I18N::translate('Event');
         case 'EVEN:DATE':
             return I18N::translate('Date of event');
         case 'EVEN:PLAC':
             return I18N::translate('Place of event');
         case 'FACT':
             return I18N::translate('Fact');
         case 'FAM':
             return I18N::translate('Family');
         case 'FAMC':
             return I18N::translate('Family as a child');
         case 'FAMF':
             return I18N::translate('Family file');
         case 'FAMS':
             return I18N::translate('Family as a spouse');
         case 'FAMS:CENS:DATE':
             return I18N::translate('Spouse census date');
         case 'FAMS:CENS:PLAC':
             return I18N::translate('Spouse census place');
         case 'FAMS:DIV:DATE':
             return I18N::translate('Date of divorce');
         case 'FAMS:MARR:DATE':
             return I18N::translate('Date of marriage');
         case 'FAMS:MARR:PLAC':
             return I18N::translate('Place of marriage');
         case 'FAMS:NOTE':
             return I18N::translate('Spouse note');
         case 'FAMS:SLGS:DATE':
             return I18N::translate('Date of LDS spouse sealing');
         case 'FAMS:SLGS:PLAC':
             return I18N::translate('Place of LDS spouse sealing');
         case 'FAX':
             return I18N::translate('Fax');
         case 'FCOM':
             return I18N::translate('First communion');
         case 'FCOM:DATE':
             return I18N::translate('Date of first communion');
         case 'FCOM:PLAC':
             return I18N::translate('Place of first communion');
         case 'FILE':
             return I18N::translate('Filename');
         case 'FONE':
             return I18N::translate('Phonetic');
         case 'FORM':
             return I18N::translate('Format');
         case 'GEDC':
             return I18N::translate('GEDCOM file');
         case 'GIVN':
             return I18N::translate('Given names');
         case 'GRAD':
             return I18N::translate('Graduation');
         case 'HEAD':
             return I18N::translate('Header');
         case 'HUSB':
             return I18N::translate('Husband');
         case 'IDNO':
             return I18N::translate('Identification number');
         case 'IMMI':
             return I18N::translate('Immigration');
         case 'IMMI:DATE':
             return I18N::translate('Date of immigration');
         case 'IMMI:PLAC':
             return I18N::translate('Place of immigration');
         case 'INDI':
             return I18N::translate('Individual');
         case 'INFL':
             return I18N::translate('Infant');
         case 'LANG':
             return I18N::translate('Language');
         case 'LATI':
             return I18N::translate('Latitude');
         case 'LEGA':
             return I18N::translate('Legatee');
         case 'LONG':
             return I18N::translate('Longitude');
         case 'MAP':
             return I18N::translate('Map');
         case 'MARB':
             return I18N::translate('Marriage banns');
         case 'MARB:DATE':
             return I18N::translate('Date of marriage banns');
         case 'MARB:PLAC':
             return I18N::translate('Place of marriage banns');
         case 'MARC':
             return I18N::translate('Marriage contract');
         case 'MARL':
             return I18N::translate('Marriage license');
         case 'MARR':
             return I18N::translate('Marriage');
         case 'MARR:DATE':
             return I18N::translate('Date of marriage');
         case 'MARR:PLAC':
             return I18N::translate('Place of marriage');
         case 'MARR_CIVIL':
             return I18N::translate('Civil marriage');
         case 'MARR_PARTNERS':
             return I18N::translate('Registered partnership');
         case 'MARR_RELIGIOUS':
             return I18N::translate('Religious marriage');
         case 'MARR_UNKNOWN':
             return I18N::translate('Marriage type unknown');
         case 'MARS':
             return I18N::translate('Marriage settlement');
         case 'MEDI':
             return I18N::translate('Media type');
         case 'NAME':
             if ($record instanceof Repository) {
                 return I18N::translateContext('Repository', 'Name');
             } else {
                 return I18N::translate('Name');
             }
         case 'NAME:FONE':
             return I18N::translate('Phonetic name');
         case 'NAME:_HEB':
             return I18N::translate('Name in Hebrew');
         case 'NATI':
             return I18N::translate('Nationality');
         case 'NATU':
             return I18N::translate('Naturalization');
         case 'NATU:DATE':
             return I18N::translate('Date of naturalization');
         case 'NATU:PLAC':
             return I18N::translate('Place of naturalization');
         case 'NCHI':
             return I18N::translate('Number of children');
         case 'NICK':
             return I18N::translate('Nickname');
         case 'NMR':
             return I18N::translate('Number of marriages');
         case 'NOTE':
             return I18N::translate('Note');
         case 'NPFX':
             return I18N::translate('Name prefix');
         case 'NSFX':
             return I18N::translate('Name suffix');
         case 'OBJE':
             return I18N::translate('Media object');
         case 'OCCU':
             return I18N::translate('Occupation');
         case 'OCCU:AGNC':
             return I18N::translate('Employer');
         case 'ORDI':
             return I18N::translate('Ordinance');
         case 'ORDN':
             return I18N::translate('Ordination');
         case 'ORDN:AGNC':
             return I18N::translate('Religious institution');
         case 'ORDN:DATE':
             return I18N::translate('Date of ordination');
         case 'ORDN:PLAC':
             return I18N::translate('Place of ordination');
         case 'PAGE':
             return I18N::translate('Citation details');
         case 'PEDI':
             return I18N::translate('Relationship to parents');
         case 'PHON':
             return I18N::translate('Phone');
         case 'PLAC':
             return I18N::translate('Place');
         case 'PLAC:FONE':
             return I18N::translate('Phonetic place');
         case 'PLAC:ROMN':
             return I18N::translate('Romanized place');
         case 'PLAC:_HEB':
             return I18N::translate('Place in Hebrew');
         case 'POST':
             return I18N::translate('Postal code');
         case 'PROB':
             return I18N::translate('Probate');
         case 'PROP':
             return I18N::translate('Property');
         case 'PUBL':
             return I18N::translate('Publication');
         case 'QUAY':
             return I18N::translate('Quality of data');
         case 'REFN':
             return I18N::translate('Reference number');
         case 'RELA':
             return I18N::translate('Relationship');
         case 'RELI':
             return I18N::translate('Religion');
         case 'REPO':
             return I18N::translate('Repository');
         case 'RESI':
             return I18N::translate('Residence');
         case 'RESI:DATE':
             return I18N::translate('Date of residence');
         case 'RESI:PLAC':
             return I18N::translate('Place of residence');
         case 'RESN':
             return I18N::translate('Restriction');
         case 'RETI':
             return I18N::translate('Retirement');
         case 'RETI:AGNC':
             return I18N::translate('Employer');
         case 'RFN':
             return I18N::translate('Record file number');
         case 'RIN':
             return I18N::translate('Record ID number');
         case 'ROLE':
             return I18N::translate('Role');
         case 'ROMN':
             return I18N::translate('Romanized');
         case 'SERV':
             return I18N::translate('Remote server');
         case 'SEX':
             return I18N::translate('Gender');
         case 'SHARED_NOTE':
             return I18N::translate('Shared note');
         case 'SLGC':
             return I18N::translate('LDS child sealing');
         case 'SLGC:DATE':
             return I18N::translate('Date of LDS child sealing');
         case 'SLGC:PLAC':
             return I18N::translate('Place of LDS child sealing');
         case 'SLGS':
             return I18N::translate('LDS spouse sealing');
         case 'SOUR':
             return I18N::translate('Source');
         case 'SPFX':
             return I18N::translate('Surname prefix');
         case 'SSN':
             return I18N::translate('Social security number');
         case 'STAE':
             return I18N::translate('State');
         case 'STAT':
             return I18N::translate('Status');
         case 'STAT:DATE':
             return I18N::translate('Status change date');
         case 'SUBM':
             return I18N::translate('Submitter');
         case 'SUBN':
             return I18N::translate('Submission');
         case 'SURN':
             return I18N::translate('Surname');
         case 'TEMP':
             return I18N::translate('Temple');
         case 'TEXT':
             return I18N::translate('Text');
         case 'TIME':
             return I18N::translate('Time');
         case 'TITL':
             return I18N::translate('Title');
         case 'TITL:FONE':
             return I18N::translate('Phonetic title');
         case 'TITL:ROMN':
             return I18N::translate('Romanized title');
         case 'TITL:_HEB':
             return I18N::translate('Title in Hebrew');
         case 'TRLR':
             return I18N::translate('Trailer');
         case 'TYPE':
             return I18N::translate('Type');
         case 'URL':
             return I18N::translate('URL');
         case 'VERS':
             return I18N::translate('Version');
         case 'WIFE':
             return I18N::translate('Wife');
         case 'WILL':
             return I18N::translate('Will');
         case 'WWW':
             return I18N::translate('URL');
         case '_ADOP_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a son');
                 case 'F':
                     return I18N::translate('Adoption of a daughter');
                 default:
                     return I18N::translate('Adoption of a child');
             }
         case '_ADOP_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a grandson');
                 case 'F':
                     return I18N::translate('Adoption of a granddaughter');
                 default:
                     return I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Adoption of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Adoption of a granddaughter');
                 default:
                     return I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Adoption of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Adoption of a granddaughter');
                 default:
                     return I18N::translate('Adoption of a grandchild');
             }
         case '_ADOP_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a half-brother');
                 case 'F':
                     return I18N::translate('Adoption of a half-sister');
                 default:
                     return I18N::translate('Adoption of a half-sibling');
             }
         case '_ADOP_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Adoption of a brother');
                 case 'F':
                     return I18N::translate('Adoption of a sister');
                 default:
                     return I18N::translate('Adoption of a sibling');
             }
         case '_ADPF':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by father');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by father');
                 default:
                     return I18N::translate('Adopted by father');
             }
         case '_ADPM':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by mother');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by mother');
                 default:
                     return I18N::translate('Adopted by mother');
             }
         case '_AKA':
         case '_AKAN':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Also known as');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Also known as');
                 default:
                     return I18N::translate('Also known as');
             }
         case '_ASSO':
             return I18N::translate('Associate');
             /* see also ASSO */
         /* see also ASSO */
         case '_BAPM_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a son');
                 case 'F':
                     return I18N::translate('Baptism of a daughter');
                 default:
                     return I18N::translate('Baptism of a child');
             }
         case '_BAPM_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a grandson');
                 case 'F':
                     return I18N::translate('Baptism of a granddaughter');
                 default:
                     return I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Baptism of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Baptism of a granddaughter');
                 default:
                     return I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Baptism of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Baptism of a granddaughter');
                 default:
                     return I18N::translate('Baptism of a grandchild');
             }
         case '_BAPM_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a half-brother');
                 case 'F':
                     return I18N::translate('Baptism of a half-sister');
                 default:
                     return I18N::translate('Baptism of a half-sibling');
             }
         case '_BAPM_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Baptism of a brother');
                 case 'F':
                     return I18N::translate('Baptism of a sister');
                 default:
                     return I18N::translate('Baptism of a sibling');
             }
         case '_BIBL':
             return I18N::translate('Bibliography');
         case '_BIRT_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a son');
                 case 'F':
                     return I18N::translate('Birth of a daughter');
                 default:
                     return I18N::translate('Birth of a child');
             }
         case '_BIRT_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a grandson');
                 case 'F':
                     return I18N::translate('Birth of a granddaughter');
                 default:
                     return I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Birth of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Birth of a granddaughter');
                 default:
                     return I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Birth of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Birth of a granddaughter');
                 default:
                     return I18N::translate('Birth of a grandchild');
             }
         case '_BIRT_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a half-brother');
                 case 'F':
                     return I18N::translate('Birth of a half-sister');
                 default:
                     return I18N::translate('Birth of a half-sibling');
             }
         case '_BIRT_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Birth of a brother');
                 case 'F':
                     return I18N::translate('Birth of a sister');
                 default:
                     return I18N::translate('Birth of a sibling');
             }
         case '_BRTM':
             return I18N::translate('Brit milah');
         case '_BRTM:DATE':
             return I18N::translate('Date of brit milah');
         case '_BRTM:PLAC':
             return I18N::translate('Place of brit milah');
         case '_BURI_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a son');
                 case 'F':
                     return I18N::translate('Burial of a daughter');
                 default:
                     return I18N::translate('Burial of a child');
             }
         case '_BURI_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a grandson');
                 case 'F':
                     return I18N::translate('Burial of a granddaughter');
                 default:
                     return I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Burial of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Burial of a granddaughter');
                 default:
                     return I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Burial of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Burial of a granddaughter');
                 default:
                     return I18N::translate('Burial of a grandchild');
             }
         case '_BURI_GPAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a grandfather');
                 case 'F':
                     return I18N::translate('Burial of a grandmother');
                 default:
                     return I18N::translate('Burial of a grandparent');
             }
         case '_BURI_GPA1':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a paternal grandfather');
                 case 'F':
                     return I18N::translate('Burial of a paternal grandmother');
                 default:
                     return I18N::translate('Burial of a paternal grandparent');
             }
         case '_BURI_GPA2':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a maternal grandfather');
                 case 'F':
                     return I18N::translate('Burial of a maternal grandmother');
                 default:
                     return I18N::translate('Burial of a maternal grandparent');
             }
         case '_BURI_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a half-brother');
                 case 'F':
                     return I18N::translate('Burial of a half-sister');
                 default:
                     return I18N::translate('Burial of a half-sibling');
             }
         case '_BURI_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a father');
                 case 'F':
                     return I18N::translate('Burial of a mother');
                 default:
                     return I18N::translate('Burial of a parent');
             }
         case '_BURI_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a brother');
                 case 'F':
                     return I18N::translate('Burial of a sister');
                 default:
                     return I18N::translate('Burial of a sibling');
             }
         case '_BURI_SPOU':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Burial of a husband');
                 case 'F':
                     return I18N::translate('Burial of a wife');
                 default:
                     return I18N::translate('Burial of a spouse');
             }
         case '_CHR_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a son');
                 case 'F':
                     return I18N::translate('Christening of a daughter');
                 default:
                     return I18N::translate('Christening of a child');
             }
         case '_CHR_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a grandson');
                 case 'F':
                     return I18N::translate('Christening of a granddaughter');
                 default:
                     return I18N::translate('Christening of a grandchild');
             }
         case '_CHR_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Christening of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Christening of a granddaughter');
                 default:
                     return I18N::translate('Christening of a grandchild');
             }
         case '_CHR_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Christening of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Christening of a granddaughter');
                 default:
                     return I18N::translate('Christening of a grandchild');
             }
         case '_CHR_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a half-brother');
                 case 'F':
                     return I18N::translate('Christening of a half-sister');
                 default:
                     return I18N::translate('Christening of a half-sibling');
             }
         case '_CHR_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Christening of a brother');
                 case 'F':
                     return I18N::translate('Christening of a sister');
                 default:
                     return I18N::translate('Christening of a sibling');
             }
         case '_COML':
             return I18N::translate('Common law marriage');
         case '_CREM_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a son');
                 case 'F':
                     return I18N::translate('Cremation of a daughter');
                 default:
                     return I18N::translate('Cremation of a child');
             }
         case '_CREM_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a grandson');
                 case 'F':
                     return I18N::translate('Cremation of a granddaughter');
                 default:
                     return I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Cremation of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Cremation of a granddaughter');
                 default:
                     return I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Cremation of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Cremation of a granddaughter');
                 default:
                     return I18N::translate('Cremation of a grandchild');
             }
         case '_CREM_GPAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a grandfather');
                 case 'F':
                     return I18N::translate('Cremation of a grandmother');
                 default:
                     return I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_GPA1':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a paternal grandfather');
                 case 'F':
                     return I18N::translate('Cremation of a paternal grandmother');
                 default:
                     return I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_GPA2':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a maternal grandfather');
                 case 'F':
                     return I18N::translate('Cremation of a maternal grandmother');
                 default:
                     return I18N::translate('Cremation of a grand-parent');
             }
         case '_CREM_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a half-brother');
                 case 'F':
                     return I18N::translate('Cremation of a half-sister');
                 default:
                     return I18N::translate('Cremation of a half-sibling');
             }
         case '_CREM_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a father');
                 case 'F':
                     return I18N::translate('Cremation of a mother');
                 default:
                     return I18N::translate('Cremation of a parent');
             }
         case '_CREM_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a brother');
                 case 'F':
                     return I18N::translate('Cremation of a sister');
                 default:
                     return I18N::translate('Cremation of a sibling');
             }
         case '_CREM_SPOU':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Cremation of a husband');
                 case 'F':
                     return I18N::translate('Cremation of a wife');
                 default:
                     return I18N::translate('Cremation of a spouse');
             }
         case '_DBID':
             return I18N::translate('Linked database ID');
         case '_DEAT_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a son');
                 case 'F':
                     return I18N::translate('Death of a daughter');
                 default:
                     return I18N::translate('Death of a child');
             }
         case '_DEAT_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a grandson');
                 case 'F':
                     return I18N::translate('Death of a granddaughter');
                 default:
                     return I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Death of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Death of a granddaughter');
                 default:
                     return I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Death of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Death of a granddaughter');
                 default:
                     return I18N::translate('Death of a grandchild');
             }
         case '_DEAT_GPAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a grandfather');
                 case 'F':
                     return I18N::translate('Death of a grandmother');
                 default:
                     return I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_GPA1':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a paternal grandfather');
                 case 'F':
                     return I18N::translate('Death of a paternal grandmother');
                 default:
                     return I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_GPA2':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a maternal grandfather');
                 case 'F':
                     return I18N::translate('Death of a maternal grandmother');
                 default:
                     return I18N::translate('Death of a grand-parent');
             }
         case '_DEAT_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a half-brother');
                 case 'F':
                     return I18N::translate('Death of a half-sister');
                 default:
                     return I18N::translate('Death of a half-sibling');
             }
         case '_DEAT_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a father');
                 case 'F':
                     return I18N::translate('Death of a mother');
                 default:
                     return I18N::translate('Death of a parent');
             }
         case '_DEAT_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a brother');
                 case 'F':
                     return I18N::translate('Death of a sister');
                 default:
                     return I18N::translate('Death of a sibling');
             }
         case '_DEAT_SPOU':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Death of a husband');
                 case 'F':
                     return I18N::translate('Death of a wife');
                 default:
                     return I18N::translate('Death of a spouse');
             }
         case '_DEG':
             return I18N::translate('Degree');
         case '_DETS':
             return I18N::translate('Death of one spouse');
         case '_DNA':
             return I18N::translate('DNA markers');
         case '_EMAIL':
             return I18N::translate('Email address');
         case '_EYEC':
             return I18N::translate('Eye color');
         case '_FA1':
             return I18N::translate('Fact 1');
         case '_FA2':
             return I18N::translate('Fact 2');
         case '_FA3':
             return I18N::translate('Fact 3');
         case '_FA4':
             return I18N::translate('Fact 4');
         case '_FA5':
             return I18N::translate('Fact 5');
         case '_FA6':
             return I18N::translate('Fact 6');
         case '_FA7':
             return I18N::translate('Fact 7');
         case '_FA8':
             return I18N::translate('Fact 8');
         case '_FA9':
             return I18N::translate('Fact 9');
         case '_FA10':
             return I18N::translate('Fact 10');
         case '_FA11':
             return I18N::translate('Fact 11');
         case '_FA12':
             return I18N::translate('Fact 12');
         case '_FA13':
             return I18N::translate('Fact 13');
         case '_FNRL':
             return I18N::translate('Funeral');
         case '_FREL':
             return I18N::translate('Relationship to father');
         case '_GEDF':
             return I18N::translate('GEDCOM file');
         case '_GODP':
             return I18N::translate('Godparent');
         case '_HAIR':
             return I18N::translate('Hair color');
         case '_HEB':
             return I18N::translate('Hebrew');
         case '_HEIG':
             return I18N::translate('Height');
         case '_HNM':
             return I18N::translate('Hebrew name');
         case '_HOL':
             return I18N::translate('Holocaust');
         case '_INTE':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Interred');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Interred');
                 default:
                     return I18N::translate('Interred');
             }
         case '_LOC':
             return I18N::translate('Location');
         case '_MARI':
             return I18N::translate('Marriage intention');
         case '_MARNM':
             return I18N::translate('Married name');
         case '_PRIM':
             return I18N::translate('Highlighted image');
         case '_MARNM_SURN':
             return I18N::translate('Married surname');
         case '_MARR_CHIL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a son');
                 case 'F':
                     return I18N::translate('Marriage of a daughter');
                 default:
                     return I18N::translate('Marriage of a child');
             }
         case '_MARR_FAMC':
             return I18N::translate('Marriage of parents');
         case '_MARR_GCHI':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a grandson');
                 case 'F':
                     return I18N::translate('Marriage of a granddaughter');
                 default:
                     return I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_GCH1':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('daughter’s son', 'Marriage of a grandson');
                 case 'F':
                     return I18N::translateContext('daughter’s daughter', 'Marriage of a granddaughter');
                 default:
                     return I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_GCH2':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('son’s son', 'Marriage of a grandson');
                 case 'F':
                     return I18N::translateContext('son’s daughter', 'Marriage of a granddaughter');
                 default:
                     return I18N::translate('Marriage of a grandchild');
             }
         case '_MARR_HSIB':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a half-brother');
                 case 'F':
                     return I18N::translate('Marriage of a half-sister');
                 default:
                     return I18N::translate('Marriage of a half-sibling');
             }
         case '_MARR_PARE':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a father');
                 case 'F':
                     return I18N::translate('Marriage of a mother');
                 default:
                     return I18N::translate('Marriage of a parent');
             }
         case '_MARR_SIBL':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Marriage of a brother');
                 case 'F':
                     return I18N::translate('Marriage of a sister');
                 default:
                     return I18N::translate('Marriage of a sibling');
             }
         case '_MBON':
             return I18N::translate('Marriage bond');
         case '_MDCL':
             return I18N::translate('Medical');
         case '_MEDC':
             return I18N::translate('Medical condition');
         case '_MEND':
             return I18N::translate('Marriage ending status');
         case '_MILI':
             return I18N::translate('Military');
         case '_MILT':
             return I18N::translate('Military service');
         case '_MREL':
             return I18N::translate('Relationship to mother');
         case '_MSTAT':
             return I18N::translate('Marriage beginning status');
         case '_NAME':
             return I18N::translate('Mailing name');
         case '_NAMS':
             return I18N::translate('Namesake');
         case '_NLIV':
             return I18N::translate('Not living');
         case '_NMAR':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Never married');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Never married');
                 default:
                     return I18N::translate('Never married');
             }
         case '_NMR':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Not married');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Not married');
                 default:
                     return I18N::translate('Not married');
             }
         case '_WT_USER':
             return I18N::translate('by');
         case '_PRMN':
             return I18N::translate('Permanent number');
         case '_SCBK':
             return I18N::translate('Scrapbook');
         case '_SEPR':
             return I18N::translate('Separated');
         case '_SSHOW':
             return I18N::translate('Slide show');
         case '_STAT':
             return I18N::translate('Marriage status');
         case '_SUBQ':
             return I18N::translate('Short version');
         case '_TODO':
             return I18N::translate('Research task');
         case '_TYPE':
             return I18N::translate('Media type');
         case '_UID':
             return I18N::translate('Globally unique identifier');
         case '_URL':
             return I18N::translate('URL');
         case '_WEIG':
             return I18N::translate('Weight');
         case '_WITN':
             return I18N::translate('Witness');
         case '_WT_OBJE_SORT':
             return I18N::translate('Re-order media');
         case '_YART':
             return I18N::translate('Yahrzeit');
             // Brit milah applies only to males, no need for male/female translations
         // Brit milah applies only to males, no need for male/female translations
         case '__BRTM_CHIL':
             return I18N::translate('Brit milah of a son');
         case '__BRTM_GCHI':
             return I18N::translate('Brit milah of a grandson');
         case '__BRTM_GCH1':
             return I18N::translateContext('daughter’s son', 'Brit milah of a grandson');
         case '__BRTM_GCH2':
             return I18N::translateContext('son’s son', 'Brit milah of a grandson');
         case '__BRTM_HSIB':
             return I18N::translate('Brit milah of a half-brother');
         case '__BRTM_SIBL':
             return I18N::translate('Brit milah of a brother');
             // These "pseudo" tags are generated internally to present information about a media object
         // These "pseudo" tags are generated internally to present information about a media object
         case '__FILE_SIZE__':
             return I18N::translate('File size');
         case '__IMAGE_SIZE__':
             return I18N::translate('Image dimensions');
         default:
             // If no specialisation exists (e.g. DEAT:CAUS), then look for the general (CAUS)
             if (strpos($tag, ':')) {
                 list(, $tag) = explode(':', $tag, 2);
                 return self::getLabel($tag, $record);
             }
             // Still no translation? Highlight this as an error
             return '<span class="error" title="' . I18N::translate('Unrecognized GEDCOM code') . '">' . Filter::escapeHtml($tag) . '</span>';
     }
 }
コード例 #4
0
ファイル: GedcomCodeRela.php プロジェクト: tunandras/webtrees
 /**
  * Translate a code, for an (optional) record.
  * We need the record to translate the sex (godfather/godmother) but
  * we won’t have this when adding data for new individuals.
  *
  * @param string            $type
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getValue($type, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'attendant':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Attendant');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Attendant');
                 default:
                     return I18N::translate('Attendant');
             }
         case 'attending':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Attending');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Attending');
                 default:
                     return I18N::translate('Attending');
             }
         case 'best_man':
             // always male
             return I18N::translate('Best man');
         case 'bridesmaid':
             // always female
             return I18N::translate('Bridesmaid');
         case 'buyer':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Buyer');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Buyer');
                 default:
                     return I18N::translate('Buyer');
             }
         case 'circumciser':
             // always male
             return I18N::translate('Circumciser');
         case 'civil_registrar':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Civil registrar');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Civil registrar');
                 default:
                     return I18N::translate('Civil registrar');
             }
         case 'employee':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Employee');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Employee');
                 default:
                     return I18N::translate('Employee');
             }
         case 'employer':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Employer');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Employer');
                 default:
                     return I18N::translate('Employer');
             }
         case 'foster_child':
             // no sex implied
             return I18N::translate('Foster child');
         case 'foster_father':
             // always male
             return I18N::translate('Foster father');
         case 'foster_mother':
             // always female
             return I18N::translate('Foster mother');
         case 'friend':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Friend');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Friend');
                 default:
                     return I18N::translate('Friend');
             }
         case 'godfather':
             // always male
             return I18N::translate('Godfather');
         case 'godmother':
             // always female
             return I18N::translate('Godmother');
         case 'godparent':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Godfather');
                 case 'F':
                     return I18N::translate('Godmother');
                 default:
                     return I18N::translate('Godparent');
             }
         case 'godson':
             // always male
             return I18N::translate('Godson');
         case 'goddaughter':
             // always female
             return I18N::translate('Goddaughter');
         case 'godchild':
             switch ($sex) {
                 case 'M':
                     return I18N::translate('Godson');
                 case 'F':
                     return I18N::translate('Goddaughter');
                 default:
                     return I18N::translate('Godchild');
             }
         case 'guardian':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Guardian');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Guardian');
                 default:
                     return I18N::translate('Guardian');
             }
         case 'informant':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Informant');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Informant');
                 default:
                     return I18N::translate('Informant');
             }
         case 'lodger':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Lodger');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Lodger');
                 default:
                     return I18N::translate('Lodger');
             }
         case 'nanny':
             // no sex implied
             return I18N::translate('Nanny');
         case 'nurse':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Nurse');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Nurse');
                 default:
                     return I18N::translate('Nurse');
             }
         case 'owner':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Owner');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Owner');
                 default:
                     return I18N::translate('Owner');
             }
         case 'priest':
             // no sex implied
             return I18N::translate('Priest');
         case 'rabbi':
             // always male
             return I18N::translate('Rabbi');
         case 'registry_officer':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Registry officer');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Registry officer');
                 default:
                     return I18N::translate('Registry officer');
             }
         case 'seller':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Seller');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Seller');
                 default:
                     return I18N::translate('Seller');
             }
         case 'servant':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Servant');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Servant');
                 default:
                     return I18N::translate('Servant');
             }
         case 'slave':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Slave');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Slave');
                 default:
                     return I18N::translate('Slave');
             }
         case 'ward':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Ward');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Ward');
                 default:
                     return I18N::translate('Ward');
             }
         case 'witness':
             // Do we need separate male/female translations for this?
             return I18N::translate('Witness');
         default:
             return $type;
     }
 }
コード例 #5
0
ファイル: GedcomCodeName.php プロジェクト: tronsmit/webtrees
 /**
  * Translate a code, for an (optional) record
  *
  * @param string               $type
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getValue($type, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'adopted':
             switch ($sex) {
                 case 'M':
                     /* I18N: The name given to a child by its adoptive parents */
                     return I18N::translateContext('MALE', 'adopted name');
                 case 'F':
                     /* I18N: The name given to a child by its adoptive parents */
                     return I18N::translateContext('FEMALE', 'adopted name');
                 default:
                     /* I18N: The name given to a child by its adoptive parents */
                     return I18N::translate('adopted name');
             }
         case 'aka':
             switch ($sex) {
                 case 'M':
                     /* I18N: The name by which an individual is also known. e.g. a professional name or a stage name */
                     return I18N::translateContext('MALE', 'also known as');
                 case 'F':
                     /* I18N: The name by which an individual is also known. e.g. a professional name or a stage name */
                     return I18N::translateContext('FEMALE', 'also known as');
                 default:
                     /* I18N: The name by which an individual is also known. e.g. a professional name or a stage name */
                     return I18N::translate('also known as');
             }
         case 'birth':
             switch ($sex) {
                 case 'M':
                     /* I18N: The name given to an individual at their birth */
                     return I18N::translateContext('MALE', 'birth name');
                 case 'F':
                     /* I18N: The name given to an individual at their birth */
                     return I18N::translateContext('FEMALE', 'birth name');
                 default:
                     /* I18N: The name given to an individual at their birth */
                     return I18N::translate('birth name');
             }
         case 'change':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name chosen by an individual, to replace their existing name (whether legal or otherwise) */
                     return I18N::translateContext('MALE', 'change of name');
                 case 'F':
                     /* I18N: A name chosen by an individual, to replace their existing name (whether legal or otherwise) */
                     return I18N::translateContext('FEMALE', 'change of name');
                 default:
                     /* I18N: A name chosen by an individual, to replace their existing name (whether legal or otherwise) */
                     return I18N::translate('change of name');
             }
         case 'estate':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name given to an individual, from the farm or estate on which they lived or worked */
                     return I18N::translateContext('MALE', 'estate name');
                 case 'F':
                     /* I18N: A name given to an individual, from the farm or estate on which they lived or worked */
                     return I18N::translateContext('FEMALE', 'estate name');
                 default:
                     /* I18N: A name given to an individual, from the farm or estate on which they lived or worked */
                     return I18N::translate('estate name');
             }
         case 'immigrant':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name taken on immigration - e.g. migrants to the USA frequently anglicized their names */
                     return I18N::translateContext('MALE', 'immigration name');
                 case 'F':
                     /* I18N: A name taken on immigration - e.g. migrants to the USA frequently anglicized their names */
                     return I18N::translateContext('FEMALE', 'immigration name');
                 default:
                     /* I18N: A name taken on immigration - e.g. migrants to the USA frequently anglicized their names */
                     return I18N::translate('immigration name');
             }
         case 'maiden':
             // Only women have “maiden” names!
             return I18N::translate('maiden name');
         case 'married':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name taken on marriage - usually the wife takes the husband’s surname */
                     return I18N::translateContext('MALE', 'married name');
                 case 'F':
                     /* I18N: A name taken on marriage - usually the wife takes the husband’s surname */
                     return I18N::translateContext('FEMALE', 'married name');
                 default:
                     /* I18N: A name taken on marriage - usually the wife takes the husband’s surname */
                     return I18N::translate('married name');
             }
         case 'religious':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name taken when entering a religion or a religious order */
                     return I18N::translateContext('MALE', 'religious name');
                 case 'F':
                     /* I18N: A name taken when entering a religion or a religious order */
                     return I18N::translateContext('FEMALE', 'religious name');
                 default:
                     /* I18N: A name taken when entering a religion or a religious order */
                     return I18N::translate('religious name');
             }
         default:
             return $type;
     }
 }