xref: /webtrees/app/Census/Census.php (revision b72623fe90bc26fec6728adcea680bb1dca08618)
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 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                ];
47
48            case 'da':
49                return [
50                    new CensusOfDenmark(),
51                    new CensusOfDeutschland(),
52                    new CensusOfCzechRepublic(),
53                    new CensusOfEngland(),
54                    new CensusOfFrance(),
55                    new CensusOfScotland(),
56                    new CensusOfSlovakia(),
57                    new CensusOfUnitedStates(),
58                    new CensusOfWales(),
59                ];
60
61            case 'de':
62                return [
63                    new CensusOfDeutschland(),
64                    new CensusOfCzechRepublic(),
65                    new CensusOfDenmark(),
66                    new CensusOfEngland(),
67                    new CensusOfFrance(),
68                    new CensusOfScotland(),
69                    new CensusOfSlovakia(),
70                    new CensusOfUnitedStates(),
71                    new CensusOfWales(),
72                ];
73
74            case 'en-AU':
75            case 'en-GB':
76                return [
77                    new CensusOfEngland(),
78                    new CensusOfScotland(),
79                    new CensusOfWales(),
80                    new CensusOfUnitedStates(),
81                    new CensusOfCzechRepublic(),
82                    new CensusOfDenmark(),
83                    new CensusOfDeutschland(),
84                    new CensusOfFrance(),
85                    new CensusOfSlovakia(),
86                ];
87
88            case 'en-US':
89                return [
90                    new CensusOfUnitedStates(),
91                    new CensusOfCzechRepublic(),
92                    new CensusOfDenmark(),
93                    new CensusOfDeutschland(),
94                    new CensusOfEngland(),
95                    new CensusOfFrance(),
96                    new CensusOfScotland(),
97                    new CensusOfSlovakia(),
98                    new CensusOfWales(),
99                ];
100
101            case 'fr':
102            case 'fr-CA':
103                return [
104                    new CensusOfFrance(),
105                    new CensusOfCzechRepublic(),
106                    new CensusOfDenmark(),
107                    new CensusOfDeutschland(),
108                    new CensusOfEngland(),
109                    new CensusOfScotland(),
110                    new CensusOfSlovakia(),
111                    new CensusOfUnitedStates(),
112                    new CensusOfWales(),
113                ];
114
115            case 'sk':
116                return [
117                    new CensusOfSlovakia(),
118                    new CensusOfCzechRepublic(),
119                    new CensusOfDenmark(),
120                    new CensusOfDeutschland(),
121                    new CensusOfEngland(),
122                    new CensusOfFrance(),
123                    new CensusOfScotland(),
124                    new CensusOfUnitedStates(),
125                    new CensusOfWales(),
126                ];
127
128            default:
129                return [
130                    new CensusOfUnitedStates(),
131                    new CensusOfEngland(),
132                    new CensusOfScotland(),
133                    new CensusOfWales(),
134                    new CensusOfDeutschland(),
135                    new CensusOfFrance(),
136                    new CensusOfCzechRepublic(),
137                    new CensusOfSlovakia(),
138                    new CensusOfDenmark(),
139                ];
140        }
141    }
142}
143