mirror of
https://github.com/marcus-alicia/iRedAdmin-Pro-SQL.git
synced 2026-05-27 07:29:44 +00:00
Add files via upload
This commit is contained in:
16
libs/hooks.py
Normal file
16
libs/hooks.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import web
|
||||
|
||||
|
||||
def hook_set_language():
|
||||
# parameter `lang` in URI. e.g. https://xxx/?lang=en_US
|
||||
_lang = web.input(lang=None, _method="GET").get("lang")
|
||||
|
||||
# parameter `lang` in session.
|
||||
if not _lang:
|
||||
_lang = web.config.get("_session", {}).get("lang")
|
||||
|
||||
web.ctx.lang = _lang or "en_US"
|
||||
|
||||
|
||||
def hook_session():
|
||||
pass
|
||||
Reference in New Issue
Block a user