mirror of
https://github.com/DarkSecDevelopers/HiddenEye-Legacy.git
synced 2024-03-22 21:12:55 +08:00
17 lines
618 B
Python
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)
|