1
0
mirror of https://github.com/civsocit/olgram.git synced 2025-05-24 17:53:26 +00:00
olgram/locales/locale.py
2022-03-22 06:56:39 +03:00

18 lines
345 B
Python

import gettext
from olgram.settings import BotSettings
from os.path import dirname
locales_dir = dirname(__file__)
def dummy_translator(x: str) -> str:
return x
lang = BotSettings.language()
if lang == "ru":
_ = dummy_translator
else:
t = gettext.translation("olgram", localedir=locales_dir, languages=[lang])
_ = t.gettext