From 81f9828c372343f4dfe0576cbbf5c31904666bd9 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Sat, 1 Apr 2023 17:55:26 +0200 Subject: [PATCH] I18n: fix add-on extraction when UI code appears in __init__.py The function which collects files to process in add-on extraction returned only files that did not start with '_', in the case where the add-on was a module in a directory. This excluded __init__.py, which may very well contain UI code, so an exception is added for this case. This change currently allows the extraction of 42 new messages. --- scripts/modules/bl_i18n_utils/bl_extract_messages.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/scripts/modules/bl_i18n_utils/bl_extract_messages.py index f5aa612de8b..c5c5cb007ab 100644 --- a/scripts/modules/bl_i18n_utils/bl_extract_messages.py +++ b/scripts/modules/bl_i18n_utils/bl_extract_messages.py @@ -753,7 +753,8 @@ def dump_py_messages(msgs, reports, addons, settings, addons_only=False): return [] if os.path.isdir(path): return [os.path.join(dpath, fn) for dpath, _, fnames in os.walk(path) for fn in fnames - if not fn.startswith("_") and fn.endswith(".py")] + if fn.endswith(".py") and (fn == "__init__.py" + or not fn.startswith("_"))] return [path] files = [] -- 2.30.2