mirror of
https://github.com/DarkSecDevelopers/HiddenEye-Legacy.git
synced 2024-03-22 21:12:55 +08:00
Created localization_controller.py
This commit is contained in:
parent
1eb9dd31ba
commit
dc0c1baa46
17
controllers/localization_controller.py
Normal file
17
controllers/localization_controller.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
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)
|
Loading…
Reference in New Issue
Block a user