diff options
Diffstat (limited to 'app/SurnameTradition.php')
| -rw-r--r-- | app/SurnameTradition.php | 140 |
1 files changed, 79 insertions, 61 deletions
diff --git a/app/SurnameTradition.php b/app/SurnameTradition.php index 27f5d80a14..6e48f85fcb 100644 --- a/app/SurnameTradition.php +++ b/app/SurnameTradition.php @@ -29,66 +29,84 @@ 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; - } - } +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 [ - 'paternal' => I18N::translateContext('Surname tradition', 'paternal') . ' — ' . - /* I18N: In the paternal surname tradition, ... */ I18N::translate('Children take their father’s surname.') . ' ' . - /* I18N: In the paternal surname tradition, ... */ I18N::translate('Wives take their husband’s surname.'), - 'patrilineal ' => /* I18N: A system where children take their father’s surname */ I18N::translate('patrilineal') . ' — ' . - /* I18N: In the patrilineal surname tradition, ... */ I18N::translate('Children take their father’s surname.'), - 'matrilineal ' => /* I18N: A system where children take their mother’s surname */ I18N::translate('matrilineal') . ' — ' . - /* I18N: In the matrilineal surname tradition, ... */ I18N::translate('Children take their mother’s 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 father’s surname.') . ' ' . - /* I18N: In the Polish surname tradition, ... */ I18N::translate('Wives take their husband’s surname.') . ' ' . - /* I18N: In the Polish surname tradition, ... */ I18N::translate('Surnames are inflected to indicate an individual’s gender.'), - 'lithuanian' => I18N::translateContext('Surname tradition', 'Lithuanian') . ' — ' . - /* I18N: In the Lithuanian surname tradition, ... */ I18N::translate('Children take their father’s surname.') . ' ' . - /* I18N: In the Lithuanian surname tradition, ... */ I18N::translate('Wives take their husband’s surname.') . ' ' . - /* I18N: In the Lithuanian surname tradition, ... */ I18N::translate('Surnames are inflected to indicate an individual’s gender and marital status.'), - 'none' => I18N::translateContext('Surname tradition', 'none'), - ]; - } + /** + * A list of known surname traditions, with their descriptions + * + * @return string[] + */ + public static function allDescriptions() + { + return [ + 'paternal' => I18N::translateContext('Surname tradition', 'paternal') . ' — ' . + /* I18N: In the paternal surname tradition, ... */ + I18N::translate('Children take their father’s surname.') . ' ' . + /* I18N: In the paternal surname tradition, ... */ + I18N::translate('Wives take their husband’s surname.'), + 'patrilineal ' => /* I18N: A system where children take their father’s surname */ + I18N::translate('patrilineal') . ' — ' . + /* I18N: In the patrilineal surname tradition, ... */ + I18N::translate('Children take their father’s surname.'), + 'matrilineal ' => /* I18N: A system where children take their mother’s surname */ + I18N::translate('matrilineal') . ' — ' . + /* I18N: In the matrilineal surname tradition, ... */ + I18N::translate('Children take their mother’s 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 father’s surname.') . ' ' . + /* I18N: In the Polish surname tradition, ... */ + I18N::translate('Wives take their husband’s surname.') . ' ' . + /* I18N: In the Polish surname tradition, ... */ + I18N::translate('Surnames are inflected to indicate an individual’s gender.'), + 'lithuanian' => I18N::translateContext('Surname tradition', 'Lithuanian') . ' — ' . + /* I18N: In the Lithuanian surname tradition, ... */ + I18N::translate('Children take their father’s surname.') . ' ' . + /* I18N: In the Lithuanian surname tradition, ... */ + I18N::translate('Wives take their husband’s surname.') . ' ' . + /* I18N: In the Lithuanian surname tradition, ... */ + I18N::translate('Surnames are inflected to indicate an individual’s gender and marital status.'), + 'none' => I18N::translateContext('Surname tradition', 'none'), + ]; + } } |
