|
17 | 17 | *******************************************************************************/ |
18 | 18 | package de.symeda.sormas.backend.common; |
19 | 19 |
|
20 | | -import java.util.Locale; |
21 | | -import java.util.Properties; |
22 | | - |
23 | | -import java.util.regex.Pattern; |
24 | | - |
25 | | -import javax.annotation.Resource; |
26 | | -import javax.ejb.LocalBean; |
27 | | -import javax.ejb.Stateless; |
28 | | - |
29 | | -import org.apache.commons.lang3.StringUtils; |
30 | | -import org.apache.commons.validator.routines.UrlValidator; |
31 | | -import org.slf4j.Logger; |
32 | | -import org.slf4j.LoggerFactory; |
33 | | - |
34 | 20 | import de.symeda.sormas.api.ConfigFacade; |
35 | 21 | import de.symeda.sormas.api.Language; |
36 | 22 | import de.symeda.sormas.api.person.PersonHelper; |
|
39 | 25 | import de.symeda.sormas.api.utils.DataHelper; |
40 | 26 | import de.symeda.sormas.api.utils.InfoProvider; |
41 | 27 | import de.symeda.sormas.api.utils.VersionHelper; |
| 28 | +import org.apache.commons.lang3.StringUtils; |
| 29 | +import org.apache.commons.validator.routines.UrlValidator; |
| 30 | +import org.slf4j.Logger; |
| 31 | +import org.slf4j.LoggerFactory; |
| 32 | + |
| 33 | +import javax.annotation.Resource; |
| 34 | +import javax.ejb.LocalBean; |
| 35 | +import javax.ejb.Stateless; |
| 36 | +import java.util.Locale; |
| 37 | +import java.util.Properties; |
| 38 | +import java.util.regex.Pattern; |
42 | 39 |
|
43 | 40 | /** |
44 | 41 | * Provides the application configuration settings |
@@ -171,21 +168,20 @@ static String normalizeLocaleString(String locale) { |
171 | 168 |
|
172 | 169 | @Override |
173 | 170 | public boolean isGermanServer() { |
174 | | - return getCountryLocale().startsWith("de"); |
| 171 | + if (Pattern.matches(FULL_COUNTRY_LOCALE_PATTERN, getCountryLocale())) { |
| 172 | + return getCountryLocale().toLowerCase().endsWith("de"); |
| 173 | + } else { |
| 174 | + return getCountryLocale().toLowerCase().startsWith("de"); |
| 175 | + } |
175 | 176 | } |
176 | 177 |
|
177 | 178 | @Override |
178 | 179 | public boolean isSwissServer() { |
179 | 180 | if (Pattern.matches(FULL_COUNTRY_LOCALE_PATTERN, getCountryLocale())) { |
180 | | - if (getCountryLocale().toLowerCase().endsWith("ch")) { |
181 | | - return true; |
182 | | - } |
| 181 | + return getCountryLocale().toLowerCase().endsWith("ch"); |
183 | 182 | } else { |
184 | | - if (getCountryLocale().toLowerCase().startsWith("ch")) { |
185 | | - return true; |
186 | | - } |
| 183 | + return getCountryLocale().toLowerCase().startsWith("ch"); |
187 | 184 | } |
188 | | - return false; |
189 | 185 | } |
190 | 186 |
|
191 | 187 | @Override |
|
0 commit comments