bbim messages parser to also parse gettext

This commit is contained in:
Andrej730
2024-01-17 16:24:22 +05:00
parent e867602d9d
commit 9e14829cc1
2 changed files with 8 additions and 3 deletions
@@ -32,6 +32,10 @@ from bpy.props import (
CollectionProperty,
)
import gettext
_ = gettext
def get_style_types(self, context):
if not StylesData.is_loaded:
@@ -88,9 +92,9 @@ def update_shader_graph(self, context):
UV_MODES = [
("UV", "UV", "Actual UV data presented on the geometry"),
("Generated", "Generated", "Automatically-generated UV from the vertex positions of the mesh"),
("Camera", "Camera", "UV from position coordinate in camera space"),
("UV", "UV", _("Actual UV data presented on the geometry")),
("Generated", "Generated", _("Automatically-generated UV from the vertex positions of the mesh")),
("Camera", "Camera", _("UV from position coordinate in camera space")),
]
@@ -79,6 +79,7 @@ def blenderbim_strings_parse(addon_directory=None, po_directory=None):
r'Property\(.*?name\s*=\s*"(.*?)"', # property names
r'report\(\{.*?\}\s*,\s*"(.*?)"', # operator reports
r'info\(\{.*?\}\s*,\s*"(.*?)"', # operator info
r'\b_\("(.*?)"\)' # gettext called with `_`
]
regexes = [re.compile(pattern) for pattern in patterns]
matched_dict: Dict[str, Message] = dict()