xref: /webtrees/app/Census/Census.php (revision 37f4d1f0a7a5610284a8bb3182a07ec4441c9fc7)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * Copyright (C) 2019 webtrees development team
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18declare(strict_types=1);
19
20namespace Fisharebest\Webtrees\Census;
21
22/**
23 * Definitions for a census
24 */
25class Census
26{
27    /**
28     * @param string $locale
29     *
30     * @return CensusPlaceInterface[]
31     */
32    public static function censusPlaces(string $locale): array
33    {
34        switch ($locale) {
35            case 'cs':
36                return [
37                    new CensusOfCzechRepublic(),
38                    new CensusOfDenmark(),
39                    new CensusOfDeutschland(),
40                    new CensusOfEngland(),
41                    new CensusOfFrance(),
42                    new CensusOfScotland(),
43                    new CensusOfUnitedStates(),
44                    new CensusOfWales(),
45                ];
46
47            case 'en-AU':
48            case 'en-GB':
49                return [
50                    new CensusOfEngland(),
51                    new CensusOfScotland(),
52                    new CensusOfWales(),
53                    new CensusOfUnitedStates(),
54                    new CensusOfCzechRepublic(),
55                    new CensusOfDenmark(),
56                    new CensusOfDeutschland(),
57                    new CensusOfFrance(),
58                ];
59
60            case 'en-US':
61                return [
62                    new CensusOfUnitedStates(),
63                    new CensusOfCzechRepublic(),
64                    new CensusOfDenmark(),
65                    new CensusOfDeutschland(),
66                    new CensusOfEngland(),
67                    new CensusOfFrance(),
68                    new CensusOfScotland(),
69                    new CensusOfWales(),
70                ];
71
72            case 'fr':
73            case 'fr-CA':
74                return [
75                    new CensusOfFrance(),
76                    new CensusOfCzechRepublic(),
77                    new CensusOfDenmark(),
78                    new CensusOfDeutschland(),
79                    new CensusOfEngland(),
80                    new CensusOfScotland(),
81                    new CensusOfUnitedStates(),
82                    new CensusOfWales(),
83                ];
84
85            case 'da':
86                return [
87                    new CensusOfDenmark(),
88                    new CensusOfDeutschland(),
89                    new CensusOfCzechRepublic(),
90                    new CensusOfEngland(),
91                    new CensusOfFrance(),
92                    new CensusOfScotland(),
93                    new CensusOfUnitedStates(),
94                    new CensusOfWales(),
95                ];
96
97            case 'de':
98                return [
99                    new CensusOfDeutschland(),
100                    new CensusOfCzechRepublic(),
101                    new CensusOfDenmark(),
102                    new CensusOfEngland(),
103                    new CensusOfFrance(),
104                    new CensusOfScotland(),
105                    new CensusOfUnitedStates(),
106                    new CensusOfWales(),
107                ];
108
109            default:
110                return [
111                    new CensusOfUnitedStates(),
112                    new CensusOfEngland(),
113                    new CensusOfScotland(),
114                    new CensusOfWales(),
115                    new CensusOfDeutschland(),
116                    new CensusOfFrance(),
117                    new CensusOfCzechRepublic(),
118                    new CensusOfDenmark(),
119                ];
120        }
121    }
122}
123