i18n: Simplify logic for translation data in page_params.

This refactors the get_translation_data function to return an empty
dict when 'en' language is passed, to avoid repetition of code in
stats and home.
This commit is contained in:
Abhijeet Prasad Bodas
2020-09-24 16:34:54 +05:30
committed by Tim Abbott
parent 4e6c0989db
commit d9d51e32c1
2 changed files with 4 additions and 6 deletions

View File

@@ -69,7 +69,9 @@ def get_available_language_codes() -> List[str]:
return codes
def get_language_translation_data(language: str) -> Dict[str, str]:
if language == 'zh-hans':
if language == 'en':
return {}
elif language == 'zh-hans':
language = 'zh_Hans'
elif language == 'zh-hant':
language = 'zh_Hant'