26 * POSSIBILITY OF SUCH DAMAGE. |
26 * POSSIBILITY OF SUCH DAMAGE. |
27 * |
27 * |
28 */ |
28 */ |
29 package de.uapcore.lightpit.modules; |
29 package de.uapcore.lightpit.modules; |
30 |
30 |
31 import de.uapcore.lightpit.*; |
31 import de.uapcore.lightpit.AbstractLightPITServlet; |
|
32 import de.uapcore.lightpit.Constants; |
|
33 import de.uapcore.lightpit.HttpMethod; |
|
34 import de.uapcore.lightpit.RequestMapping; |
32 import de.uapcore.lightpit.viewmodel.LanguageView; |
35 import de.uapcore.lightpit.viewmodel.LanguageView; |
33 import org.slf4j.Logger; |
36 import org.slf4j.Logger; |
34 import org.slf4j.LoggerFactory; |
37 import org.slf4j.LoggerFactory; |
35 |
38 |
36 import javax.servlet.ServletException; |
39 import javax.servlet.ServletException; |
57 |
60 |
58 @Override |
61 @Override |
59 public void init() throws ServletException { |
62 public void init() throws ServletException { |
60 super.init(); |
63 super.init(); |
61 |
64 |
62 Optional<String[]> langs = Functions.availableLanguages(getServletContext()); |
65 Optional<String[]> langs = availableLanguages(); |
63 if (langs.isPresent()) { |
66 if (langs.isPresent()) { |
64 for (String lang : langs.get()) { |
67 for (String lang : langs.get()) { |
65 try { |
68 try { |
66 Locale locale = Locale.forLanguageTag(lang); |
69 Locale locale = Locale.forLanguageTag(lang); |
67 if (locale.getLanguage().isEmpty()) { |
70 if (locale.getLanguage().isEmpty()) { |