Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
fix(i18n): πŸ› return a better structure of get languages
Browse files Browse the repository at this point in the history
  • Loading branch information
AnzhiZhang committed Jul 2, 2022
1 parent 45d89e2 commit 8f42def
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def translate(self, key: str, *args, lang=None) -> str:
lang = self.__lang
return self.__data.get(lang).get(key).format(*args)

def get_languages_list(self) -> List[str]:
def get_languages(self) -> Dict[str, str]:
"""
Get languages list.
:return: Language name list.
Get languages data.
:return: A dict which key is language key and value is the name.
"""
return list(self.__data.keys())
return {key: value['langName'] for key, value in self.__data.items()}

0 comments on commit 8f42def

Please sign in to comment.