xref: /webtrees/app/Census/Census.php (revision 1270d2767576ed4a83917769b0ee3613e3b010bf)
1<?php
2
3/**
4 * webtrees: online genealogy
5 * Copyright (C) 2023 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 <https://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 array<CensusPlaceInterface>
31     */
32    public static function censusPlaces(string $locale): array
33    {
34        switch ($locale) {
35            case 'cs':
36                return [
37                    new CensusOfCzechRepublic(),
38                    new CensusOfSlovakia(),
39                    new CensusOfDenmark(),
40                    new CensusOfDeutschland(),
41                    new CensusOfEngland(),
42                    new CensusOfFrance(),
43                    new CensusOfScotland(),
44                    new CensusOfUnitedStates(),
45                    new CensusOfRhodeIsland(),
46                    new CensusOfWales(),
47                    new CensusOfCanada(),
48                ];
49
50            case 'da':
51                return [
52                    new CensusOfDenmark(),
53                    new CensusOfDeutschland(),
54                    new CensusOfCzechRepublic(),
55                    new CensusOfEngland(),
56                    new CensusOfFrance(),
57                    new CensusOfScotland(),
58                    new CensusOfSlovakia(),
59                    new CensusOfUnitedStates(),
60                    new CensusOfRhodeIsland(),
61                    new CensusOfWales(),
62                    new CensusOfCanada(),
63                ];
64
65            case 'de':
66                return [
67                    new CensusOfDeutschland(),
68                    new CensusOfCzechRepublic(),
69                    new CensusOfDenmark(),
70                    new CensusOfEngland(),
71                    new CensusOfFrance(),
72                    new CensusOfScotland(),
73                    new CensusOfSlovakia(),
74                    new CensusOfUnitedStates(),
75                    new CensusOfRhodeIsland(),
76                    new CensusOfWales(),
77                    new CensusOfCanada(),
78                ];
79
80            case 'en-AU':
81            case 'en-GB':
82                return [
83                    new CensusOfEngland(),
84                    new CensusOfScotland(),
85                    new CensusOfWales(),
86                    new CensusOfCanada(),
87                    new CensusOfUnitedStates(),
88                    new CensusOfRhodeIsland(),
89                    new CensusOfCzechRepublic(),
90                    new CensusOfDenmark(),
91                    new CensusOfDeutschland(),
92                    new CensusOfFrance(),
93                    new CensusOfSlovakia(),
94                ];
95
96            case 'en-US':
97                return [
98                    new CensusOfUnitedStates(),
99                    new CensusOfRhodeIsland(),
100                    new CensusOfCanada(),
101                    new CensusOfCzechRepublic(),
102                    new CensusOfDenmark(),
103                    new CensusOfDeutschland(),
104                    new CensusOfEngland(),
105                    new CensusOfFrance(),
106                    new CensusOfScotland(),
107                    new CensusOfSlovakia(),
108                    new CensusOfWales(),
109                ];
110
111            case 'fr':
112                return [
113                    new CensusOfFrance(),
114                    new CensusOfCanada(),
115                    new CensusOfCzechRepublic(),
116                    new CensusOfDenmark(),
117                    new CensusOfDeutschland(),
118                    new CensusOfEngland(),
119                    new CensusOfScotland(),
120                    new CensusOfSlovakia(),
121                    new CensusOfUnitedStates(),
122                    new CensusOfRhodeIsland(),
123                    new CensusOfWales(),
124                ];
125
126            case 'fr-CA':
127                return [
128                    new CensusOfCanada(),
129                    new CensusOfFrance(),
130                    new CensusOfCzechRepublic(),
131                    new CensusOfDenmark(),
132                    new CensusOfDeutschland(),
133                    new CensusOfEngland(),
134                    new CensusOfScotland(),
135                    new CensusOfSlovakia(),
136                    new CensusOfUnitedStates(),
137                    new CensusOfRhodeIsland(),
138                    new CensusOfWales(),
139                ];
140
141            case 'sk':
142                return [
143                    new CensusOfSlovakia(),
144                    new CensusOfCzechRepublic(),
145                    new CensusOfDenmark(),
146                    new CensusOfDeutschland(),
147                    new CensusOfEngland(),
148                    new CensusOfFrance(),
149                    new CensusOfScotland(),
150                    new CensusOfUnitedStates(),
151                    new CensusOfRhodeIsland(),
152                    new CensusOfWales(),
153                    new CensusOfCanada(),
154                ];
155
156            default:
157                return [
158                    new CensusOfUnitedStates(),
159                    new CensusOfRhodeIsland(),
160                    new CensusOfEngland(),
161                    new CensusOfScotland(),
162                    new CensusOfWales(),
163                    new CensusOfDeutschland(),
164                    new CensusOfFrance(),
165                    new CensusOfCzechRepublic(),
166                    new CensusOfSlovakia(),
167                    new CensusOfDenmark(),
168                    new CensusOfCanada(),
169                ];
170        }
171    }
172}
173