mirror of
https://github.com/civsocit/olgram.git
synced 2025-12-19 17:16:16 +00:00
Chinese language support (suddenly!)
This commit is contained in:
12
locales/locale.py
Normal file
12
locales/locale.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import gettext
|
||||
from olgram.settings import BotSettings
|
||||
from os.path import dirname
|
||||
|
||||
locales_dir = dirname(__file__)
|
||||
|
||||
lang = BotSettings.language()
|
||||
if lang == "ru":
|
||||
_ = lambda x: x
|
||||
else:
|
||||
t = gettext.translation("olgram", localedir=locales_dir, languages=[lang])
|
||||
_ = t.gettext
|
||||
Reference in New Issue
Block a user