Refactors translations.

This commit is contained in:
PhilipWafula 2021-05-31 15:22:12 +03:00
parent fbf736ba98
commit 9da3b7a099
Signed by untrusted user: mango-habanero
GPG Key ID: B00CE9034DA19FB7
1 changed files with 2 additions and 0 deletions

View File

@ -19,4 +19,6 @@ def translation_for(key: str, preferred_language: Optional[str] = None, **kwargs
"""
if preferred_language:
i18n.set('locale', preferred_language)
else:
i18n.set('locale', i18n.config.get('fallback'))
return i18n.t(key, **kwargs)