liquid_feedback_frontend
diff app/main/index/_action/set_lang.lua @ 579:a06634d17718
Make available languages configurable
author | bsw |
---|---|
date | Wed Jun 20 11:31:59 2012 +0200 (2012-06-20) |
parents | 44f9a09ea51c |
children | f52f918b38b8 |
line diff
1.1 --- a/app/main/index/_action/set_lang.lua Wed Jun 20 08:07:39 2012 +0200 1.2 +++ b/app/main/index/_action/set_lang.lua Wed Jun 20 11:31:59 2012 +0200 1.3 @@ -1,9 +1,15 @@ 1.4 local lang = param.get("lang") 1.5 -if lang == "de" or lang == "en" or lang == "eo" then 1.6 - app.session.lang = param.get("lang") 1.7 +local valid_lang = false 1.8 +for i, tmp_lang in ipairs(config.available_languages) do 1.9 + if lang == tmp_lang then 1.10 + valid_lang = true 1.11 + end 1.12 +end 1.13 +if valid_lang then 1.14 + app.session.lang = lang 1.15 app.session:save() 1.16 if app.session.member_id then 1.17 app.session.member.lang = app.session.lang 1.18 app.session.member:save() 1.19 end 1.20 -end 1.21 \ No newline at end of file 1.22 +end