Skip to content

Commit

Permalink
Fix i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyEye-FAST committed Jul 13, 2024
1 parent b8c3454 commit da4dace
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def get_locale() -> str:
str: 返回匹配的语言代码,默认返回 "en"。
"""

return request.accept_languages.best_match(["zh-CN", "zh-TW", "zh", "en"], default="en")
locale = request.accept_languages.best_match(
["zh_CN", "zh_TW", "zh", "en"], default="en"
)
return locale


def get_timezone_from_ip() -> Optional[str]:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit da4dace

Please sign in to comment.