1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/webtrees_ynh.git synced 2024-09-03 18:26:37 +02:00
webtrees_ynh/sources/app/SurnameTradition.php

104 lines
4.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* webtrees: online genealogy
* Copyright (C) 2016 webtrees development team
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Fisharebest\Webtrees;
use Fisharebest\Webtrees\SurnameTradition\DefaultSurnameTradition;
use Fisharebest\Webtrees\SurnameTradition\IcelandicSurnameTradition;
use Fisharebest\Webtrees\SurnameTradition\LithuanianSurnameTradition;
use Fisharebest\Webtrees\SurnameTradition\MatrilinealSurnameTradition;
use Fisharebest\Webtrees\SurnameTradition\PaternalSurnameTradition;
use Fisharebest\Webtrees\SurnameTradition\PatrilinealSurnameTradition;
use Fisharebest\Webtrees\SurnameTradition\PolishSurnameTradition;
use Fisharebest\Webtrees\SurnameTradition\PortugueseSurnameTradition;
use Fisharebest\Webtrees\SurnameTradition\SpanishSurnameTradition;
use Fisharebest\Webtrees\SurnameTradition\SurnameTraditionInterface;
/**
*
*/
class SurnameTradition {
/**
* Create a surname tradition object for a given surname tradition name.
*
* @param string $name Internal name of the surname tradition
*
* @return SurnameTraditionInterface
*/
public static function create($name) {
switch ($name) {
case 'paternal':
return new PaternalSurnameTradition;
case 'patrilineal':
return new PatrilinealSurnameTradition;
case 'matrilineal':
return new MatrilinealSurnameTradition;
case 'portuguese':
return new PortugueseSurnameTradition;
case 'spanish':
return new SpanishSurnameTradition;
case 'polish':
return new PolishSurnameTradition;
case 'lithuanian':
return new LithuanianSurnameTradition;
case 'icelandic':
return new IcelandicSurnameTradition;
default:
return new DefaultSurnameTradition;
}
}
/**
* A list of known surname traditions, with their descriptions
*
* @return string[]
*/
public static function allDescriptions() {
return array(
'paternal' =>
I18N::translateContext('Surname tradition', 'paternal') .
' — ' . /* I18N: In the paternal surname tradition, ... */ I18N::translate('Children take their fathers surname.') .
' ' . /* I18N: In the paternal surname tradition, ... */ I18N::translate('Wives take their husbands surname.'),
/* I18N: A system where children take their fathers surname */ 'patrilineal' =>
I18N::translate('patrilineal') .
' — ' . /* I18N: In the patrilineal surname tradition, ... */ I18N::translate('Children take their fathers surname.'),
/* I18N: A system where children take their mothers surname */ 'matrilineal' =>
I18N::translate('matrilineal') .
' — ' . /* I18N: In the matrilineal surname tradition, ... */ I18N::translate('Children take their mothers surname.'),
'spanish' =>
I18N::translateContext('Surname tradition', 'Spanish') .
' — ' . /* I18N: In the Spanish surname tradition, ... */ I18N::translate('Children take one surname from the father and one surname from the mother.'),
'portuguese' =>
I18N::translateContext('Surname tradition', 'Portuguese') .
' — ' . /* I18N: In the Portuguese surname tradition, ... */ I18N::translate('Children take one surname from the mother and one surname from the father.'),
'icelandic' =>
I18N::translateContext('Surname tradition', 'Icelandic') .
' — ' . /* I18N: In the Icelandic surname tradition, ... */ I18N::translate('Children take a patronym instead of a surname.'),
'polish' =>
I18N::translateContext('Surname tradition', 'Polish') .
' — ' . /* I18N: In the Polish surname tradition, ... */ I18N::translate('Children take their fathers surname.') .
' ' . /* I18N: In the Polish surname tradition, ... */ I18N::translate('Wives take their husbands surname.') .
' ' . /* I18N: In the Polish surname tradition, ... */ I18N::translate('Surnames are inflected to indicate an individuals gender.'),
'lithuanian' =>
I18N::translateContext('Surname tradition', 'Lithuanian') .
' — ' . /* I18N: In the Lithuanian surname tradition, ... */ I18N::translate('Children take their fathers surname.') .
' ' . /* I18N: In the Lithuanian surname tradition, ... */ I18N::translate('Wives take their husbands surname.') .
' ' . /* I18N: In the Lithuanian surname tradition, ... */ I18N::translate('Surnames are inflected to indicate an individuals gender and marital status.'),
'none' =>
I18N::translateContext('Surname tradition', 'none'),
);
}
}