xref: /webtrees/app/Census/Census.php (revision 81de533683c82a9e5c2bf2de336b47c4103fda6d)
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                break;
85
86            case 'da':
87                return [
88                    new CensusOfDenmark(),
89                    new CensusOfDeutschland(),
90                    new CensusOfCzechRepublic(),
91                    new CensusOfEngland(),
92                    new CensusOfFrance(),
93                    new CensusOfScotland(),
94                    new CensusOfUnitedStates(),
95                    new CensusOfWales(),
96                ];
97
98            case 'de':
99                return [
100                    new CensusOfDeutschland(),
101                    new CensusOfCzechRepublic(),
102                    new CensusOfDenmark(),
103                    new CensusOfEngland(),
104                    new CensusOfFrance(),
105                    new CensusOfScotland(),
106                    new CensusOfUnitedStates(),
107                    new CensusOfWales(),
108                ];
109
110            default:
111                return [
112                    new CensusOfUnitedStates(),
113                    new CensusOfEngland(),
114                    new CensusOfScotland(),
115                    new CensusOfWales(),
116                    new CensusOfDeutschland(),
117                    new CensusOfFrance(),
118                    new CensusOfCzechRepublic(),
119                    new CensusOfDenmark(),
120                ];
121        }
122    }
123}
124