From 4e2bdb2b59944f6b7374b2bef433eadf6a9ba20f Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 5 Apr 2023 18:17:57 +0200 Subject: [PATCH] Fixed translation settings --- src/cpl_translation/translation_settings.py | 2 +- unittests/unittests_translation/translation_test_case.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cpl_translation/translation_settings.py b/src/cpl_translation/translation_settings.py index fb6275a3..f4902513 100644 --- a/src/cpl_translation/translation_settings.py +++ b/src/cpl_translation/translation_settings.py @@ -4,7 +4,7 @@ from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC class TranslationSettings(ConfigurationModelABC): def __init__( self, - languages: str = None, + languages: list = None, default_lang: str = None, ): ConfigurationModelABC.__init__(self) diff --git a/unittests/unittests_translation/translation_test_case.py b/unittests/unittests_translation/translation_test_case.py index a0fcc236..beeca782 100644 --- a/unittests/unittests_translation/translation_test_case.py +++ b/unittests/unittests_translation/translation_test_case.py @@ -15,8 +15,7 @@ class TranslationTestCase(unittest.TestCase): def setUp(self): os.chdir(os.path.abspath(TRANSLATION_PATH)) self._translation = TranslationService() - settings = TranslationSettings() - settings.from_dict({"Languages": ["de", "en"], "DefaultLanguage": "en"}) + settings = TranslationSettings(["de", "en"], "en") self._translation.load_by_settings(settings) self._translation.set_default_lang("de") self._translate = TranslatePipe(self._translation)