Add files via upload

This commit is contained in:
Harold Finch
2023-04-10 07:18:32 +02:00
committed by GitHub
parent 06ddbf431f
commit 65875d8fef
100 changed files with 84692 additions and 42 deletions

16
libs/hooks.py Normal file
View 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