1
0
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:
mihalin
2022-03-22 05:43:10 +03:00
parent db54473e0f
commit 1a9646d607
18 changed files with 740 additions and 126 deletions

12
locales/locale.py Normal file
View 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