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