From 6927116794903a0de0e6ee93d2067d17abd29c5f Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Mon, 26 Apr 2021 20:56:16 +0200 Subject: [PATCH] Store missing translations in separate logs (#324) --- bin/proxy.py | 4 ++-- lib/globals.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/proxy.py b/bin/proxy.py index 11e3269..e27fafb 100755 --- a/bin/proxy.py +++ b/bin/proxy.py @@ -132,8 +132,8 @@ def translate(text, lang): """ def _log_unknown_translation(lang, text): - with open(MISSING_TRANSLATION_LOG, "a") as f_missing_translation: - f_missing_translation.write("%s %s\n" % (lang, text)) + with open(MISSING_TRANSLATION_LOG % lang, "a") as f_missing_translation: + f_missing_translation.write(text) if "," in text: terms = text.split(",") diff --git a/lib/globals.py b/lib/globals.py index fe49861..062662b 100644 --- a/lib/globals.py +++ b/lib/globals.py @@ -35,7 +35,7 @@ PNG_CACHE = os.path.join(_DATADIR, "cache/png") LRU_CACHE = os.path.join(_DATADIR, "cache/lru") LOG_FILE = os.path.join(_LOGDIR, 'main.log') -MISSING_TRANSLATION_LOG = os.path.join(_LOGDIR, 'missing-translation.log') +MISSING_TRANSLATION_LOG = os.path.join(_LOGDIR, 'missing-translation/%s.log') ALIASES = os.path.join(MYDIR, "share/aliases") ANSI2HTML = os.path.join(MYDIR, "share/ansi2html.sh")