feat: Load language file in lang/ instead of the ini file.
This commit is contained in:
12
util.py
12
util.py
@ -8,7 +8,6 @@ import io
|
||||
import sys
|
||||
import variables as var
|
||||
import zipfile
|
||||
import requests
|
||||
import re
|
||||
import subprocess as sp
|
||||
import logging
|
||||
@ -416,6 +415,17 @@ def verify_password(password, salted_hash, salt):
|
||||
return False
|
||||
|
||||
|
||||
def get_supported_language():
|
||||
lang_files = os.listdir('lang')
|
||||
lang_list = []
|
||||
for lang_file in lang_files:
|
||||
match = re.search("[a-z]{2}_[A-Z]{2}", lang_file)
|
||||
if match:
|
||||
lang_list.append(lang_file)
|
||||
|
||||
return lang_list
|
||||
|
||||
|
||||
class LoggerIOWrapper(io.TextIOWrapper):
|
||||
def __init__(self, logger: logging.Logger, logging_level, fallback_io_buffer):
|
||||
super().__init__(fallback_io_buffer, write_through=True)
|
||||
|
Reference in New Issue
Block a user