Expand loop translations and rename max_history

Replace the single "loop" translation with three explicit keys ("loopOff", "loopTrack", "loopQueue") across all language files to support distinct loop modes. Also standardize the settings key from "max-history" to "max_history" and update main.py to read LOG_SETTINGS.get("max_history", 30) for the TimedRotatingFileHandler backupCount. Files changed: langs/*.json, main.py, settings Example.json.
This commit is contained in:
Choco
2026-05-09 12:30:08 +08:00
parent 47ec3d212a
commit b6a61cbfb5
14 changed files with 38 additions and 15 deletions

View File

@@ -211,7 +211,7 @@ if (LOG_FILE := LOG_SETTINGS.get("file", {})).get("enable", True):
if not os.path.exists(log_path):
os.makedirs(log_path)
file_handler = TimedRotatingFileHandler(filename=f'{log_path}/vocard.log', encoding="utf-8", backupCount=LOG_SETTINGS.get("max-history", 30), when="d")
file_handler = TimedRotatingFileHandler(filename=f'{log_path}/vocard.log', encoding="utf-8", backupCount=LOG_SETTINGS.get("max_history", 30), when="d")
file_handler.namer = lambda name: name.replace(".log", "") + ".log"
file_handler.setFormatter(logging.Formatter('{asctime} [{levelname:<8}] {name}: {message}', '%Y-%m-%d %H:%M:%S', style='{'))
logging.getLogger().addHandler(file_handler)