From a5df83167e38b013d00177dd3d37ca7f6536cf6f Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Sun, 9 Jun 2024 18:14:58 +0200 Subject: [PATCH] I18n: Fix add-on extraction - The "location" and "warning" fields in bl_info are no longer exposed in the interface, so there is no need to extract them any more. - Some add-ons do not define a description (Copy Global Transform for example), so they should be skipped. - Some third-party legacy add-ons do not use the 'support' field, and that can cause an error in extraction. Since this won't happen for built-in add-ons, checking that an add-on is built-in is enough. Pull Request: https://projects.blender.org/blender/blender/pulls/122970 --- scripts/modules/bl_i18n_utils/bl_extract_messages.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/scripts/modules/bl_i18n_utils/bl_extract_messages.py index d6e1d80f197..3f56e217ce2 100644 --- a/scripts/modules/bl_i18n_utils/bl_extract_messages.py +++ b/scripts/modules/bl_i18n_utils/bl_extract_messages.py @@ -1021,7 +1021,9 @@ def dump_asset_messages(msgs, reports, settings): def dump_addon_bl_info(msgs, reports, module, settings): - for prop in ('name', 'location', 'description', 'warning'): + for prop in ('name', 'description'): + if prop not in module.bl_info: + continue process_msg( msgs, settings.DEFAULT_CONTEXT, @@ -1077,10 +1079,8 @@ def dump_messages(do_messages, do_checks, settings): # Get strings from addons' bl_info. import addon_utils for module in addon_utils.modules(): - # Only process official add-ons, i.e. those marked as 'OFFICIAL' and - # existing in the system add-ons directory (not user-installed ones). - if (module.bl_info['support'] != 'OFFICIAL' - or not bpy.path.is_subdir(module.__file__, bpy.utils.system_resource('SCRIPTS'))): + # Only process official add-ons, i.e. those in the system directory (not user-installed ones). + if not bpy.path.is_subdir(module.__file__, bpy.utils.system_resource('SCRIPTS')): continue dump_addon_bl_info(msgs, reports, module, settings)