Added logic to load translations and to translate texts
This commit is contained in:
22
src/cpl_translation/translation_service_abc.py
Normal file
22
src/cpl_translation/translation_service_abc.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class TranslationServiceABC(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self): pass
|
||||
|
||||
@abstractmethod
|
||||
def set_default_lang(self, lang: str): pass
|
||||
|
||||
@abstractmethod
|
||||
def set_lang(self, lang: str): pass
|
||||
|
||||
@abstractmethod
|
||||
def load(self, lang: str): pass
|
||||
|
||||
@abstractmethod
|
||||
def load_by_settings(self): pass
|
||||
|
||||
@abstractmethod
|
||||
def translate(self, key: str) -> str: pass
|
||||
Reference in New Issue
Block a user