fix: main.py:132: DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.

This commit is contained in:
paulpham157 2025-04-11 00:25:08 +07:00
parent fb3e532058
commit d5404e8f57

View File

@ -129,7 +129,8 @@ class Translator:
"""Detect language on Unix-like systems (Linux, macOS)"""
try:
# Get the system locale
system_locale = locale.getdefaultlocale()[0]
locale.setlocale(locale.LC_ALL, '')
system_locale = locale.getlocale()[0]
if not system_locale:
return 'en'