[Bf-blender-cvs] [b8432c2c8ec] blender-v3.2-release: Tweak i18n messages extraction script to avoid unwanted messages.

Bastien Montagne noreply at git.blender.org
Mon May 9 12:44:41 CEST 2022


Commit: b8432c2c8ec2116c08c7ef2e92b181731b74a679
Author: Bastien Montagne
Date:   Mon May 9 12:40:26 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rBb8432c2c8ec2116c08c7ef2e92b181731b74a679

Tweak i18n messages extraction script to avoid unwanted messages.

Code would add a bit too often the identifier of an RNA class to
translated messages, this is only needed if there is no valid label
available for it.

===================================================================

M	release/scripts/modules/bl_i18n_utils/bl_extract_messages.py

===================================================================

diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
index 87d54213d1b..604a577eec9 100644
--- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
@@ -341,7 +341,8 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
         msgsrc = "bpy.types." + bl_rna.identifier
         msgctxt = bl_rna.translation_context or default_context
 
-        if bl_rna.name and (bl_rna.name != bl_rna.identifier or msgctxt != default_context):
+        if bl_rna.name and (bl_rna.name != bl_rna.identifier or
+                            (msgctxt != default_context and not hasattr(bl_rna, 'bl_label'))):
             process_msg(msgs, msgctxt, bl_rna.name, msgsrc, reports, check_ctxt_rna, settings)
 
         if bl_rna.description:



More information about the Bf-blender-cvs mailing list