Fixed base class of translation service

This commit is contained in:
Sven Heidemann 2022-07-16 22:06:38 +02:00
parent 7498fe3255
commit cbf669d3bd
3 changed files with 6 additions and 4 deletions

View File

@ -15,7 +15,7 @@ __title__ = 'cpl_translation'
__author__ = 'Sven Heidemann' __author__ = 'Sven Heidemann'
__license__ = 'MIT' __license__ = 'MIT'
__copyright__ = 'Copyright (c) 2022 sh-edraft.de' __copyright__ = 'Copyright (c) 2022 sh-edraft.de'
__version__ = '2022.7.0.post1' __version__ = '2022.7.0.post2'
from collections import namedtuple from collections import namedtuple
@ -51,4 +51,4 @@ init()
# build-ignore-end # build-ignore-end
VersionInfo = namedtuple('VersionInfo', 'major minor micro') VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major='2022', minor='7', micro='0.post1') version_info = VersionInfo(major='2022', minor='7', micro='0.post2')

View File

@ -4,7 +4,7 @@
"Version": { "Version": {
"Major": "2022", "Major": "2022",
"Minor": "7", "Minor": "7",
"Micro": "0.post1" "Micro": "0.post2"
}, },
"Author": "Sven Heidemann", "Author": "Sven Heidemann",
"AuthorEmail": "sven.heidemann@sh-edraft.de", "AuthorEmail": "sven.heidemann@sh-edraft.de",

View File

@ -1,5 +1,7 @@
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from cpl_translation import TranslationSettings
class TranslationServiceABC(ABC): class TranslationServiceABC(ABC):
@ -16,7 +18,7 @@ class TranslationServiceABC(ABC):
def load(self, lang: str): pass def load(self, lang: str): pass
@abstractmethod @abstractmethod
def load_by_settings(self): pass def load_by_settings(self, settings: TranslationSettings): pass
@abstractmethod @abstractmethod
def translate(self, key: str) -> str: pass def translate(self, key: str) -> str: pass