liquid_feedback_frontend
annotate app/main/index/_action/set_lang.lua @ 1831:36e7c36da131
Do not use args if there are not args
author | bsw |
---|---|
date | Thu Feb 03 12:39:01 2022 +0100 (2022-02-03) |
parents | f52f918b38b8 |
children |
rev | line source |
---|---|
bsw/jbe@4 | 1 local lang = param.get("lang") |
bsw@579 | 2 local valid_lang = false |
bsw@729 | 3 for i, tmp_lang in ipairs(config.enabled_languages) do |
bsw@579 | 4 if lang == tmp_lang then |
bsw@579 | 5 valid_lang = true |
bsw@579 | 6 end |
bsw@579 | 7 end |
bsw@579 | 8 if valid_lang then |
bsw@579 | 9 app.session.lang = lang |
bsw/jbe@4 | 10 app.session:save() |
bsw@292 | 11 if app.session.member_id then |
bsw@286 | 12 app.session.member.lang = app.session.lang |
bsw@286 | 13 app.session.member:save() |
bsw@286 | 14 end |
bsw@579 | 15 end |