#154 #164
@ -4,7 +4,7 @@ from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
|||||||
class TranslationSettings(ConfigurationModelABC):
|
class TranslationSettings(ConfigurationModelABC):
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
languages: str = None,
|
languages: list = None,
|
||||||
default_lang: str = None,
|
default_lang: str = None,
|
||||||
):
|
):
|
||||||
ConfigurationModelABC.__init__(self)
|
ConfigurationModelABC.__init__(self)
|
||||||
|
@ -15,8 +15,7 @@ class TranslationTestCase(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
os.chdir(os.path.abspath(TRANSLATION_PATH))
|
os.chdir(os.path.abspath(TRANSLATION_PATH))
|
||||||
self._translation = TranslationService()
|
self._translation = TranslationService()
|
||||||
settings = TranslationSettings()
|
settings = TranslationSettings(["de", "en"], "en")
|
||||||
settings.from_dict({"Languages": ["de", "en"], "DefaultLanguage": "en"})
|
|
||||||
self._translation.load_by_settings(settings)
|
self._translation.load_by_settings(settings)
|
||||||
self._translation.set_default_lang("de")
|
self._translation.set_default_lang("de")
|
||||||
self._translate = TranslatePipe(self._translation)
|
self._translate = TranslatePipe(self._translation)
|
||||||
|
Loading…
Reference in New Issue
Block a user