HiddenEye-Legacy/controllers/localization_controller.py
2020-08-13 22:56:08 +03:00

17 lines
618 B
Python

from models.localization_model import LocalizationModel
import gettext
class LocalizationController:
def __init__(self, domain: str = None, localedir: str = None, model=LocalizationModel()):
self._model = model
self._domain = domain if domain is not None else self._model.domain
self._localedir = localedir if localedir is not None else self._model.localedir
def initialize_localization(self):
gettext.bindtextdomain(self._domain, self._localedir)
gettext.textdomain(self._domain)
@staticmethod
def _(text_string):
return gettext.gettext(text_string)