Skip to content

Commit

Permalink
Fix empty string translator
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-beerboom committed Oct 24, 2024
1 parent 7181278 commit fc5c0a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openslides_backend/i18n/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self) -> None:

def translate(self, msg: str) -> str:
translation = self.translations[self.current_language].get(msg)
if translation:
if translation and translation.string:
return translation.string
else:
return msg
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/test_translator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from unittest import TestCase

from openslides_backend.i18n.translator import Translator

class TranslatorTest(TestCase):
pass

0 comments on commit fc5c0a7

Please sign in to comment.