Added translation unittests

This commit is contained in:
2022-07-10 17:56:38 +02:00
parent a604f0e821
commit 2772ea8df2
14 changed files with 206 additions and 9 deletions

View File

@@ -2,7 +2,6 @@ import json
import os.path
from functools import reduce
from cpl_core.console import Console
from cpl_translation.translation_service_abc import TranslationServiceABC
from cpl_translation.translation_settings import TranslationSettings
@@ -18,10 +17,16 @@ class TranslationService(TranslationServiceABC):
TranslationServiceABC.__init__(self)
def set_default_lang(self, lang: str):
if lang not in self._translation:
raise KeyError()
self._default_language = lang
self.set_lang(lang)
def set_lang(self, lang: str):
if lang not in self._translation:
raise KeyError()
self._language = lang
def load(self, lang: str):