src/main/kotlin/de/uapcore/lightpit/servlet/LanguageServlet.kt

changeset 298
1275eb652008
parent 254
55ca6cafc3dd
equal deleted inserted replaced
296:355c86eaeca5 298:1275eb652008
56 private fun selectLanguage(http: HttpRequest, dao: DataAccessObject) { 56 private fun selectLanguage(http: HttpRequest, dao: DataAccessObject) {
57 val lang = http.param("language") 57 val lang = http.param("language")
58 if (lang != null) { 58 if (lang != null) {
59 val locale = Locale.forLanguageTag(lang) 59 val locale = Locale.forLanguageTag(lang)
60 if (!locale.language.isNullOrBlank()) { 60 if (!locale.language.isNullOrBlank()) {
61 http.response.locale = locale 61 super.selectLanguage(http, locale)
62 http.session.setAttribute(Constants.SESSION_ATTR_LANGUAGE, locale)
63 } 62 }
64 } 63 }
65 64
66 viewLanguages(http, dao) 65 viewLanguages(http, dao)
67 } 66 }

mercurial