perf: lang setting from core

This commit is contained in:
ibuler
2024-06-28 16:36:34 +08:00
committed by 老广
parent f5053728e7
commit 772c9b385c
6 changed files with 25 additions and 9 deletions

View File

@@ -126,7 +126,8 @@ class UserLoginContextMixin:
def get_current_lang(self):
langs = self.get_support_langs()
matched_lang = filter(lambda x: x['code'] == get_language(), langs)
lang = get_language()
matched_lang = filter(lambda x: x['code'] == lang, langs)
return next(matched_lang, langs[0])
@staticmethod